From 56d545e278577b3cfb3f71905a54f85cd2fba16c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 19 Jun 2017 18:34:56 +0900 Subject: make frozen_string_literal: true --- ext/psych/extconf.rb | 2 +- lib/psych.rb | 2 +- lib/psych/class_loader.rb | 2 +- lib/psych/coder.rb | 2 +- lib/psych/core_ext.rb | 2 +- lib/psych/exception.rb | 2 +- lib/psych/handler.rb | 2 +- lib/psych/handlers/document_stream.rb | 2 +- lib/psych/handlers/recorder.rb | 2 +- lib/psych/json/ruby_events.rb | 2 +- lib/psych/json/stream.rb | 2 +- lib/psych/json/tree_builder.rb | 2 +- lib/psych/json/yaml_events.rb | 2 +- lib/psych/nodes.rb | 2 +- lib/psych/nodes/alias.rb | 2 +- lib/psych/nodes/document.rb | 2 +- lib/psych/nodes/mapping.rb | 2 +- lib/psych/nodes/node.rb | 2 +- lib/psych/nodes/scalar.rb | 2 +- lib/psych/nodes/sequence.rb | 2 +- lib/psych/nodes/stream.rb | 2 +- lib/psych/omap.rb | 2 +- lib/psych/parser.rb | 2 +- lib/psych/scalar_scanner.rb | 2 +- lib/psych/set.rb | 2 +- lib/psych/stream.rb | 2 +- lib/psych/streaming.rb | 2 +- lib/psych/syntax_error.rb | 2 +- lib/psych/tree_builder.rb | 2 +- lib/psych/versions.rb | 2 +- lib/psych/visitors.rb | 2 +- lib/psych/visitors/depth_first.rb | 2 +- lib/psych/visitors/emitter.rb | 2 +- lib/psych/visitors/json_tree.rb | 2 +- lib/psych/visitors/to_ruby.rb | 2 +- lib/psych/visitors/visitor.rb | 2 +- lib/psych/visitors/yaml_tree.rb | 4 ++-- lib/psych/y.rb | 2 +- lib/psych_jars.rb | 2 +- psych.gemspec | 1 + test/psych/handlers/test_recorder.rb | 2 +- test/psych/helper.rb | 2 +- test/psych/json/test_stream.rb | 2 +- test/psych/nodes/test_enumerable.rb | 2 +- test/psych/test_alias_and_anchor.rb | 2 +- test/psych/test_array.rb | 2 +- test/psych/test_boolean.rb | 2 +- test/psych/test_class.rb | 2 +- test/psych/test_coder.rb | 2 +- test/psych/test_date_time.rb | 2 +- test/psych/test_deprecated.rb | 2 +- test/psych/test_document.rb | 2 +- test/psych/test_emitter.rb | 4 ++-- test/psych/test_encoding.rb | 2 +- test/psych/test_exception.rb | 2 +- test/psych/test_hash.rb | 2 +- test/psych/test_json_tree.rb | 2 +- test/psych/test_marshalable.rb | 2 +- test/psych/test_merge_keys.rb | 2 +- test/psych/test_nil.rb | 2 +- test/psych/test_null.rb | 2 +- test/psych/test_numeric.rb | 2 +- test/psych/test_object.rb | 2 +- test/psych/test_object_references.rb | 2 +- test/psych/test_omap.rb | 2 +- test/psych/test_parser.rb | 2 +- test/psych/test_psych.rb | 4 ++-- test/psych/test_safe_load.rb | 2 +- test/psych/test_scalar.rb | 2 +- test/psych/test_scalar_scanner.rb | 2 +- test/psych/test_serialize_subclasses.rb | 2 +- test/psych/test_set.rb | 2 +- test/psych/test_stream.rb | 2 +- test/psych/test_string.rb | 8 ++++---- test/psych/test_struct.rb | 2 +- test/psych/test_symbol.rb | 2 +- test/psych/test_tainted.rb | 4 ++-- test/psych/test_tree_builder.rb | 2 +- test/psych/test_yaml.rb | 2 +- test/psych/test_yamldbm.rb | 2 +- test/psych/test_yamlstore.rb | 2 +- test/psych/visitors/test_depth_first.rb | 2 +- test/psych/visitors/test_emitter.rb | 2 +- test/psych/visitors/test_to_ruby.rb | 2 +- test/psych/visitors/test_yaml_tree.rb | 2 +- 85 files changed, 92 insertions(+), 91 deletions(-) diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index be33d35..6d8390e 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -1,5 +1,5 @@ # -*- coding: us-ascii -*- -# frozen_string_literal: false +# frozen_string_literal: true require 'mkmf' require 'fileutils' diff --git a/lib/psych.rb b/lib/psych.rb index 9959320..2fed434 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/versions' case RUBY_ENGINE when 'jruby' diff --git a/lib/psych/class_loader.rb b/lib/psych/class_loader.rb index ba756f7..cfca868 100644 --- a/lib/psych/class_loader.rb +++ b/lib/psych/class_loader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/omap' require 'psych/set' diff --git a/lib/psych/coder.rb b/lib/psych/coder.rb index 26005f5..96a9c3f 100644 --- a/lib/psych/coder.rb +++ b/lib/psych/coder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych ### # If an object defines +encode_with+, then an instance of Psych::Coder will diff --git a/lib/psych/core_ext.rb b/lib/psych/core_ext.rb index 1232abf..81055cc 100644 --- a/lib/psych/core_ext.rb +++ b/lib/psych/core_ext.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true class Object def self.yaml_tag url Psych.add_tag(url, self) diff --git a/lib/psych/exception.rb b/lib/psych/exception.rb index 83c3d7f..fac0c42 100644 --- a/lib/psych/exception.rb +++ b/lib/psych/exception.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych class Exception < RuntimeError end diff --git a/lib/psych/handler.rb b/lib/psych/handler.rb index 1ab5f73..1074c18 100644 --- a/lib/psych/handler.rb +++ b/lib/psych/handler.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych ### # Psych::Handler is an abstract base class that defines the events used diff --git a/lib/psych/handlers/document_stream.rb b/lib/psych/handlers/document_stream.rb index c43b39e..67da794 100644 --- a/lib/psych/handlers/document_stream.rb +++ b/lib/psych/handlers/document_stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/tree_builder' module Psych diff --git a/lib/psych/handlers/recorder.rb b/lib/psych/handlers/recorder.rb index 341b81d..a8fc7b1 100644 --- a/lib/psych/handlers/recorder.rb +++ b/lib/psych/handlers/recorder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/handler' module Psych diff --git a/lib/psych/json/ruby_events.rb b/lib/psych/json/ruby_events.rb index 478eb66..17b7ddc 100644 --- a/lib/psych/json/ruby_events.rb +++ b/lib/psych/json/ruby_events.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module JSON module RubyEvents # :nodoc: diff --git a/lib/psych/json/stream.rb b/lib/psych/json/stream.rb index 83b7e13..2ebd3d7 100644 --- a/lib/psych/json/stream.rb +++ b/lib/psych/json/stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/json/ruby_events' require 'psych/json/yaml_events' diff --git a/lib/psych/json/tree_builder.rb b/lib/psych/json/tree_builder.rb index 2f94b8c..5c2ee8c 100644 --- a/lib/psych/json/tree_builder.rb +++ b/lib/psych/json/tree_builder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/json/yaml_events' module Psych diff --git a/lib/psych/json/yaml_events.rb b/lib/psych/json/yaml_events.rb index 07f6473..eb973f5 100644 --- a/lib/psych/json/yaml_events.rb +++ b/lib/psych/json/yaml_events.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module JSON module YAMLEvents # :nodoc: diff --git a/lib/psych/nodes.rb b/lib/psych/nodes.rb index 01573b5..5842c2e 100644 --- a/lib/psych/nodes.rb +++ b/lib/psych/nodes.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/nodes/node' require 'psych/nodes/stream' require 'psych/nodes/document' diff --git a/lib/psych/nodes/alias.rb b/lib/psych/nodes/alias.rb index 716a00d..8131a4b 100644 --- a/lib/psych/nodes/alias.rb +++ b/lib/psych/nodes/alias.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/nodes/document.rb b/lib/psych/nodes/document.rb index 7234fef..3cd418e 100644 --- a/lib/psych/nodes/document.rb +++ b/lib/psych/nodes/document.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/nodes/mapping.rb b/lib/psych/nodes/mapping.rb index 4c11df8..b921ddc 100644 --- a/lib/psych/nodes/mapping.rb +++ b/lib/psych/nodes/mapping.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/nodes/node.rb b/lib/psych/nodes/node.rb index e3621dc..1c76721 100644 --- a/lib/psych/nodes/node.rb +++ b/lib/psych/nodes/node.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'stringio' require 'psych/class_loader' require 'psych/scalar_scanner' diff --git a/lib/psych/nodes/scalar.rb b/lib/psych/nodes/scalar.rb index ee55705..b448858 100644 --- a/lib/psych/nodes/scalar.rb +++ b/lib/psych/nodes/scalar.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/nodes/sequence.rb b/lib/psych/nodes/sequence.rb index 1096469..77c2c60 100644 --- a/lib/psych/nodes/sequence.rb +++ b/lib/psych/nodes/sequence.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/nodes/stream.rb b/lib/psych/nodes/stream.rb index 559b084..2474fe6 100644 --- a/lib/psych/nodes/stream.rb +++ b/lib/psych/nodes/stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Nodes ### diff --git a/lib/psych/omap.rb b/lib/psych/omap.rb index 233b945..29cde0b 100644 --- a/lib/psych/omap.rb +++ b/lib/psych/omap.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych class Omap < ::Hash end diff --git a/lib/psych/parser.rb b/lib/psych/parser.rb index 242512f..39bc828 100644 --- a/lib/psych/parser.rb +++ b/lib/psych/parser.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych ### # YAML event parser class. This class parses a YAML document and calls diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index 67c0cc3..29c156c 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'strscan' module Psych diff --git a/lib/psych/set.rb b/lib/psych/set.rb index f35be15..760d217 100644 --- a/lib/psych/set.rb +++ b/lib/psych/set.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych class Set < ::Hash end diff --git a/lib/psych/stream.rb b/lib/psych/stream.rb index 2f63d7d..24e45af 100644 --- a/lib/psych/stream.rb +++ b/lib/psych/stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych ### # Psych::Stream is a streaming YAML emitter. It will not buffer your YAML, diff --git a/lib/psych/streaming.rb b/lib/psych/streaming.rb index 260f8a8..eb19792 100644 --- a/lib/psych/streaming.rb +++ b/lib/psych/streaming.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Streaming module ClassMethods diff --git a/lib/psych/syntax_error.rb b/lib/psych/syntax_error.rb index db293b9..1598e6f 100644 --- a/lib/psych/syntax_error.rb +++ b/lib/psych/syntax_error.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/exception' module Psych diff --git a/lib/psych/tree_builder.rb b/lib/psych/tree_builder.rb index d359c93..b10fd5c 100644 --- a/lib/psych/tree_builder.rb +++ b/lib/psych/tree_builder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/handler' module Psych diff --git a/lib/psych/versions.rb b/lib/psych/versions.rb index 3d61c8b..49f8820 100644 --- a/lib/psych/versions.rb +++ b/lib/psych/versions.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych # The version is Psych you're using VERSION = '3.0.0.beta2' diff --git a/lib/psych/visitors.rb b/lib/psych/visitors.rb index 5dee4eb..e2b084d 100644 --- a/lib/psych/visitors.rb +++ b/lib/psych/visitors.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/visitors/visitor' require 'psych/visitors/to_ruby' require 'psych/visitors/emitter' diff --git a/lib/psych/visitors/depth_first.rb b/lib/psych/visitors/depth_first.rb index 2d74a21..b4ff9e4 100644 --- a/lib/psych/visitors/depth_first.rb +++ b/lib/psych/visitors/depth_first.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Visitors class DepthFirst < Psych::Visitors::Visitor diff --git a/lib/psych/visitors/emitter.rb b/lib/psych/visitors/emitter.rb index f2ff9fd..e3b92b7 100644 --- a/lib/psych/visitors/emitter.rb +++ b/lib/psych/visitors/emitter.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Visitors class Emitter < Psych::Visitors::Visitor diff --git a/lib/psych/visitors/json_tree.rb b/lib/psych/visitors/json_tree.rb index f2f0215..9912cb1 100644 --- a/lib/psych/visitors/json_tree.rb +++ b/lib/psych/visitors/json_tree.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/json/ruby_events' module Psych diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index d1318b3..74a52df 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/scalar_scanner' require 'psych/class_loader' require 'psych/exception' diff --git a/lib/psych/visitors/visitor.rb b/lib/psych/visitors/visitor.rb index d97bf55..3f4ba64 100644 --- a/lib/psych/visitors/visitor.rb +++ b/lib/psych/visitors/visitor.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Psych module Visitors class Visitor diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index e197a30..671bf5d 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/tree_builder' require 'psych/scalar_scanner' require 'psych/class_loader' @@ -321,7 +321,7 @@ module Psych end @emitter.scalar o, nil, tag, plain, quote, style else - maptag = '!ruby/string' + maptag = '!ruby/string'.dup maptag << ":#{o.class}" unless o.class == ::String register o, @emitter.start_mapping(nil, maptag, false, Nodes::Mapping::BLOCK) diff --git a/lib/psych/y.rb b/lib/psych/y.rb index 82e05a7..e857953 100644 --- a/lib/psych/y.rb +++ b/lib/psych/y.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Kernel ### # An alias for Psych.dump_stream meant to be used with IRB. diff --git a/lib/psych_jars.rb b/lib/psych_jars.rb index 2f34e34..e91e346 100644 --- a/lib/psych_jars.rb +++ b/lib/psych_jars.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych.jar' require 'jar-dependencies' diff --git a/psych.gemspec b/psych.gemspec index c0ec5c5..606f518 100644 --- a/psych.gemspec +++ b/psych.gemspec @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- +# frozen_string_literal: true Gem::Specification.new do |s| s.name = "psych" diff --git a/test/psych/handlers/test_recorder.rb b/test/psych/handlers/test_recorder.rb index 17c7c6d..d9d379e 100644 --- a/test/psych/handlers/test_recorder.rb +++ b/test/psych/handlers/test_recorder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' require 'psych/handlers/recorder' diff --git a/test/psych/helper.rb b/test/psych/helper.rb index 7b564bd..9348457 100644 --- a/test/psych/helper.rb +++ b/test/psych/helper.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'minitest/autorun' require 'stringio' require 'tempfile' diff --git a/test/psych/json/test_stream.rb b/test/psych/json/test_stream.rb index 519c114..90a770c 100644 --- a/test/psych/json/test_stream.rb +++ b/test/psych/json/test_stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/nodes/test_enumerable.rb b/test/psych/nodes/test_enumerable.rb index 2f4e1f3..76b3685 100644 --- a/test/psych/nodes/test_enumerable.rb +++ b/test/psych/nodes/test_enumerable.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/test_alias_and_anchor.rb b/test/psych/test_alias_and_anchor.rb index ed00960..91c09df 100644 --- a/test/psych/test_alias_and_anchor.rb +++ b/test/psych/test_alias_and_anchor.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' class ObjectWithInstanceVariables diff --git a/test/psych/test_array.rb b/test/psych/test_array.rb index 6306a04..11f5f23 100644 --- a/test/psych/test_array.rb +++ b/test/psych/test_array.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_boolean.rb b/test/psych/test_boolean.rb index b2803a6..a4b80fc 100644 --- a/test/psych/test_boolean.rb +++ b/test/psych/test_boolean.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_class.rb b/test/psych/test_class.rb index 4e1fd4a..71f7ec3 100644 --- a/test/psych/test_class.rb +++ b/test/psych/test_class.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_coder.rb b/test/psych/test_coder.rb index e578d55..5ea8cab 100644 --- a/test/psych/test_coder.rb +++ b/test/psych/test_coder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb index 3c8b436..f73f346 100644 --- a/test/psych/test_date_time.rb +++ b/test/psych/test_date_time.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'date' diff --git a/test/psych/test_deprecated.rb b/test/psych/test_deprecated.rb index eab2302..624f437 100644 --- a/test/psych/test_deprecated.rb +++ b/test/psych/test_deprecated.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_document.rb b/test/psych/test_document.rb index 97de2e1..a88dd32 100644 --- a/test/psych/test_document.rb +++ b/test/psych/test_document.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_emitter.rb b/test/psych/test_emitter.rb index 23e68b3..52d5e9d 100644 --- a/test/psych/test_emitter.rb +++ b/test/psych/test_emitter.rb @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' @@ -7,7 +7,7 @@ module Psych class TestEmitter < TestCase def setup super - @out = StringIO.new('') + @out = StringIO.new(''.dup) @emitter = Psych::Emitter.new @out end diff --git a/test/psych/test_encoding.rb b/test/psych/test_encoding.rb index 13ca5db..a4f9f03 100644 --- a/test/psych/test_encoding.rb +++ b/test/psych/test_encoding.rb @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index fa80fdb..3040bfb 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_hash.rb b/test/psych/test_hash.rb index b449ce4..e93aa73 100644 --- a/test/psych/test_hash.rb +++ b/test/psych/test_hash.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_json_tree.rb b/test/psych/test_json_tree.rb index 8bb850b..3c59a8d 100644 --- a/test/psych/test_json_tree.rb +++ b/test/psych/test_json_tree.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_marshalable.rb b/test/psych/test_marshalable.rb index 544947a..b1f4a83 100644 --- a/test/psych/test_marshalable.rb +++ b/test/psych/test_marshalable.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'delegate' diff --git a/test/psych/test_merge_keys.rb b/test/psych/test_merge_keys.rb index 76245ca..1bc3dd1 100644 --- a/test/psych/test_merge_keys.rb +++ b/test/psych/test_merge_keys.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_nil.rb b/test/psych/test_nil.rb index 3d4fa88..910a2e6 100644 --- a/test/psych/test_nil.rb +++ b/test/psych/test_nil.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_null.rb b/test/psych/test_null.rb index d8ccb70..9d92d74 100644 --- a/test/psych/test_null.rb +++ b/test/psych/test_null.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb index 9d8b74f..db99a2a 100644 --- a/test/psych/test_numeric.rb +++ b/test/psych/test_numeric.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'bigdecimal' diff --git a/test/psych/test_object.rb b/test/psych/test_object.rb index ed1ccd9..f1c6145 100644 --- a/test/psych/test_object.rb +++ b/test/psych/test_object.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_object_references.rb b/test/psych/test_object_references.rb index 1300bfc..ca69c7d 100644 --- a/test/psych/test_object_references.rb +++ b/test/psych/test_object_references.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_omap.rb b/test/psych/test_omap.rb index 80791aa..98636de 100644 --- a/test/psych/test_omap.rb +++ b/test/psych/test_omap.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index 26aba05..6b554ce 100644 --- a/test/psych/test_parser.rb +++ b/test/psych/test_parser.rb @@ -1,5 +1,5 @@ # coding: utf-8 -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 24030d5..d0de956 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'stringio' @@ -84,7 +84,7 @@ class TestPsych < Psych::TestCase def test_dump_io hash = {'hello' => 'TGIF!'} - stringio = StringIO.new '' + stringio = StringIO.new ''.dup assert_equal stringio, Psych.dump(hash, stringio) assert_equal Psych.dump(hash), stringio.string end diff --git a/test/psych/test_safe_load.rb b/test/psych/test_safe_load.rb index b69c54c..f3fdb9b 100644 --- a/test/psych/test_safe_load.rb +++ b/test/psych/test_safe_load.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/test_scalar.rb b/test/psych/test_scalar.rb index 4353ec3..4e45991 100644 --- a/test/psych/test_scalar.rb +++ b/test/psych/test_scalar.rb @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' diff --git a/test/psych/test_scalar_scanner.rb b/test/psych/test_scalar_scanner.rb index e51fc69..ebe8daf 100644 --- a/test/psych/test_scalar_scanner.rb +++ b/test/psych/test_scalar_scanner.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'date' diff --git a/test/psych/test_serialize_subclasses.rb b/test/psych/test_serialize_subclasses.rb index be209ed..8e1d0d3 100644 --- a/test/psych/test_serialize_subclasses.rb +++ b/test/psych/test_serialize_subclasses.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_set.rb b/test/psych/test_set.rb index 0eb999c..5690957 100644 --- a/test/psych/test_set.rb +++ b/test/psych/test_set.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_stream.rb b/test/psych/test_stream.rb index 1b05428..3bd557c 100644 --- a/test/psych/test_stream.rb +++ b/test/psych/test_stream.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb index 4aa6016..7d14d16 100644 --- a/test/psych/test_string.rb +++ b/test/psych/test_string.rb @@ -1,5 +1,5 @@ # encoding: UTF-8 -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych @@ -166,7 +166,7 @@ string: &70121654388580 !ruby/string end def test_nonascii_string_as_binary - string = "hello \x80 world!" + string = "hello \x80 world!".dup string.force_encoding 'ascii-8bit' yml = Psych.dump string assert_match(/binary/, yml) @@ -202,7 +202,7 @@ string: &70121654388580 !ruby/string end def test_string_with_ivars - food = "is delicious" + food = "is delicious".dup ivar = "on rock and roll" food.instance_variable_set(:@we_built_this_city, ivar) @@ -220,7 +220,7 @@ string: &70121654388580 !ruby/string end def binary_string percentage = 0.31, length = 100 - string = '' + string = ''.dup (percentage * length).to_i.times do |i| string << "\b" end diff --git a/test/psych/test_struct.rb b/test/psych/test_struct.rb index b7968d3..721df44 100644 --- a/test/psych/test_struct.rb +++ b/test/psych/test_struct.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' class PsychStructWithIvar < Struct.new(:foo) diff --git a/test/psych/test_symbol.rb b/test/psych/test_symbol.rb index a98881c..36416ff 100644 --- a/test/psych/test_symbol.rb +++ b/test/psych/test_symbol.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_tainted.rb b/test/psych/test_tainted.rb index 8705833..dcf150b 100644 --- a/test/psych/test_tainted.rb +++ b/test/psych/test_tainted.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych @@ -90,7 +90,7 @@ module Psych end def assert_taintedness string - @parser.parse string.taint + @parser.parse string.dup.taint end end diff --git a/test/psych/test_tree_builder.rb b/test/psych/test_tree_builder.rb index 09f1ee3..3e35788 100644 --- a/test/psych/test_tree_builder.rb +++ b/test/psych/test_tree_builder.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' module Psych diff --git a/test/psych/test_yaml.rb b/test/psych/test_yaml.rb index cfba770..5fa759c 100644 --- a/test/psych/test_yaml.rb +++ b/test/psych/test_yaml.rb @@ -1,5 +1,5 @@ # -*- coding: us-ascii; mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- -# frozen_string_literal: false +# frozen_string_literal: true # vim:sw=4:ts=4 # $Id$ # diff --git a/test/psych/test_yamldbm.rb b/test/psych/test_yamldbm.rb index 71ee04f..1f9ba15 100644 --- a/test/psych/test_yamldbm.rb +++ b/test/psych/test_yamldbm.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'tmpdir' diff --git a/test/psych/test_yamlstore.rb b/test/psych/test_yamlstore.rb index a9ce652..d1e927c 100644 --- a/test/psych/test_yamlstore.rb +++ b/test/psych/test_yamlstore.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require_relative 'helper' require 'yaml/store' require 'tmpdir' diff --git a/test/psych/visitors/test_depth_first.rb b/test/psych/visitors/test_depth_first.rb index 8072c26..f8305e1 100644 --- a/test/psych/visitors/test_depth_first.rb +++ b/test/psych/visitors/test_depth_first.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/visitors/test_emitter.rb b/test/psych/visitors/test_emitter.rb index 9317855..70adbb9 100644 --- a/test/psych/visitors/test_emitter.rb +++ b/test/psych/visitors/test_emitter.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb index 8878ea2..f342bf0 100644 --- a/test/psych/visitors/test_to_ruby.rb +++ b/test/psych/visitors/test_to_ruby.rb @@ -1,5 +1,5 @@ # coding: US-ASCII -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb index 8fc18f2..503a3e4 100644 --- a/test/psych/visitors/test_yaml_tree.rb +++ b/test/psych/visitors/test_yaml_tree.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/helper' module Psych -- cgit v1.2.3