Skip to content

Commit

Permalink
Merge pull request #72 from joelparsons/fix_cocoapods_1721
Browse files Browse the repository at this point in the history
Fixes exception when git tag is a Version
  • Loading branch information
kapin committed Mar 29, 2014
2 parents 76c726c + 6983c88 commit 6af9a00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,9 @@ def _validate_source(s)
if commit && commit.downcase =~ /head/
error 'The commit of a Git source cannot be `HEAD`.'
end
if tag && !tag.include?(version)
if tag && !tag.to_s.include?(version)
warning 'The version should be included in the Git tag.'
end

if version == '0.0.1'
if commit.nil? && tag.nil?
error 'Git sources should specify either a commit or a tag.'
Expand Down
8 changes: 7 additions & 1 deletion spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,17 @@ def message_should_include(*values)
message_should_include('source', 'HEAD')
end

it "checks that the version is included in the git tag" do
it "checks that the version is included in the git tag when the version is a string" do
@spec.stubs(:version).returns(Version.new '1.0.1')
@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') })
message_should_include('git', 'version', 'tag')
end

it "checks that Github repositories use the `https` form (for compatibility)" do
@spec.stubs(:source).returns({ :git => 'http://github.com/repo.git', :tag => '1.0' })
Expand Down

0 comments on commit 6af9a00

Please sign in to comment.