Created
November 28, 2017 14:16
-
-
Save bestie/4bd56205f4866719f1bfaaaaf5befd82 to your computer and use it in GitHub Desktop.
Parse the Gemfile.lock file and print the list of Gems that Bundler would install
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 "bundler" | |
bundle = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile)) | |
gem_name_version_map = bundle.specs.map { |spec| | |
[ | |
spec.name, | |
spec.version.to_s, | |
] | |
} | |
STDOUT.puts gem_name_version_map.map { |pair| pair.join(" ") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment