Commit 1f1cc97a authored by Fabio Pelosin's avatar Fabio Pelosin

[Spec] Fine-tuning template.

parent 81ab80a7
...@@ -330,6 +330,7 @@ module Pod ...@@ -330,6 +330,7 @@ module Pod
text = @file.read text = @file.read
messages = [] messages = []
messages << "Missing license type" unless license[:type] messages << "Missing license type" unless license[:type]
messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
messages << "The summary is not meaningful" if spec.summary =~ /A short description of/ messages << "The summary is not meaningful" if spec.summary =~ /A short description of/
messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/ messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
messages << "The summary should end with a dot" if @spec.summary !~ /.*\./ messages << "The summary should end with a dot" if @spec.summary !~ /.*\./
...@@ -440,7 +441,7 @@ module Pod ...@@ -440,7 +441,7 @@ module Pod
data[:name] = repo['name'] data[:name] = repo['name']
data[:summary] = repo['description'].gsub(/["]/, '\"') data[:summary] = repo['description'].gsub(/["]/, '\"')
data[:homepage] = repo['homepage'] || repo['html_url'] data[:homepage] = (repo['homepage'] && !repo['homepage'].empty? ) ? repo['homepage'] : repo['html_url']
data[:author_name] = user['name'] || user['login'] data[:author_name] = user['name'] || user['login']
data[:author_email] = user['email'] || 'email@address.com' data[:author_email] = user['email'] || 'email@address.com'
data[:source_url] = repo['clone_url'] data[:source_url] = repo['clone_url']
...@@ -506,7 +507,7 @@ Pod::Spec.new do |s| ...@@ -506,7 +507,7 @@ Pod::Spec.new do |s|
# Specify the location from where the source should be retreived. # Specify the location from where the source should be retreived.
# #
s.source = { :git => "#{data[:source_url]}", "#{data[:ref_type]}" => "#{data[:ref]}" } s.source = { :git => "#{data[:source_url]}", #{data[:ref_type]} => "#{data[:ref]}" }
# s.source = { :svn => 'http://EXAMPLE/#{data[:name]}/tags/1.0.0' } # s.source = { :svn => 'http://EXAMPLE/#{data[:name]}/tags/1.0.0' }
# s.source = { :hg => 'http://EXAMPLE/#{data[:name]}', :revision => '1.0.0' } # s.source = { :hg => 'http://EXAMPLE/#{data[:name]}', :revision => '1.0.0' }
......
...@@ -26,13 +26,13 @@ describe "Pod::Command::Spec#create" do ...@@ -26,13 +26,13 @@ describe "Pod::Command::Spec#create" do
spec = Pod::Specification.from_file(path).activate_platform(:ios) spec = Pod::Specification.from_file(path).activate_platform(:ios)
spec.name.should == 'Bananas' spec.name.should == 'Bananas'
spec.license.should == { :type => "MIT", :file => "LICENSE" } spec.license.should == { :type => "MIT (example)" }
spec.version.should == Pod::Version.new('0.0.1') spec.version.should == Pod::Version.new('0.0.1')
spec.summary.should == 'A short description of Bananas.' spec.summary.should == 'A short description of Bananas.'
spec.homepage.should == 'http://EXAMPLE/Bananas' spec.homepage.should == 'http://EXAMPLE/Bananas'
spec.authors.should == { `git config --get user.name`.strip => `git config --get user.email`.strip} spec.authors.should == { `git config --get user.name`.strip => `git config --get user.email`.strip}
spec.source.should == { :git => 'http://EXAMPLE/Bananas.git', :tag => '0.0.1' } spec.source.should == { :git => 'http://EXAMPLE/Bananas.git', :tag => '0.0.1' }
spec.description.should == 'An optional longer description of Bananas.' spec.description.should == 'A short description of Bananas.'
spec.source_files.should == ['Classes', 'Classes/**/*.{h,m}'] spec.source_files.should == ['Classes', 'Classes/**/*.{h,m}']
end end
...@@ -44,7 +44,7 @@ describe "Pod::Command::Spec#create" do ...@@ -44,7 +44,7 @@ describe "Pod::Command::Spec#create" do
path = temporary_directory + 'libPusher.podspec' path = temporary_directory + 'libPusher.podspec'
spec = Pod::Specification.from_file(path) spec = Pod::Specification.from_file(path)
spec.name.should == 'libPusher' spec.name.should == 'libPusher'
spec.license.should == { :type => "MIT", :file => "LICENSE" } spec.license.should == { :type => "MIT (example)" }
spec.version.should == Pod::Version.new('1.3') spec.version.should == Pod::Version.new('1.3')
spec.summary.should == 'An Objective-C interface to Pusher (pusherapp.com)' spec.summary.should == 'An Objective-C interface to Pusher (pusherapp.com)'
spec.homepage.should == 'https://github.com/lukeredpath/libPusher' spec.homepage.should == 'https://github.com/lukeredpath/libPusher'
...@@ -60,7 +60,7 @@ describe "Pod::Command::Spec#create" do ...@@ -60,7 +60,7 @@ describe "Pod::Command::Spec#create" do
path = temporary_directory + 'other_name.podspec' path = temporary_directory + 'other_name.podspec'
spec = Pod::Specification.from_file(path) spec = Pod::Specification.from_file(path)
spec.name.should == 'other_name' spec.name.should == 'other_name'
spec.license.should == { :type => "MIT", :file => "LICENSE" } spec.license.should == { :type => "MIT (example)" }
spec.version.should == Pod::Version.new('1.3') spec.version.should == Pod::Version.new('1.3')
spec.summary.should == 'An Objective-C interface to Pusher (pusherapp.com)' spec.summary.should == 'An Objective-C interface to Pusher (pusherapp.com)'
spec.homepage.should == 'https://github.com/lukeredpath/libPusher' spec.homepage.should == 'https://github.com/lukeredpath/libPusher'
......
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