summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2016-11-18 17:33:29 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2016-11-18 17:33:29 +0900
commitd65f69baf448c3639ad6aab88872da0882066535 (patch)
treec2cabd9b8a06bc5722aedc94228df37f7d11683f
parentbb1ee3edb7b28a31c60c2670c2fd41b3c74273b0 (diff)
downloadpsych-d65f69baf448c3639ad6aab88872da0882066535.zip
Unify Psych version constants to psych/versions.rb.
-rw-r--r--lib/psych.rb4
-rw-r--r--lib/psych/versions.rb7
-rw-r--r--lib/psych_jars.rb1
-rw-r--r--psych.gemspec6
4 files changed, 10 insertions, 8 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index 7e5b0ed..b117b25 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: false
+require 'psych/versions'
case RUBY_ENGINE
when 'jruby'
require 'psych_jars'
@@ -223,9 +224,6 @@ require 'psych/class_loader'
# # => "a"
module Psych
- # The version is Psych you're using
- VERSION = '2.2.1'
-
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
diff --git a/lib/psych/versions.rb b/lib/psych/versions.rb
index 62fca91..b01fa7d 100644
--- a/lib/psych/versions.rb
+++ b/lib/psych/versions.rb
@@ -1,4 +1,9 @@
# frozen_string_literal: false
module Psych
- DEFAULT_SNAKEYAML_VERSION = '1.17'.freeze
+ # The version is Psych you're using
+ VERSION = '2.2.1'
+
+ if RUBY_ENGINE == 'jruby'
+ DEFAULT_SNAKEYAML_VERSION = '1.17'.freeze
+ end
end
diff --git a/lib/psych_jars.rb b/lib/psych_jars.rb
index bd7ea04..2f34e34 100644
--- a/lib/psych_jars.rb
+++ b/lib/psych_jars.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: false
-require 'psych/versions'
require 'psych.jar'
require 'jar-dependencies'
diff --git a/psych.gemspec b/psych.gemspec
index db416fa..72d7065 100644
--- a/psych.gemspec
+++ b/psych.gemspec
@@ -1,8 +1,9 @@
# -*- encoding: utf-8 -*-
+require 'psych/versions'
Gem::Specification.new do |s|
s.name = "psych"
- s.version = "2.2.1"
+ s.version = Psych::VERSION
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
s.date = "2016-11-14"
@@ -30,9 +31,8 @@ DESCRIPTION
s.add_development_dependency 'minitest', "~> 5.0"
if RUBY_PLATFORM =~ /java/
- require 'psych/versions'
s.platform = 'java'
- s.requirements = "jar org.yaml:snakeyaml, 1.17"
+ s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}"
s.add_dependency 'jar-dependencies', '>= 0.1.7'
s.add_development_dependency 'ruby-maven'
else