Class: Bivouac::Plugin
- Inherits:
-
Object
- Object
- Bivouac::Plugin
- Defined in:
- lib/bivouac/commands/plugin.rb
Constant Summary collapse
- @@cmds =
[:help, :install, :list]
Instance Method Summary collapse
-
#initialize(argv) ⇒ Plugin
constructor
A new instance of Plugin.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Plugin
Returns a new instance of Plugin.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bivouac/commands/plugin.rb', line 13 def initialize( argv ) # Command (install, list, ...) @command = argv.shift # Plugin arguments. # Example : # script/plugin install roo_s_tent will_paginate # @script_arguments = ['roo_s_tent', 'will_paginate'] @script_arguments = argv.dup # Application environment @app = Bivouac::Environment.new( ) # ... end |
Instance Method Details
#run ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/bivouac/commands/plugin.rb', line 29 def run begin send( @command.to_sym ) rescue => e send :help end end |