Skip to content

Instantly share code, notes, and snippets.

@theotherzach
Last active January 3, 2016 07:49
Show Gist options
  • Select an option

  • Save theotherzach/8432230 to your computer and use it in GitHub Desktop.

Select an option

Save theotherzach/8432230 to your computer and use it in GitHub Desktop.
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
@cczona

cczona commented Jan 15, 2014

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment