class RBT::UseFlags
Constants
- REGISTERED_COMPILE_FLAGS
#¶ ↑
REGISTERED_COMPILE_FLAGS
¶ ↑bl $RBT/YAML/registered_compile_flags.yml Right now it is hardcoded.
#¶ ↑
Public Class Methods
new( run_already = true )
click to toggle source
Public Instance Methods
check_for_environment()
click to toggle source
environment_use_flags?()
click to toggle source
#¶ ↑
environment_use_flags
?¶ ↑
Stores ENV stuff.
#¶ ↑
# File lib/rbt/utility_scripts/use_flags.rb, line 102 def environment_use_flags? @environment_use_flags end
Also aliased as: environment_use_flags
is_included?( this_use_flag = use_flags? )
click to toggle source
#¶ ↑
is_included?¶ ↑
Find out if the use-flag we want to use is already registered.
#¶ ↑
# File lib/rbt/utility_scripts/use_flags.rb, line 111 def is_included?( this_use_flag = use_flags? ) @string = ''.dup # Empty it again here. if @registered_compile_flags.keys.include? this_use_flag @string << ' '+@registered_compile_flags[this_use_flag] elsif this_use_flag.include? ' ' this_use_flag.split(' ').each { |splitted| if @registered_compile_flags.keys.include? splitted @string << ' '+@registered_compile_flags[splitted] end } else # Else it may be enable or disable # We keep that consistent. if this_use_flag.include? 'enable' is_included? value.gsub(/enable/,'with') elsif this_use_flag.include? 'disable' is_included? value.gsub(/disable/,'without') end end @string.strip! end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/use_flags.rb, line 52 def reset super() # ======================================================================= # # === @environment_use_flags # ======================================================================= # @environment_use_flags = nil dataset = YAML.load_file(FILE_USE_FLAGS) if File.exist?(FILE_USE_FLAGS) # === @use_flags @use_flags = dataset['USE'].strip # {"USE"=>"-arts +mp3 +ogg"} # === @registered_compile_flags @registered_compile_flags = REGISTERED_COMPILE_FLAGS end
run()
click to toggle source
sanitize_registered_compile_flags()
click to toggle source
#¶ ↑
sanitize_registered_compile_flags
¶ ↑
This is needed to make proper default values for the ‘+’ use flags.
It is run once on startup. Afterwards it does not need to be run again.
#¶ ↑
# File lib/rbt/utility_scripts/use_flags.rb, line 72 def sanitize_registered_compile_flags @registered_compile_flags.dup.each_pair { |k, v| @registered_compile_flags[ k[1..-1] ] = v if k.include? '+' # k[1..-1] includes all but leading + } end