Skip to content

Commit

Permalink
Merge pull request #84 from neonichu/master
Browse files Browse the repository at this point in the history
Fix linting source of a spec for certain URLs
  • Loading branch information
fabiopelosin committed Apr 1, 2014
2 parents ff63023 + 0c4e722 commit b02a101
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
[Fabio Pelosin][irrationalfab]
[#51](https://github.com/CocoaPods/Core/issues/51)

##### Bug Fixes

* Fix linting source of a spec for certain URLs.
[Boris Bügling](https://github.com/neonichu)
[#82](https://github.com/CocoaPods/Core/issues/82)

## 0.31.0

##### Enhancements
Expand Down
1 change: 1 addition & 0 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def perform_github_source_checks(s)
require 'uri'

if git = s[:git]
return unless git =~ /^#{URI.regexp}$/
git_uri = URI.parse(git)
if git_uri.host == 'github.com' || git_uri.host == 'gist.github.com'
unless git.end_with?('.git')
Expand Down
18 changes: 18 additions & 0 deletions spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,24 @@ def message_should_include(*values)
@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" do
@spec.stubs(:source).returns({ :git => '[email protected]:kylef/test.git', :tag => '1.0' })
@linter.lint
@linter.results.should.be.empty
end

it "does not warn for SSH repositories on Github" do
@spec.stubs(:source).returns({ :git => '[email protected]: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')
Expand Down

0 comments on commit b02a101

Please sign in to comment.