Browse files

Add --gemfile as a flag for bundle check.

  • Loading branch information...
1 parent c1f4c1e commit c18bfd3298306449e0d090ecbfdffe401c0f9ff3 Carl Lerche committed Aug 3, 2010
Showing with 14 additions and 0 deletions.
  1. +3 −0 lib/bundler/cli.rb
  2. +11 −0 spec/other/check_spec.rb
View
3 lib/bundler/cli.rb
@@ -58,7 +58,10 @@ def init
all gems are found, Bundler prints a success message and exits with a status of 0.
If not, the first missing gem is listed and Bundler exits status 1.
D
+ method_option "gemfile", :type => :string, :banner =>
+ "Use the specified gemfile instead of Gemfile"
def check
+ ENV['BUNDLE_GEMFILE'] = File.expand_path(options[:gemfile]) if options[:gemfile]
begin
not_installed = Bundler.definition.missing_specs
rescue GemNotFound, VersionConflict
View
11 spec/other/check_spec.rb
@@ -12,6 +12,17 @@
out.should == "The Gemfile's dependencies are satisfied"
end
+ it "works with the --gemfile flag when not in the directory" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rails"
+ G
+
+ Dir.chdir tmp
+ bundle "check --gemfile bundled_app/Gemfile"
+ out.should == "The Gemfile's dependencies are satisfied"
+ end
+
it "creates a Gemfile.lock if one did not exist" do
install_gemfile <<-G
source "file://#{gem_repo1}"

0 comments on commit c18bfd3

Please sign in to comment.