diff options
author | Andre Arko <andre@arko.net> | 2013-01-12 00:30:38 -0800 |
---|---|---|
committer | Jessica Lynn Suttles <jlsuttles@gmail.com> | 2013-09-26 15:35:07 -0700 |
commit | 789deab84d685d7dd53a2dc71ec3447ed999764b (patch) | |
tree | aa45c4bfcd1209c644ec6a8f08b2e0f435722d74 | |
parent | f4e0464282426a2ec65ac4d6e3675b0a3498be61 (diff) | |
download | bundler-789deab84d685d7dd53a2dc71ec3447ed999764b.tar.gz |
extract into Bundler.ruby_version
-rw-r--r-- | lib/bundler.rb | 4 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 5 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index f6e75dd7c0..94afd223d0 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -356,6 +356,10 @@ module Bundler @git_present ||= Bundler.which("git") end + def ruby_version + @ruby_version ||= SystemRubyVersion.new + end + private def eval_yaml_gemspec(path, contents) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 4e538e6199..6c6a60b1bc 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -369,8 +369,7 @@ module Bundler def validate_ruby! return unless ruby_version - system_ruby_version = Bundler::SystemRubyVersion.new - if diff = ruby_version.diff(system_ruby_version) + if diff = ruby_version.diff(Bundler.ruby_version) problem, expected, actual = diff msg = case problem @@ -379,7 +378,7 @@ module Bundler when :version "Your Ruby version is #{actual}, but your Gemfile specified #{expected}" when :engine_version - "Your #{system_ruby_version.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}" + "Your #{Bundler.ruby_version.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}" when :patchlevel "Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}" end diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 80427ff937..91cc7f5c2b 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -244,7 +244,7 @@ module Bundler spec.require_paths.each do |path| full_path = File.join(spec.full_gem_path, path) gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)) - paths << gem_path.to_s.sub("#{SystemRubyVersion.new.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}') + paths << gem_path.to_s.sub("#{Bundler.ruby_version.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}') end end |