Class: Commands
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(env = nil, directory = Rake.application.original_dir) ⇒ Commands
constructor
A new instance of Commands.
Methods inherited from Hash
Constructor Details
#initialize(env = nil, directory = Rake.application.original_dir) ⇒ Commands
Returns a new instance of Commands.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/commands.rb', line 17 def initialize env=nil,directory=Rake.application.original_dir @env=env @env=Environment.new() if @env.nil? Dir.chdir(directory) do self[:pull]=Pull.new self[:update]=Update.new self[:setup]=Setup.new self[:build]=Build.new self[:test]=Test.new self[:analyze]=Analyze.new self[:doc]=Doc.new self[:package]=Package.new self[:publish]=Publish.new self[:add]=Add.new self[:commit]=Commit.new self[:push]=Push.new end end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
16 17 18 |
# File 'lib/commands.rb', line 16 def env @env end |
Instance Method Details
#info ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/commands.rb', line 36 def info puts "Commands" self.each{|k,v| v.update if v.respond_to? 'update' if v.length > 0 puts " #{k}" v.each{|c| puts " #{c[:input]}" if(!c.kind_of?(Hash)) } end } end |