From 1e5684ff2cbde8be819eac1e50e0edbfd120d77b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 24 Apr 2016 02:31:53 +0900 Subject: Add frozen_string_literal: false When you change this to true, you may need to add more tests. --- lib/json.rb | 1 + lib/json/add/bigdecimal.rb | 1 + lib/json/add/complex.rb | 1 + lib/json/add/core.rb | 1 + lib/json/add/date.rb | 1 + lib/json/add/date_time.rb | 1 + lib/json/add/exception.rb | 1 + lib/json/add/ostruct.rb | 1 + lib/json/add/range.rb | 1 + lib/json/add/rational.rb | 1 + lib/json/add/regexp.rb | 1 + lib/json/add/struct.rb | 1 + lib/json/add/symbol.rb | 1 + lib/json/add/time.rb | 1 + lib/json/common.rb | 1 + lib/json/generic_object.rb | 1 + lib/json/pure/generator.rb | 1 + lib/json/pure/parser.rb | 1 + lib/json/version.rb | 1 + tests/json_addition_test.rb | 1 + tests/json_common_interface_test.rb | 1 + tests/json_encoding_test.rb | 1 + tests/json_ext_parser_test.rb | 1 + tests/json_fixtures_test.rb | 1 + tests/json_generic_object_test.rb | 1 + tests/json_parser_test.rb | 1 + tests/json_string_matching_test.rb | 1 + 27 files changed, 27 insertions(+) diff --git a/lib/json.rb b/lib/json.rb index 24aa385..b5a6912 100644 --- a/lib/json.rb +++ b/lib/json.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'json/common' ## diff --git a/lib/json/add/bigdecimal.rb b/lib/json/add/bigdecimal.rb index 0ef69f1..539daee 100644 --- a/lib/json/add/bigdecimal.rb +++ b/lib/json/add/bigdecimal.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/complex.rb b/lib/json/add/complex.rb index 3d653bb..28ef734 100644 --- a/lib/json/add/complex.rb +++ b/lib/json/add/complex.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/core.rb b/lib/json/add/core.rb index 77d9dc0..bfb017c 100644 --- a/lib/json/add/core.rb +++ b/lib/json/add/core.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false # This file requires the implementations of ruby core's custom objects for # serialisation/deserialisation. diff --git a/lib/json/add/date.rb b/lib/json/add/date.rb index 458d9eb..2552356 100644 --- a/lib/json/add/date.rb +++ b/lib/json/add/date.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/date_time.rb b/lib/json/add/date_time.rb index a1009cf..38b0e86 100644 --- a/lib/json/add/date_time.rb +++ b/lib/json/add/date_time.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/exception.rb b/lib/json/add/exception.rb index f4b150d..a107e5b 100644 --- a/lib/json/add/exception.rb +++ b/lib/json/add/exception.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/ostruct.rb b/lib/json/add/ostruct.rb index a62f92f..7c13910 100644 --- a/lib/json/add/ostruct.rb +++ b/lib/json/add/ostruct.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/range.rb b/lib/json/add/range.rb index 0df382c..93529fb 100644 --- a/lib/json/add/range.rb +++ b/lib/json/add/range.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/rational.rb b/lib/json/add/rational.rb index ee39c20..356940b 100644 --- a/lib/json/add/rational.rb +++ b/lib/json/add/rational.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/regexp.rb b/lib/json/add/regexp.rb index 9adf06c..a93866b 100644 --- a/lib/json/add/regexp.rb +++ b/lib/json/add/regexp.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/struct.rb b/lib/json/add/struct.rb index e1e2480..e8395ed 100644 --- a/lib/json/add/struct.rb +++ b/lib/json/add/struct.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/symbol.rb b/lib/json/add/symbol.rb index 6df77ca..74b13a4 100644 --- a/lib/json/add/symbol.rb +++ b/lib/json/add/symbol.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/add/time.rb b/lib/json/add/time.rb index 1227508..b73acc4 100644 --- a/lib/json/add/time.rb +++ b/lib/json/add/time.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end diff --git a/lib/json/common.rb b/lib/json/common.rb index 55908f8..b53041b 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'json/version' require 'json/generic_object' diff --git a/lib/json/generic_object.rb b/lib/json/generic_object.rb index 3a14f0e..6c8f039 100644 --- a/lib/json/generic_object.rb +++ b/lib/json/generic_object.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'ostruct' module JSON diff --git a/lib/json/pure/generator.rb b/lib/json/pure/generator.rb index 98bc369..ccb6fe4 100644 --- a/lib/json/pure/generator.rb +++ b/lib/json/pure/generator.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false module JSON MAP = { "\x0" => '\u0000', diff --git a/lib/json/pure/parser.rb b/lib/json/pure/parser.rb index f02f408..b907236 100644 --- a/lib/json/pure/parser.rb +++ b/lib/json/pure/parser.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'strscan' module JSON diff --git a/lib/json/version.rb b/lib/json/version.rb index b91ccd7..b4d1b3b 100644 --- a/lib/json/version.rb +++ b/lib/json/version.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false module JSON # JSON version VERSION = '2.0.0' diff --git a/tests/json_addition_test.rb b/tests/json_addition_test.rb index cb07659..a028e0f 100644 --- a/tests/json_addition_test.rb +++ b/tests/json_addition_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' require 'json/add/core' require 'json/add/complex' diff --git a/tests/json_common_interface_test.rb b/tests/json_common_interface_test.rb index 30c54c8..b2051d4 100644 --- a/tests/json_common_interface_test.rb +++ b/tests/json_common_interface_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' require 'stringio' require 'tempfile' diff --git a/tests/json_encoding_test.rb b/tests/json_encoding_test.rb index d983e12..29ae02e 100644 --- a/tests/json_encoding_test.rb +++ b/tests/json_encoding_test.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +#frozen_string_literal: false require 'test_helper' class JSONEncodingTest < Test::Unit::TestCase diff --git a/tests/json_ext_parser_test.rb b/tests/json_ext_parser_test.rb index ade9784..c5a030e 100644 --- a/tests/json_ext_parser_test.rb +++ b/tests/json_ext_parser_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' class JSONExtParserTest < Test::Unit::TestCase diff --git a/tests/json_fixtures_test.rb b/tests/json_fixtures_test.rb index 0419983..01954fe 100644 --- a/tests/json_fixtures_test.rb +++ b/tests/json_fixtures_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' class JSONFixturesTest < Test::Unit::TestCase diff --git a/tests/json_generic_object_test.rb b/tests/json_generic_object_test.rb index 171fdb8..82742dc 100644 --- a/tests/json_generic_object_test.rb +++ b/tests/json_generic_object_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' class JSONGenericObjectTest < Test::Unit::TestCase diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb index 1d1987b..5120f09 100644 --- a/tests/json_parser_test.rb +++ b/tests/json_parser_test.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: false require 'test_helper' require 'stringio' diff --git a/tests/json_string_matching_test.rb b/tests/json_string_matching_test.rb index 7fec841..5d55dc3 100644 --- a/tests/json_string_matching_test.rb +++ b/tests/json_string_matching_test.rb @@ -1,3 +1,4 @@ +#frozen_string_literal: false require 'test_helper' require 'time' -- cgit v1.2.1