Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

kylef opened this issue Apr 1, 2014 · 7 comments

Comments

@kylef
Copy link
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
Copy link
Contributor Author

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')

@neonichu
Copy link
Member

neonichu commented Apr 1, 2014

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

@neonichu
Copy link
Member

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.

@fabiopelosin
Copy link
Member

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
Copy link

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 :(

@fabiopelosin
Copy link
Member

Closed by #84

@fabiopelosin
Copy link
Member

... and released as CocoaPods 0.31.1

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

No branches or pull requests

4 participants