Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
add Ruby version to Gemfile.lock
Browse files Browse the repository at this point in the history
Signed-off-by: David Morhovich <dmorhovich@pivotal.io>
  • Loading branch information
jtarchie committed Oct 20, 2015
1 parent f58e1df commit ba47bea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bundler/definition.rb
Expand Up @@ -307,6 +307,11 @@ def to_lock
out << " #{p}\n"
end

if ruby_version
out << "\nRUBY VERSION\n"
out << " #{Bundler.ruby_version}\n"
end

out << "\n"
out << "DEPENDENCIES\n"

Expand Down
27 changes: 27 additions & 0 deletions spec/lock/lockfile_spec.rb
Expand Up @@ -1124,6 +1124,33 @@
G
end

it "captues the Ruby version in the lockfile", :focus do
install_gemfile <<-G
source "file://#{gem_repo1}"
ruby '#{RUBY_VERSION}'
gem "rack", "> 0.9", "< 1.0"
G

lockfile_should_be <<-G
GEM
remote: file:#{gem_repo1}/
specs:
rack (0.9.1)
PLATFORMS
ruby
RUBY VERSION
ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
DEPENDENCIES
rack (> 0.9, < 1.0)
BUNDLED WITH
#{Bundler::VERSION}
G
end

# Some versions of the Bundler 1.1 RC series introduced corrupted
# lockfiles. There were two major problems:
#
Expand Down

0 comments on commit ba47bea

Please sign in to comment.