From 7c8c58e0a59123177a086d66d65d9e9f2bf50105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=88king?= Date: Thu, 27 Sep 2012 00:33:27 -0500 Subject: [PATCH] Better meaning for slashless :github arg. --- lib/bundler/dsl.rb | 2 +- spec/bundler/dsl_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 6924b7a8496..0ac70363407 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -231,7 +231,7 @@ def _normalize_options(name, version, opts) end if github = opts.delete("github") - github = "#{github}/#{github}" unless github.include?("/") + github = "#{github}/#{name}" unless github.include?("/") opts["git"] = "git://github.com/#{github}.git" end diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 2bc0e406966..f112243f4a6 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -18,6 +18,13 @@ github_uri = "git://github.com/rails/rails.git" subject.dependencies.first.source.uri.should == github_uri end + + it "should interpret slashless 'github:' value as account name" do + subject.gem("bundler", :github => "carlhuda") + github_uri = "git://github.com/carlhuda/bundler.git" + subject.dependencies.first.source.uri.should == github_uri + end + end describe '#method_missing' do