Commit 4235dbe3 authored by Eloy Duran's avatar Eloy Duran

Fix spelling error and that podspecs don't have to be in the current working dir.

parent b20d6402
...@@ -55,13 +55,14 @@ module Pod ...@@ -55,13 +55,14 @@ module Pod
puts "\nThe #{spec.name} specification contains all the required attributes.".green if spec.validate! puts "\nThe #{spec.name} specification contains all the required attributes.".green if spec.validate!
warnings = [] warnings = []
warnings << 'The name of the specificaiton should match the name of the podspec file' if spec.name + '.podspec' != name warnings << 'The name of the specification should match the name of the podspec file' unless path_matches_name?(file, spec)
warnings << 'Missing license[:type]' unless spec.license && spec.license[:type] warnings << 'Missing license[:type]' unless spec.license && spec.license[:type]
warnings << 'Missing license[:file] or [:text]' unless spec.license && (spec.license[:file] || spec.license[:text]) warnings << 'Missing license[:file] or [:text]' unless spec.license && (spec.license[:file] || spec.license[:text])
warnings << "Github repositories should end in `.git'" if spec.source[:git] =~ /github.com/ && spec.source[:git] !~ /.*\.git/ warnings << "Github repositories should end in `.git'" if spec.source[:git] =~ /github.com/ && spec.source[:git] !~ /.*\.git/
warnings << "Github repositories should end in `.git'" if spec.source[:git] =~ /github.com/ && spec.source[:git] !~ /.*\.git/ warnings << "Github repositories should end in `.git'" if spec.source[:git] =~ /github.com/ && spec.source[:git] !~ /.*\.git/
warnings << "The description should end with a dot" if spec.description && spec.description !~ /.*\./ warnings << "The description should end with a dot" if spec.description && spec.description !~ /.*\./
warnings << "The summary should end with a dot" if spec.summary !~ /.*\./ warnings << "The summary should end with a dot" if spec.summary !~ /.*\./
unless warnings.empty? unless warnings.empty?
puts "\n[!] The #{spec.name} specification raised the following warnings".yellow puts "\n[!] The #{spec.name} specification raised the following warnings".yellow
warnings.each { |warn| puts ' - '+ warn } warnings.each { |warn| puts ' - '+ warn }
...@@ -69,6 +70,12 @@ module Pod ...@@ -69,6 +70,12 @@ module Pod
puts puts
end end
private
def path_matches_name?(path, spec)
(path.dirname + "#{spec.name}.podspec").to_s == @name
end
def suggested_ref_and_version(repo) def suggested_ref_and_version(repo)
tags = Octokit.tags(:username => repo['owner']['login'], :repo => repo['name']).map {|tag| tag.name} tags = Octokit.tags(:username => repo['owner']['login'], :repo => repo['name']).map {|tag| tag.name}
versions_tags = {} versions_tags = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment