summaryrefslogtreecommitdiff
path: root/psych.gemspec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-14 00:26:37 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-03-17 21:27:30 +0100
commita3fc8191a7efc1540eec2649654a43f7e775f332 (patch)
treee83f14ef32c0cce4b664755427a15e0d2c537f1c /psych.gemspec
parent08c7decd5690e87b1a1b37bbd41d391b574b62ef (diff)
downloadpsych-a3fc8191a7efc1540eec2649654a43f7e775f332.tar.gz
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.
Diffstat (limited to 'psych.gemspec')
-rw-r--r--psych.gemspec10
1 files changed, 4 insertions, 6 deletions
diff --git a/psych.gemspec b/psych.gemspec
index 0990098..f55cd2a 100644
--- a/psych.gemspec
+++ b/psych.gemspec
@@ -1,12 +1,10 @@
# -*- encoding: utf-8 -*-
# frozen_string_literal: true
-begin
- require_relative 'lib/psych/versions'
-rescue LoadError
- # for Ruby core repository
- require_relative 'versions'
-end
+lib_path = File.expand_path('lib', __dir__)
+$LOAD_PATH.unshift lib_path if File.exist?(lib_path)
+
+require 'psych/versions'
Gem::Specification.new do |s|
s.name = "psych"