Linting source of a spec is broken for certain URLs #82

Closed
kylef opened this Issue Apr 1, 2014 · 7 comments

Projects

None yet

4 participants

@kylef
Contributor
kylef commented Apr 1, 2014

Looks like #77 was a bad idea.

[10] pry(main)> URI.parse('git@bitbucket.org:foo/dfs.git')
URI::InvalidURIError: bad URI(is not URI?): git@bitbucket.org:foo/dfs.git
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:176:in `split'
[11] pry(main)> URI.parse('/Volumes/myrepo/source code')
URI::InvalidURIError: bad URI(is not URI?): /Volumes/myrepo/source code
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:176:in `split'
@kylef kylef added the bug label Apr 1, 2014
Contributor
kylef commented Apr 1, 2014

Failing tests:

diff --git a/spec/specification/linter_spec.rb b/spec/specification/linter_spec.rb
index b1b2ad6..68cee27 100644
--- a/spec/specification/linter_spec.rb
+++ b/spec/specification/linter_spec.rb
@@ -263,7 +263,7 @@ module Pod
         @spec.stubs(:source).returns({ :git => 'http://repo.git', :tag => '1.0' })
         message_should_include('git', 'version', 'tag')
       end
-
+
       it "checks that the version is included in the git tag  when the version is a Version" do
         @spec.stubs(:version).returns(Version.new '1.0.1')
         @spec.stubs(:source).returns({ :git => 'http://repo.git', :tag => (Version.new '1.0') })
@@ -286,6 +286,18 @@ module Pod
         @linter.results.should.be.empty
       end

+      it "does not warn for local repositories with spaces" do
+        @spec.stubs(:source).returns({ :git => '/Users/kylef/Projects X', :tag => '1.0' })
+        @linter.lint
+        @linter.results.should.be.empty
+      end
+
+      it "does not warn for SSH repositories with" do
+        @spec.stubs(:source).returns({ :git => 'git@bitbucket.org:kylef/test.git', :tag => '1.0' })
+        @linter.lint
+        @linter.results.should.be.empty
+      end
+
       it "performs checks for Gist Github repositories" do
         @spec.stubs(:source).returns({ :git => "git://gist.github.com/2823399.git", :tag => "1.0" })
         message_should_include('Github', 'https')
Owner
neonichu commented Apr 1, 2014

I can fix those, but wondering what e.g. git@github.com:neonichu/docstat.git should result in?

Owner
neonichu commented Apr 1, 2014

Started a PR for this. Like I said, I am not sure what the behavior for SSH URLs on GitHub should be, but they should probably be valid as well.

Owner

For context the reason why https is requires is because some users reported issues with fire walled networks. However when SSH is used I think that the user should be free to whatever they want as we are talking about private Pods.

x2on commented Apr 1, 2014

👍 For private pods we use SSH links not https.
At the moment during this issue all our automatic pod lint and spec push tasks are failing :(

Owner

Closed by #84

Owner

... and released as CocoaPods 0.31.1

@xavierjurado xavierjurado referenced this issue in CocoaPods/CocoaPods Sep 28, 2014
Closed

Cocoapods 0.34.1 Podspec ssh source #2534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment