lib/toml/generator.rb in toml-0.0.4 vs lib/toml/generator.rb in toml-0.1.0

- old
+ new

@@ -46,9 +46,12 @@ if !path.empty? && !other_pairs.empty? @body += "[#{path}]\n" end other_pairs.each do |pair| key, val = pair + if key.include? '.' + raise SyntaxError, "Periods are not allowed in keys (failed on key: #{key.inspect})" + end @body += "#{key} = #{format(val)}\n" end @body += "\n" unless other_pairs.empty? # Then deal with sub-hashes