Permalink
Browse files

Github https:// URLs can be private. Revert "Recognise https:// sourc…

…e URLs as public, like git:// and http://."

Since there's no way to distinguish between public and private URLs, they shouldn't be recorded by the babushka webservice.

This reverts commit 09f0419.

Conflicts:
	lib/babushka/source.rb
  • Loading branch information...
benhoskings committed Aug 19, 2012
1 parent b8a10b4 commit 9463f42439163f78ce8dc90f91bdef495ee5d322
Showing with 9 additions and 3 deletions.
  1. +2 −2 lib/babushka/source.rb
  2. +7 −1 spec/babushka/source_spec.rb
View
@@ -45,9 +45,9 @@ def self.default_remote_for name
def self.discover_uri_and_type path
if path.nil?
[nil, :implicit]
- elsif path.to_s.sub(/^\w+:\/\//, '')[/^[^\/]+[@:]/]
+ elsif path.to_s.sub(/^\w+:\/\//, '')[/^[^\/]+[@:]/] || path.to_s[/^https:\/\//]
[path.to_s, :private]
- elsif path.to_s[/^(git|https?|file):\/\//]
+ elsif path.to_s[/^(git|http|file):\/\//]
[path.to_s, :public]
else
[path.p, :local]
@@ -31,12 +31,18 @@
[
'git://github.com/benhoskings/babushka-deps.git',
'http://github.com/benhoskings/babushka-deps.git',
- 'https://github.com/benhoskings/babushka-deps.git',
'file:///Users/ben/babushka/deps'
].each {|uri|
Source.discover_uri_and_type(uri).should == [uri, :public]
}
end
+ it "should treat https:// as private" do
+ [
+ 'https://github.com/benhoskings/babushka-deps.git'
+ ].each {|uri|
+ Source.discover_uri_and_type(uri).should == [uri, :private]
+ }
+ end
it "should treat ssh-style URLs as private" do
[
'git@github.com:benhoskings/babushka-deps.git',

0 comments on commit 9463f42

Please sign in to comment.