-
-
Save pcg79/5718088 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'bundler' | |
gems = ARGV | |
if gems.empty? | |
puts "Updating all gems" | |
Bundler.definition(true) | |
else | |
puts "Updating gems: #{gems.join(', ')}" | |
lock = Bundler.read_file(Bundler.default_lockfile) | |
names = Bundler::LockfileParser.new(lock).specs.map{ |s| s.name } | |
gems.each do |g| | |
next if names.include?(g) | |
puts "Unable to find '#{g}'" | |
end | |
Bundler.definition(:gems => gems, :sources => []) | |
end | |
d = Bundler.definition | |
puts "Resolving remotely..." | |
d.resolve_remotely! | |
d.lock(Bundler.default_lockfile) | |
puts "Updated lockfile! Enjoy!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment