diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-07-29 15:45:42 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-07-29 15:45:42 -0700 |
commit | 4eaf065c6944ba385cbd57a874c3c0767bb269a4 (patch) | |
tree | 8c9a6cf9aa6501032d0474899b42350ee4b6d022 /lib/bundler | |
parent | 81016a8c0bcc747138dc2545ae171b829c4f173f (diff) | |
download | bundler-4eaf065c6944ba385cbd57a874c3c0767bb269a4.tar.gz |
Add an --update flag to the cli tool
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli.rb | 6 | ||||
-rw-r--r-- | lib/bundler/manifest.rb | 8 | ||||
-rw-r--r-- | lib/bundler/manifest_file.rb | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index a591449b10..092a63d80f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -15,7 +15,7 @@ module Bundler manifest_file = Bundler::ManifestFile.load(@manifest) if @args.empty? - manifest_file.install + manifest_file.install(@update) else manifest_file.setup_environment exec(*@args) @@ -42,6 +42,10 @@ module Bundler @manifest = Pathname.new(manifest) end + op.on("-u", "--update", "Force a remote check for newer gems") do + @update = true + end + op.on_tail("-h", "--help", "Show this message") do puts op exit diff --git a/lib/bundler/manifest.rb b/lib/bundler/manifest.rb index c9ec1622f6..690e419155 100644 --- a/lib/bundler/manifest.rb +++ b/lib/bundler/manifest.rb @@ -16,8 +16,8 @@ module Bundler @system_gems = system_gems end - def install - fetch + def install(update) + fetch(update) @repository.install_cached_gems(:bin_dir => @bindir || @repository.path.join("bin")) cleanup_removed_gems create_environment_files(@repository.path.join("environments")) @@ -49,8 +49,8 @@ module Bundler private - def fetch - return if all_gems_installed? + def fetch(update) + return unless update || !all_gems_installed? finder = Finder.new(*sources) unless bundle = finder.resolve(*gem_dependencies) diff --git a/lib/bundler/manifest_file.rb b/lib/bundler/manifest_file.rb index a24bbbaa33..0af486ecf5 100644 --- a/lib/bundler/manifest_file.rb +++ b/lib/bundler/manifest_file.rb @@ -26,8 +26,8 @@ module Bundler @manifest ||= load_manifest end - def install - manifest.install + def install(update = false) + manifest.install(update) end def setup_environment |