def generate_config
user_output = Rddc_txt_file.new(@default_file, "user_output")
explanation_file = Rddc_txt_file.new(@default_file, "config_explanation")
@config_file.to_a.each do |config|
if explanation_file[config[0]] != nil then
input = nil
valid_options = Rddc_txt_file.new(@valid_options, config[0])
puts explanation_file[config[0]]
puts user_output["valid_options"] + valid_options.to_s if valid_options.valid?
while (input == nil)
print config[0] + "="
input = gets
if !valid_options.has_key?((input.chop)) and valid_options.valid? then
puts user_output["invalid_option"]
input = nil
end
input = input.chop if input != nil
end
@config_file[config[0]]=input
end
if config[0] == "language" then
@default_file = user_output.dirname + "/global." + input
puts @default_file
user_output = Rddc_txt_file.new(@default_file, "user_output")
explanation_file = Rddc_txt_file.new(@default_file, "config_explanation")
end
end
explanation_file = Rddc_txt_file.new(@default_file, "update_explanation")
@update_file.to_a.each do |config|
service_config_file = @config_file.dirname + "/" + @config_file["service"]
valid_update_variables = Rddc_txt_file.new(service_config_file, "update variables")
if Debug != 0 then
puts service_config_file
puts valid_update_variables.to_a.to_s
end
if valid_update_variables.to_hash.include? config[0] then
if explanation_file[config[0]] != nil then
input = nil
valid_options = Rddc_txt_file.new(service_config_file, config[0])
puts explanation_file[config[0]]
puts user_output["update_variables"] + valid_options.to_s if valid_options.valid?
while (input == nil)
print config[0] + "="
input = gets
input = input.chop
if Debug != 0 then
puts input + "|" if input != nil
end
if !valid_options.has_key? input and valid_options.valid? then
puts user_output["invalid_update_variables"]
input = nil
end
end
@update_file[config[0]]=input
end
end
end
@update_file.write
@config_file.write
end