lib/bundler/cli.rb in bundler-0.9.0.pre3 vs lib/bundler/cli.rb in bundler-0.9.0.pre4
- old
+ new
@@ -30,47 +30,49 @@
Gem::DefaultUserInteraction.ui = UI::RGProxy.new(Bundler.ui)
end
desc "check", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
def check
- with_rescue do
- env = Bundler.load
- # Check top level dependencies
- missing = env.dependencies.select { |d| env.index.search(d).empty? }
- if missing.any?
- puts "The following dependencies are missing"
- missing.each do |d|
- puts " * #{d}"
- end
- else
- env.specs
- puts "The Gemfile's dependencies are satisfied"
+ env = Bundler.load
+ # Check top level dependencies
+ missing = env.dependencies.select { |d| env.index.search(d).empty? }
+ if missing.any?
+ puts "The following dependencies are missing"
+ missing.each do |d|
+ puts " * #{d}"
end
+ else
+ env.specs
+ puts "The Gemfile's dependencies are satisfied"
end
- rescue VersionConflict => e
- puts e.message
end
desc "install", "Install the current environment to the system"
method_option :without, :type => :array, :banner => "Exclude gems thar are part of the specified named group"
def install
opts = options.dup
opts[:without] ||= []
opts[:without].map! { |g| g.to_sym }
Installer.install(Bundler.root, Bundler.definition, opts)
- rescue Bundler::GemNotFound => e
- puts e.message
- exit 1
end
- desc "lock", "Locks a resolve"
+ desc "lock", "Locks the bundle to the current set of dependencies, including all child dependencies."
def lock
environment = Bundler.load
environment.lock
end
+ desc "show", "Shows all gems that are part of the bundle."
+ def show
+ environment = Bundler.load
+ Bundler.ui.info "Gems included by the bundle:"
+ environment.specs.sort_by { |s| s.name }.each do |s|
+ Bundler.ui.info " * #{s.name} (#{s.version})"
+ end
+ end
+
desc "pack", "Packs all the gems to vendor/cache"
def pack
environment = Bundler.load
environment.pack
end
@@ -84,15 +86,7 @@
#{ENV["RUBYOPT"]}
).compact.join(' ')
Kernel.exec *ARGV
end
- private
-
- def with_rescue
- yield
- rescue GemfileNotFound => e
- puts e.message
- exit 1
- end
end
end
\ No newline at end of file