class Cookbooks::CreateGlobalYamlDatabase
Constants
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
- STORE_HERE
#¶ ↑
STORE_HERE¶ ↑
#¶ ↑
Public Class Methods
new( run_already = true )
click to toggle source
Public Instance Methods
encoding?()
click to toggle source
iterate_over_every_program()
click to toggle source
#¶ ↑
#iterate_over_every_program¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/create_global_yaml_database.rb, line 93 def iterate_over_every_program @all_programs.each_with_index {|program, index| dataset = Cookbooks::Cookbook.new(program) { :bypass_menu } dataset = dataset.dataset? hash = {} program = program.encode(encoding?) hash[program] = dataset _ = {} dataset.each_pair {|key, value| if key key = key.encode(encoding?) begin value = value.encode(encoding?) if value.is_a? String rescue Encoding::InvalidByteSequenceError opnn; e swarn('Error for '+simp(value)) exit end _[key] = value end } dataset = _ opnn; e "Now working on the program #{simp(program)}." @dataset.merge!(hash) } end
obtain_all_programs()
click to toggle source
opnn()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
store_into_yaml_file()
click to toggle source
#¶ ↑
#store_into_yaml_file¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/create_global_yaml_database.rb, line 73 def store_into_yaml_file into = STORE_HERE opnn; e "Now storing into `#{sfile(into)}`." if File.exist? into File.delete(into) # Always get rid of the old yaml file first. end what = YAML.dump(@dataset) save_what_into(what, into) end