Class: Shog::Kconfig
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize ⇒ Kconfig
constructor
A new instance of Kconfig.
- #rule ⇒ Object
- #target(params) ⇒ Object
Constructor Details
#initialize ⇒ Kconfig
Returns a new instance of Kconfig.
9 10 11 |
# File 'lib/rule/kconfig.rb', line 9 def initialize @ldflags = [] end |
Class Method Details
.parse(file) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rule/kconfig.rb', line 26 def self.parse(file) config = {} for line in IO.readlines(file) next if line.start_with?("#") if line =~ /^CONFIG_(.*?)=(.*)$/ key = $1.to_sym val = $2 case val when "y" then val = true when /^\d+$/ then val = val.to_i when /^\"(.*)\"$/ then val = $1 end config[key] = val end end config end |