Skip to content

Commit

Permalink
dumper: Support frozen strings
Browse files Browse the repository at this point in the history
In Ruby 2.7 and newer, frozen strings became a thing. I maintain a
Puppet module where the dumper.rb got vendored in and frozen strings are
now enbled in the module. With this patch the dumper.rb supports frozen
strings.
  • Loading branch information
bastelfreak committed Jan 19, 2022
1 parent 04898eb commit 0ccdfbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/toml-rb/dumper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "date"

module TomlRB
Expand Down Expand Up @@ -53,7 +55,7 @@ def dump_pairs(simple, nested, table_array, prefix = [])
def dump_simple_pairs(simple_pairs)
simple_pairs.each do |key, val|
key = quote_key(key) unless bare_key? key
@toml_str << "#{key} = #{to_toml(val)}\n"
@toml_str += "#{key} = #{to_toml(val)}\n"
end
end

Expand Down

0 comments on commit 0ccdfbb

Please sign in to comment.