lib/riddle/configuration/section.rb in riddle-2.1.0 vs lib/riddle/configuration/section.rb in riddle-2.2.0

- old
+ new

@@ -2,17 +2,17 @@ class Configuration class Section def self.settings [] end - + def valid? true end - + private - + def settings_body settings.select { |setting| !send(setting).nil? }.collect { |setting| if send(setting) == "" @@ -23,32 +23,32 @@ } end conf.length == 0 ? nil : conf }.flatten.compact end - + def setting_to_array(setting) value = send(setting) case value when Array then value when TrueClass then [1] when FalseClass then [0] else [value] end end - + def rendered_setting(setting) return setting unless setting.is_a?(String) - + index = 8100 - output = setting.clone - + output = String.new(setting) + while index < output.length output.insert(index, "\\\n") index += 8100 end - + output end def settings self.class.settings