class RBT::GenerateRbtConfiguration
Constants
- LAST_UPDATE
#¶ ↑
LAST_UPDATE
¶ ↑Keep track when this class was last updated.
#¶ ↑
- SAVE_NEW_FILE_HERE
#¶ ↑
SAVE_NEW_FILE_HERE
¶ ↑#¶ ↑
- STORE_WHERE_BASE_DIR
#¶ ↑
STORE_WHERE_BASE_DIR
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
add(i)
click to toggle source
#¶ ↑
add (add tag)¶ ↑
This will append to @_ and will also append two newlines.
#¶ ↑
# File lib/rbt/generate_files/generate_rbt_configuration.rb, line 75 def add(i) @_ << i+N end
Also aliased as: _
e_get_user_input_then_add( variable_name, desc = '' )
click to toggle source
#¶ ↑
e_get_user_input_then_add
¶ ↑
Here we will combine get_user_input
() with add().
#¶ ↑
# File lib/rbt/generate_files/generate_rbt_configuration.rb, line 147 def e_get_user_input_then_add( variable_name, desc = '' ) desc = "Description: #{variable_name}" if desc.to_s.empty? print desc+' ' get_user_input # Obtain the user input here. add ' '+variable_name+': '+@user_input end
get_user_input()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/generate_files/generate_rbt_configuration.rb, line 53 def reset super() infer_the_namespace # ========================================================================== # # === @_ # ========================================================================== # @_ = ''.dup # The result string. set_store_here SAVE_NEW_FILE_HERE end
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/generate_files/generate_rbt_configuration.rb, line 159 def run show_welcome_message opne 'We will now generate a new configuration file.' opne 'We will store this configuration file here: '+sfile(@store_here) opne 'We will guide you through the process of creating a' opne 'new configuration file from scratch.' show_last_update run_through_all_configure_options save_result # store it into a new file. end
run_through_all_configure_options()
click to toggle source
#¶ ↑
run_through_all_configure_options
¶ ↑
Here we will grab all configuration entries.
#¶ ↑
# File lib/rbt/generate_files/generate_rbt_configuration.rb, line 110 def run_through_all_configure_options _ = RBT.config_directory? # ========================================================================== # # Load it up next. # ========================================================================== # available_keys = Dir["#{_}*.yml"].map {|entry| File.basename(entry).gsub!(/\.yml$/,'') } available_keys.each {|entry| print entry.ljust(30)+': [yes/no] or [true/false] or [t/f]' value = get_user_input add "#{entry}: #{value}" } end
save_result()
click to toggle source
set_store_here(i)
click to toggle source
show_last_update()
click to toggle source