Created
December 12, 2024 00:31
-
-
Save bradgessler/50246aa02fd0e2135f4e79135f08fb81 to your computer and use it in GitHub Desktop.
List locked gem specs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pathname" | |
require "bundler" | |
path = Pathname.new("/Users/bradgessler/Projects/terminalwire/traveling-ruby/shared/gemfiles/20241122") | |
definition = Bundler::Definition.build(path.join("Gemfile"), path.join("Gemfile.lock"), nil) | |
definition.locked_gems.specs.each do |spec| | |
p spec.name, spec.version | |
puts "gem install --platform=ruby #{spec.name} -v '#{spec.version}'" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment