11class Options
2- attr_reader :configs
2+ attr_reader :options
33
44 def initialize
5- @configs = { }
6- @pending_configs = [ ]
7- @ignored_configs = [ ]
5+ @options = { }
6+ @pending_options = [ ]
7+ @ignored_options = [ ]
88
99 configure
1010 end
1111
1212 def help
13- @configs
13+ @options
1414 . collect_concat { |name , ( type , value ) |
1515 option = option_name ( name )
1616 if type == :bool
@@ -23,7 +23,7 @@ def help
2323 end
2424
2525 def to_s
26- @configs
26+ @options
2727 . reject { |name , ( type , value ) | value . nil? }
2828 . collect { |name , ( type , value ) | "-D #{ name } =#{ value == true ? "ON" : value == false ? "OFF" : value . shellescape } " }
2929 . join ( " " )
@@ -51,11 +51,11 @@ def cmake_options
5151
5252 def missing_options
5353 cmake_options . collect { |name , type , value | name } -
54- @configs . keys - @pending_configs - @ignored_configs
54+ @options . keys - @pending_options - @ignored_options
5555 end
5656
5757 def extra_options
58- @configs . keys + @pending_configs - @ignored_configs -
58+ @options . keys + @pending_options - @ignored_options -
5959 cmake_options . collect { |name , type , value | name }
6060 end
6161
@@ -192,14 +192,14 @@ def option_name(name)
192192 def bool ( name )
193193 option = option_name ( name )
194194 value = enable_config ( option )
195- @configs [ name ] = [ :bool , value ]
195+ @options [ name ] = [ :bool , value ]
196196 end
197197
198198 def string ( name , type = :string )
199199 option = "--#{ option_name ( name ) } "
200200 value = arg_config ( option )
201201 raise "String expected for #{ option } " if value == true || value &.empty?
202- @configs [ name ] = [ type , value ]
202+ @options [ name ] = [ type , value ]
203203 end
204204
205205 def path ( name )
@@ -211,10 +211,10 @@ def filepath(name)
211211 end
212212
213213 def pending ( name )
214- @pending_configs << name
214+ @pending_options << name
215215 end
216216
217217 def ignored ( name )
218- @ignored_configs << name
218+ @ignored_options << name
219219 end
220220end
0 commit comments