Class: Bivouac::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/bivouac/commands/plugin.rb

Constant Summary collapse

@@cmds =
[:help, :install, :list]

Instance Method Summary collapse

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

#runObject



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