Closed mtasaka closed 1 year ago
With ruby 3.2.0 preview3 and onwards, rspec for ruby-hocon git head fails like:
$ rspec spec /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_document_spec.rb:11: warning: already initialized constant ConfigParseOptions /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_document_parser_spec.rb:10: warning: previous definition of ConfigParseOptions was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_document_spec.rb:12: warning: already initialized constant ConfigSyntax /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_document_parser_spec.rb:11: warning: previous definition of ConfigSyntax was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_value_spec.rb:26: warning: already initialized constant ConfigValueFactory /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_document_spec.rb:14: warning: previous definition of ConfigValueFactory was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/public_api_spec.rb:16: warning: already initialized constant ConfigFactory /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_value_spec.rb:27: warning: previous definition of ConfigFactory was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/public_api_spec.rb:17: warning: already initialized constant ConfigValueFactory /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_value_spec.rb:26: warning: previous definition of ConfigValueFactory was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/public_api_spec.rb:18: warning: already initialized constant SimpleConfigObject /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_value_spec.rb:15: warning: previous definition of SimpleConfigObject was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/public_api_spec.rb:19: warning: already initialized constant SimpleConfigList /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_value_spec.rb:16: warning: previous definition of SimpleConfigList was here An error occurred while loading ./spec/unit/typesafe/config/public_api_spec.rb. Failure/Error: elsif File.exists?(sibling) NoMethodError: undefined method `exists?' for File:Class # ./lib/hocon/impl/parseable.rb:445:in `relative_to' # ./lib/hocon/impl/simple_include_context.rb:28:in `relative_to' # ./lib/hocon/impl/simple_includer.rb:115:in `name_to_parseable' # ./lib/hocon/impl/simple_includer.rb:136:in `from_basename' # ./lib/hocon/impl/simple_includer.rb:63:in `include_without_fallback' # ./lib/hocon/impl/simple_includer.rb:37:in `include' # ./lib/hocon/impl/config_parser.rb:173:in `parse_include' # ./lib/hocon/impl/config_parser.rb:224:in `parse_object' # ./lib/hocon/impl/config_parser.rb:102:in `parse_value' # ./lib/hocon/impl/config_parser.rb:254:in `parse_object' # ./lib/hocon/impl/config_parser.rb:102:in `parse_value' # ./lib/hocon/impl/config_parser.rb:396:in `block in parse' # ./lib/hocon/impl/config_parser.rb:378:in `each' # ./lib/hocon/impl/config_parser.rb:378:in `parse' # ./lib/hocon/impl/config_parser.rb:43:in `parse' # ./lib/hocon/impl/parseable.rb:251:in `raw_parse_value_from_io' # ./lib/hocon/impl/parseable.rb:244:in `block in raw_parse_value' # ./lib/hocon/impl/parseable.rb:417:in `block in open' # ./lib/hocon/impl/parseable.rb:416:in `open' # ./lib/hocon/impl/parseable.rb:416:in `open' # ./lib/hocon/impl/parseable.rb:243:in `raw_parse_value' # ./lib/hocon/impl/parseable.rb:179:in `parse_value_from_origin' # ./lib/hocon/impl/parseable.rb:174:in `parse_value' # ./lib/hocon/impl/parseable.rb:149:in `parse' # ./lib/hocon/config_factory.rb:15:in `parse_file' # ./spec/unit/typesafe/config/public_api_spec.rb:335:in `block (2 levels) in <top (required)>' # ./spec/unit/typesafe/config/public_api_spec.rb:325:in `block in <top (required)>' # ./spec/unit/typesafe/config/public_api_spec.rb:261:in `<top (required)>' /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/token_spec.rb:10: warning: already initialized constant Tokens /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/config_node_spec.rb:8: warning: previous definition of Tokens was here /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/tokenizer_spec.rb:10: warning: already initialized constant Tokens /builddir/build/GIT/ruby-hocon/spec/unit/typesafe/config/token_spec.rb:10: warning: previous definition of Tokens was here Finished in 0.00018 seconds (files took 0.57425 seconds to load) 0 examples, 0 failures, 1 error occurred outside of examples
File.exists? is already deprecated since ruby2.1 and will be removed with ruby3.2. https://github.com/ruby/ruby/blob/062c5a9e6b9337078bea65f5d2f136dc3e47509c/NEWS.md?plain=1#L390 https://bugs.ruby-lang.org/issues/17391
File.exists?
People are expected to simply replace this with File.exist?
File.exist?
With ruby 3.2.0 preview3 and onwards, rspec for ruby-hocon git head fails like:
File.exists?
is already deprecated since ruby2.1 and will be removed with ruby3.2. https://github.com/ruby/ruby/blob/062c5a9e6b9337078bea65f5d2f136dc3e47509c/NEWS.md?plain=1#L390 https://bugs.ruby-lang.org/issues/17391People are expected to simply replace this with
File.exist?