Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Commit

Permalink
Github https:// URLs can be private. Revert "Recognise https:// sourc…
Browse files Browse the repository at this point in the history
…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 9463f42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/babushka/source.rb
Expand Up @@ -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]
Expand Down
8 changes: 7 additions & 1 deletion spec/babushka/source_spec.rb
Expand Up @@ -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',
Expand Down

0 comments on commit 9463f42

Please sign in to comment.