Class: Bake::ToolchainInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/bake/options/showToolchains.rb

Class Method Summary collapse

Class Method Details

.printHash(x, level) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bake/options/showToolchains.rb', line 4

def self.printHash(x, level)
  x.each do |k,v|
    if Hash === v
      if level > 0
        level.times {print "  "}
      else
        print "\n"
      end
      puts k
      printHash(v,level+1)
    elsif Array === v or String === v or true == v or false == v or Symbol === v
      level.times {print "  "}
      print "\n" if (level == 0)
      puts "#{k} = #{v}"
    end
  end
end

.showToolchain(x) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/bake/options/showToolchains.rb', line 22

def self.showToolchain(x)
  tcs = Bake::Toolchain::Provider[x]
  if tcs.nil?
    puts "Toolchain not available"
  else
    printHash(tcs, 0)
  end
  ExitHelper.exit(0)
end

.showToolchainListObject



32
33
34
35
36
# File 'lib/bake/options/showToolchains.rb', line 32

def self.showToolchainList()
  puts "Available toolchains:"
  Bake::Toolchain::Provider.list.keys.each { |c| puts "* #{c}" }
  ExitHelper.exit(0)
end