Last active
January 3, 2016 07:49
-
-
Save theotherzach/8432230 to your computer and use it in GitHub Desktop.
This file contains 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
input = ARGF.read | |
lines = input.split("\n").select { |line| | |
!line.empty? && !line.include?("***") | |
}.map { |line| | |
{ | |
gemname: line.split(" ").first, | |
version: line.split(" ").last.gsub(/[(|)]/, ""), | |
} | |
} | |
puts %{ source "https://rubygems.org" \n\n} | |
lines.each do |line| | |
begin | |
puts %{gem "#{line[:gemname]}" } | |
rescue Errno::EPIPE | |
exit(74) | |
end | |
end |
I'm happily surprised to be told that rvm has this feature.
https://twitter.com/rvm_io/status/423344618508673024
https://twitter.com/rvm_io/status/423349650847170560
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gem list --no-details -l | ruby gemlist_parser.rb > Gemfile