Skip to content

Commit

Permalink
Resolves Issue rubygems#50: relative paths don't work for --manifest …
Browse files Browse the repository at this point in the history
…option

Thanks bahuvrihi.
  • Loading branch information
Carl Lerche committed Sep 22, 2009
1 parent 80ef4f1 commit 4268288
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/environment.rb
Expand Up @@ -11,7 +11,7 @@ class Environment
attr_writer :gem_path, :bindir

def self.load(gemfile = nil)
gemfile = gemfile ? Pathname.new(gemfile) : default_manifest_file
gemfile = gemfile ? Pathname.new(gemfile).expand_path : default_manifest_file

unless gemfile.file?
raise ManifestFileNotFound, "#{filename.inspect} does not exist"
Expand Down
27 changes: 23 additions & 4 deletions spec/bundler/cli_spec.rb
Expand Up @@ -134,9 +134,12 @@
gem "rake"
Gemfile

Dir.chdir(bundled_app)
gem_command :bundle, "-m #{bundled_app('manifest.rb')}"
bundled_app("gems").should have_cached_gems("rake-0.8.7")
Dir.chdir(bundled_app) do
out = gem_command :bundle, "-m #{bundled_app('manifest.rb')}"
out.should include('Done.')
bundled_app("gems").should have_cached_gems("rake-0.8.7")
tmp_bindir('rake').should exist
end
end

it "works when the manifest is in a different directory" do
Expand All @@ -148,9 +151,25 @@
Gemfile

Dir.chdir(bundled_app)
gem_command :bundle, "-m #{bundled_app('config', 'manifest.rb')}"
out = gem_command :bundle, "-m #{bundled_app('config', 'manifest.rb')}"
out.should include('Done.')
bundled_app("gems").should have_cached_gems("rake-0.8.7")
end

it "works when using a relative path to the manifest file" do
build_manifest_file bundled_app('manifest_file'), <<-Gemfile
clear_sources
source "file://#{gem_repo1}"
gem "rake"
Gemfile

Dir.chdir(bundled_app) do
out = gem_command :bundle, "-m manifest_file"
out.should include('Done.')
tmp_gem_path.should have_cached_gems("rake-0.8.7")
tmp_bindir('rake').should exist
end
end
end

describe "it working without rubygems" do
Expand Down

0 comments on commit 4268288

Please sign in to comment.