Class: VPM::ManifestParser
- Inherits:
-
Object
- Object
- VPM::ManifestParser
- Defined in:
- lib/vpm/manifest_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ManifestParser
constructor
A new instance of ManifestParser.
- #options_to_args(options) ⇒ Object
- #parse(content) ⇒ Object
- #plugin(name, options = {}) ⇒ Object
- #plugins ⇒ Object
Constructor Details
#initialize ⇒ ManifestParser
Returns a new instance of ManifestParser.
7 8 9 |
# File 'lib/vpm/manifest_parser.rb', line 7 def initialize @plugins = {} end |
Class Method Details
.parse(content) ⇒ Object
3 4 5 |
# File 'lib/vpm/manifest_parser.rb', line 3 def self.parse(content) self.new.parse(content) end |
Instance Method Details
#options_to_args(options) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vpm/manifest_parser.rb', line 23 def () args = [] if [:git] args += ["--git", [:git]] args += ["--tag", [:tag]] if [:tag] end args end |
#parse(content) ⇒ Object
11 12 13 14 |
# File 'lib/vpm/manifest_parser.rb', line 11 def parse(content) instance_eval(content) plugins end |
#plugin(name, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/vpm/manifest_parser.rb', line 16 def plugin(name, = {}) # FIXME hardcode to install for now = VPM::CommandOptions.parse!("install", ()) type = .delete(:type) @plugins[name] = Plugin.new(name, type, ) end |
#plugins ⇒ Object
34 35 36 |
# File 'lib/vpm/manifest_parser.rb', line 34 def plugins @plugins.values end |