class RBT::Cookbooks::CreateDatabase
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
new( optional_input = nil, run_already = true )
click to toggle source
Public Instance Methods
_(i)
click to toggle source
data?()
click to toggle source
display_generated_file()
click to toggle source
populate_database()
click to toggle source
#¶ ↑
populate_database
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_database.rb, line 124 def populate_database available_programs?.each {|the_program| @query = RBT::Cookbooks::Cookbook.new(the_program) { :bypass_menu } @query.feedback what = InsertInto[@name_of_the_table, @query.program_path?] append_what_into(what, file?) } end
report_result()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_database.rb, line 156 def run if Object.const_defined? :SqlParadise # The functionality depends on SqlParadise. _ SqlParadise::CreateDatabase['cookbooks'] # ===================================================================== # # Populate the table next. # ===================================================================== # dataset = RBT.registered_cookbook_entries? dataset.map! {|entry| entry+' varchar(120)' } @name_of_the_table = 'cookbooks' _ CreateTable[@name_of_the_table] entries_in_the_table = '('+dataset.join(', ')+')' _ InsertInto[@name_of_the_table, entries_in_the_table] report_result save_result populate_database # We add our programs next. end end
save_result()
click to toggle source
save_where?()
click to toggle source
#¶ ↑
save_where?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_database.rb, line 149 def save_where? "#{temp_dir?}database_for_programs.sql" end
Also aliased as: file?
set_input(i = nil)
click to toggle source