mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/psych] Remove unnecessary version guard from versions.rb
Removing it triggers the following warnings when running `bundle` under
jruby from the root of the `psych` repo prints the following warnings:
```
/path/to/jruby-9.2.9.0/lib/ruby/gems/shared/gems/psych-3.1.0-java/lib/psych/versions.rb:7: warning: already initialized constant VERSION
/path/to//jruby-9.2.9.0/lib/ruby/gems/shared/gems/psych-3.1.0-java/lib/psych/versions.rb:10: warning: already initialized constant DEFAULT_SNAKEYAML_VERSION
```
This is because bundler loads the versions file relatively from the
local gemspec, and then internally loads the psych gem, causing the
redefinition warnings.
Instead, we modify the $LOAD_PATH so that when working locally on the
`psych` repo, the local version of `psych` gets used.
a3fc8191a7
This commit is contained in:
parent
f245976386
commit
cd3d035e8a
Notes:
git
2020-06-05 11:50:25 +09:00
2 changed files with 5 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
module Psych
|
module Psych
|
||||||
# The version of Psych you are using
|
# The version of Psych you are using
|
||||||
VERSION = '3.1.0' unless defined?(::Psych::VERSION)
|
VERSION = '3.1.0'
|
||||||
|
|
||||||
if RUBY_ENGINE == 'jruby'
|
if RUBY_ENGINE == 'jruby'
|
||||||
DEFAULT_SNAKEYAML_VERSION = '1.23'.freeze
|
DEFAULT_SNAKEYAML_VERSION = '1.23'.freeze
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
begin
|
lib_path = File.expand_path('lib', __dir__)
|
||||||
require_relative 'lib/psych/versions'
|
$LOAD_PATH.unshift lib_path if File.exist?(lib_path)
|
||||||
rescue LoadError
|
|
||||||
# for Ruby core repository
|
require 'psych/versions'
|
||||||
require_relative 'versions'
|
|
||||||
end
|
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "psych"
|
s.name = "psych"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue