Class: Commands

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#execute, #to_html

Constructor Details

#initialize(env = nil, directory = Rake.application.original_dir) ⇒ Commands

Returns a new instance of Commands.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/commands.rb', line 13

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[:publish]=Publish.new
    self[:add]=Add.new
    self[:commit]=Commit.new
    self[:push]=Push.new
    end
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



12
13
14
# File 'lib/commands.rb', line 12

def env
  @env
end

Instance Method Details

#infoObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/commands.rb', line 31

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}" if(!c.kind_of?(Hash))
      }
    end
  }
end