Permalink
Browse files

Merge branch 'master' into b0.15.0

* master:
  [Specs] Minor fix for Command::Push.
  [Push] Use git! where possible.
  [Specs] fix for the fix that was supposed to fix Travis.
  [Specs] Fix for Travis issues.
  [Source] The name should be an attribute.
  [Specs] Fixed Travis errors related to Command::Repo.
  [Linter] Fixed minor bug.
  Update CHANGELOG.md
  Update lib/cocoapods/generator/acknowledgements/markdown.rb
  Update lib/cocoapods/generator/acknowledgements/markdown.rb
  [Linter] Promote long summary warning to an error.

Conflicts:
	lib/cocoapods/command/push.rb
  • Loading branch information...
2 parents 76cb703 + a478de6 commit cdecc32a23ad9e38a691c653da4b4a7791ba0a31 @fabiopelosin fabiopelosin committed Sep 19, 2012
View
@@ -30,6 +30,8 @@
- In certain conditions pod setup would execute twice.
- The git cache now is updated if a branch is not found
[#514](https://github.com/CocoaPods/CocoaPods/issues/514)
+- Forcing UTF-8 encoding on licenses generation in Ruby 1.9.
+ [#530](https://github.com/CocoaPods/CocoaPods/issues/530)
## 0.14.0
@@ -166,10 +166,11 @@ def podspec_errors
messages << "Unrecognized platfrom" unless platform_valid?
messages << "Missing name" unless spec.name
messages << "Missing version" unless spec.version
- messages << "Missing summary" unless spec.summary
+ messages << "Missing summary" if !spec.summary || spec.summary.empty?
messages << "Missing homepage" unless spec.homepage
messages << "Missing author(s)" unless spec.authors
messages << "Missing or invalid source: #{spec.source}" unless source_valid?
+ messages << "The summary should be short use `description` (max 140 characters)." if spec.summary && spec.summary.length > 140
# attributes with multiplatform values
return messages unless platform_valid?
@@ -223,13 +224,11 @@ def podspec_warnings
messages << "Missing license type" unless license[:type]
messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
- messages << "The summary is required" if spec.summary.empty?
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 summary should end with a dot" if spec.summary !~ /.*\./
messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
messages << "The summary should end with a dot" if spec.summary !~ /.*\./
- messages << "The summary should be short use `description` (max 140 characters)." if spec.summary.length > 140
messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
messages << "Warnings must not be disabled (`-Wno' compiler flags)" if spec.compiler_flags.split(' ').any? {|flag| flag.start_with?('-Wno') }
@@ -43,6 +43,7 @@ def run
def update_repo
UI.puts "Updating the `#{@repo}' repo\n".yellow unless config.silent
# show the output of git even if not verbose
+ # TODO: use the `git!' and find a way to show the output in realtime.
Dir.chdir(repo_dir) { UI.puts `git pull 2>&1` }
end
@@ -97,9 +98,9 @@ def add_specs_to_repo
FileUtils.mkdir_p(output_path)
FileUtils.cp(Pathname.new(spec.name+'.podspec'), output_path)
Dir.chdir(repo_dir) do
- git("add #{spec.name}")
+ git!("add #{spec.name}")
# Bypass the pre-commit hook because we already performed validation
- git("commit --no-verify -m '#{message}'")
+ git!("commit --no-verify -m '#{message}'")
end
end
end
@@ -177,10 +177,10 @@ def store_podspec(sandbox, podspec)
output_path = sandbox.root + "Local Podspecs/#{name}.podspec"
output_path.dirname.mkpath
if podspec.is_a?(String)
- raise Informative, "No podspec found for `#{name}' in `#{description}'" unless podspec.include?('Spec.new')
+ raise Informative, "No podspec found for `#{name}' in #{description}" unless podspec.include?('Spec.new')
output_path.open('w') { |f| f.puts(podspec) }
else
- raise Informative, "No podspec found for `#{name}' in `#{description}'" unless podspec.exist?
+ raise Informative, "No podspec found for `#{name}' in #{description}" unless podspec.exist?
FileUtils.copy(podspec, output_path)
end
end
@@ -28,6 +28,7 @@ def licenses
licenses_string = "#{title_from_string(header_title, 1)}\n#{header_text}\n"
@pods.each do |pod|
if (license = string_for_pod(pod))
+ license = license.force_encoding("UTF-8") if license.respond_to?(:force_encoding)
licenses_string += license
end
end
View
@@ -18,10 +18,6 @@ def dirs
end
end
- def names
- dirs.map { |repo| repo.basename.to_s }.sort
- end
-
def all_sets
all.map(&:pod_sets).flatten
end
@@ -58,16 +54,16 @@ def self.search_by_name(name, full_text_search)
Aggregate.new.search_by_name(name, full_text_search)
end
- def self.names
- Aggregate.new.names
- end
-
attr_reader :repo
def initialize(repo)
@repo = repo
end
+ def name
+ @repo.basename.to_s
+ end
+
def pod_sets
@repo.children.map do |child|
if child.directory? && child.basename.to_s != '.git'
@@ -44,9 +44,9 @@ def master_repo
git_config('local_repo', 'remote.origin.url').should == (tmp_repos_path + 'upstream').to_s
# prepare the spec
- spec_fix = (fixture('spec-repos') + 'master/JSONKit/1.4/JSONKit.podspec').read
- spec_add = spec_fix.gsub(/https:\/\/github\.com\/johnezang\/JSONKit\.git/, fixture('integration/JSONKit').to_s)
- spec_add.gsub!(/'JSONKit'/, "'PushTest'")
+ spec = (fixture('spec-repos') + 'master/JSONKit/1.4/JSONKit.podspec').read
+ spec_fix = spec.gsub(/https:\/\/github\.com\/johnezang\/JSONKit\.git/, fixture('integration/JSONKit').to_s)
+ spec_add = spec.gsub(/'JSONKit'/, "'PushTest'")
File.open(temporary_directory + 'JSONKit.podspec', 'w') {|f| f.write(spec_fix) }
File.open(temporary_directory + 'PushTest.podspec', 'w') {|f| f.write(spec_add) }
end
@@ -78,35 +78,40 @@ def versions_file
tmp_repos_path + "repo1/CocoaPods-version.yml"
end
+ def write_version_file(hash)
+ yaml = YAML.dump(hash)
+ File.open(versions_file, 'w') {|f| f.write(yaml) }
+ end
+
it "it doesn't requires CocoaPods-version.yml" do
- lambda { run_command('repo', 'update') }.should.not.raise
+ cmd = command('repo', 'update')
+ lambda { cmd.check_versions(versions_file.dirname) }.should.not.raise
end
it "runs with a compatible repo" do
- yaml = YAML.dump({'min' => "0.0.1"})
- File.open(versions_file, 'w') {|f| f.write(yaml) }
- lambda { run_command('repo', 'update') }.should.not.raise
+ write_version_file({'min' => "0.0.1"})
+ cmd = command('repo', 'update')
+ lambda { cmd.check_versions(versions_file.dirname) }.should.not.raise
end
it "raises if a repo is not compatible" do
- yaml = YAML.dump({'min' => "999.0.0"})
- File.open(versions_file, 'w') {|f| f.write(yaml) }
- lambda { run_command('repo', 'update') }.should.raise Pod::Informative
+ write_version_file({'min' => "999.0.0"})
+ cmd = command('repo', 'update')
+ lambda { cmd.check_versions(versions_file.dirname) }.should.raise Pod::Informative
end
it "informs about a higher known CocoaPods version" do
- yaml = YAML.dump({'last' => "999.0.0"})
- File.open(versions_file, 'w') {|f| f.write(yaml) }
- run_command('repo', 'update').should.include "Cocoapods 999.0.0 is available"
+ write_version_file({'last' => "999.0.0"})
+ cmd = command('repo', 'update')
+ cmd.check_versions(versions_file.dirname)
+ cmd.output.should.include "Cocoapods 999.0.0 is available"
end
it "has a class method that returns if a repo is supported" do
- yaml = YAML.dump({'min' => "999.0.0"})
- File.open(versions_file, 'w') {|f| f.write(yaml) }
+ write_version_file({'min' => "999.0.0"})
Pod::Command::Repo.compatible?('repo1').should == false
- yaml = YAML.dump({'min' => "0.0.1"})
- File.open(versions_file, 'w') {|f| f.write(yaml) }
+ write_version_file({'min' => "0.0.1"})
Pod::Command::Repo.compatible?('repo1').should == true
end
end
@@ -30,6 +30,7 @@ def git_config(repo, attr)
def add_repo(name, from)
command = command('repo', 'add', name, from)
command.run
+ # The test branch is used by the push specs
Dir.chdir(command.dir) do
`git checkout -b test >/dev/null 2>&1`
`git branch --set-upstream test origin/master >/dev/null 2>&1`
View
@@ -38,6 +38,6 @@
end
it "return the names of the repos" do
- Pod::Source.names.should == %w| repo1 repo2 |
+ Pod::Source.all.map(&:name).should == %w| repo1 repo2 |
end
end

0 comments on commit cdecc32

Please sign in to comment.