Module: Vop::PluginSyntax
- Defined in:
- lib/vop/syntax/plugin_syntax.rb
Instance Method Summary collapse
- #auto_load(bool) ⇒ Object
- #config_param(name, options = {}) ⇒ Object
- #config_param!(name, options = {}) ⇒ Object
- #depends_on(others) ⇒ Object
- #description(string) ⇒ Object
- #hook(hook_sym, &block) ⇒ Object
- #on(hook_sym, &block) ⇒ Object
- #resolve_options_string(options) ⇒ Object
Instance Method Details
#auto_load(bool) ⇒ Object
32 33 34 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 32 def auto_load(bool) @plugin.[:auto_load] = bool end |
#config_param(name, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 14 def config_param(name, = {}) = () @plugin.params << CommandParam.new(name, ) end |
#config_param!(name, options = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 20 def config_param!(name, = {}) = () .merge! mandatory: true config_param(name, ) end |
#depends_on(others) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 36 def depends_on(others) others = [ others ] unless others.is_a?(Array) others.each do |other| $logger.debug "plugin #{@plugin.name} depends on #{other}" @plugin.dependencies << other.to_s end end |
#description(string) ⇒ Object
28 29 30 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 28 def description(string) @plugin.description = string end |
#hook(hook_sym, &block) ⇒ Object
49 50 51 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 49 def hook(hook_sym, &block) @op.hook(hook_sym, &block) end |
#on(hook_sym, &block) ⇒ Object
45 46 47 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 45 def on(hook_sym, &block) @plugin.hook(hook_sym, &block) end |
#resolve_options_string(options) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/vop/syntax/plugin_syntax.rb', line 5 def () if .is_a? String = { description: } end end |