Commit 9b118f86 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' into DirList

* master:
  [Statistics] Robustness.
  [Outdated] Fixed crash.
  [LocalPod] Fixed clean paths.
  Fix RubyGems version informative crash.
  Credit where credit is due. Fabio, thanks for all the work!
parents 3f15763d 11edebab
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...master) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.15.0...master)
###### Bug fixes
- Fixed an issue that lead to empty directories for Pods.
[#519](https://github.com/CocoaPods/CocoaPods/issues/519)
[#568](https://github.com/CocoaPods/CocoaPods/issues/568)
- Fixed a crash related to the RubyGems version informative.
[#570](https://github.com/CocoaPods/CocoaPods/issues/570)
- Fixed a crash for `pod outdated`.
[#567](https://github.com/CocoaPods/CocoaPods/issues/567)
## 0.15.0 ## 0.15.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...0.15.0)[Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.3.3...0.3.4) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...0.15.0)[Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.3.3...0.3.4)
......
Copyright (c) 2012 Eloy Durán <eloy.de.enige@gmail.com> Copyright (c) 2011 - 2012 Eloy Durán <eloy.de.enige@gmail.com>
Copyright (c) 2012 Fabio Pelosin <fabiopelosin@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -7,9 +7,9 @@ Gem::Specification.new do |s| ...@@ -7,9 +7,9 @@ Gem::Specification.new do |s|
s.version = Pod::VERSION s.version = Pod::VERSION
s.date = Date.today s.date = Date.today
s.license = "MIT" s.license = "MIT"
s.email = "eloy.de.enige@gmail.com" s.email = ["eloy.de.enige@gmail.com", "fabiopelosin@gmail.com"]
s.homepage = "https://github.com/CocoaPods/CocoaPods" s.homepage = "https://github.com/CocoaPods/CocoaPods"
s.authors = ["Eloy Duran"] s.authors = ["Eloy Duran", "Fabio Pelosin"]
s.summary = "An Objective-C library package manager." s.summary = "An Objective-C library package manager."
s.description = "CocoaPods manages library dependencies for your Xcode project.\n\n" \ s.description = "CocoaPods manages library dependencies for your Xcode project.\n\n" \
......
...@@ -7,7 +7,7 @@ require 'rubygems' ...@@ -7,7 +7,7 @@ require 'rubygems'
# #
# E.g. https://github.com/CocoaPods/CocoaPods/issues/398 # E.g. https://github.com/CocoaPods/CocoaPods/issues/398
unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(Gem::VERSION)) unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(Gem::VERSION))
STDERR.puts "Your RubyGems version (#{Gem::VERSION}) is too old, please update with: `gem update --system`".red STDERR.puts "\e[1;31m" + "Your RubyGems version (1.8.24) is too old, please update with: `gem update --system`" + "\e[0m"
exit 1 exit 1
end end
......
...@@ -22,7 +22,6 @@ module Pod ...@@ -22,7 +22,6 @@ module Pod
def run def run
verify_podfile_exists! verify_podfile_exists!
verify_lockfile_exists! verify_lockfile_exists!
update_spec_repos_if_necessary!
sandbox = Sandbox.new(config.project_pods_root) sandbox = Sandbox.new(config.project_pods_root)
resolver = Resolver.new(config.podfile, config.lockfile, sandbox) resolver = Resolver.new(config.podfile, config.lockfile, sandbox)
...@@ -30,6 +29,9 @@ module Pod ...@@ -30,6 +29,9 @@ module Pod
resolver.update_external_specs = false resolver.update_external_specs = false
resolver.resolve resolver.resolve
#TODO: the command report new dependencies (added to by updated ones)
# as updates.
names = resolver.pods_to_install - resolver.pods_from_external_sources names = resolver.pods_to_install - resolver.pods_from_external_sources
specs = resolver.specs.select do |spec| specs = resolver.specs.select do |spec|
names.include?(spec.name) && !spec.version.head? names.include?(spec.name) && !spec.version.head?
......
...@@ -169,12 +169,14 @@ module Pod ...@@ -169,12 +169,14 @@ module Pod
# #
# @return [Array<Strings>] The paths that can be deleted. # @return [Array<Strings>] The paths that can be deleted.
# #
# @note The Paths are downcased to prevent issues. See #568.
#
def clean_paths def clean_paths
cached_used_paths = used_files used = used_files.map(&:downcase)
files = Dir.glob(root + "**/*", File::FNM_DOTMATCH) files = Dir.glob(root + "**/*", File::FNM_DOTMATCH).map(&:downcase)
files.reject! do |candidate| files.reject! do |candidate|
candidate.end_with?('.', '..') || cached_used_paths.any? do |path| candidate.end_with?('.', '..') || used.any? do |path|
path.include?(candidate) || candidate.include?(path) path.include?(candidate) || candidate.include?(path)
end end
end end
......
...@@ -90,7 +90,7 @@ module Pod ...@@ -90,7 +90,7 @@ module Pod
def github_stats_if_needed(set) def github_stats_if_needed(set)
return if get_value(set, :gh_date) && get_value(set, :gh_date) > Time.now - cache_expiration return if get_value(set, :gh_date) && get_value(set, :gh_date) > Time.now - cache_expiration
spec = set.specification spec = set.specification
url = spec.source.reject {|k,_| k == :commit || k == :tag }.values.first url = spec.source[:git] || ''
repo_id = url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1] repo_id = url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1]
return unless repo_id return unless repo_id
......
...@@ -54,11 +54,11 @@ describe Pod::LocalPod do ...@@ -54,11 +54,11 @@ describe Pod::LocalPod do
end end
it "returns an expanded list the files to clean" do it "returns an expanded list the files to clean" do
clean_paths = @pod.clean_paths.map { |p| p.to_s.gsub(/.*Pods\/BananaLib/,'') } clean_paths = @pod.clean_paths.map { |p| p.to_s.gsub(/.*pods\/bananalib/,'') }
clean_paths.should.include "/.git/config" clean_paths.should.include "/.git/config"
# * There are some hidden files on Travis # * There are some hidden files on Travis
# * The submodule of the repo (libPusher) can be ignore, to reduce noise of this test # * The submodule of the repo (libPusher) can be ignore, to reduce noise of this test
clean_files_without_hidden = clean_paths.reject { |p| p.to_s.include?('/.') || p.to_s.include?('libPusher') } clean_files_without_hidden = clean_paths.reject { |p| p.to_s.include?('/.') || p.to_s.include?('libpusher') }
clean_files_without_hidden.should == %W[ /sub-dir /sub-dir/sub-dir-2 /sub-dir/sub-dir-2/somefile.txt ] clean_files_without_hidden.should == %W[ /sub-dir /sub-dir/sub-dir-2 /sub-dir/sub-dir-2/somefile.txt ]
end end
...@@ -206,8 +206,9 @@ describe Pod::LocalPod do ...@@ -206,8 +206,9 @@ describe Pod::LocalPod do
/StoreKit/StoreKit_Prefix.pch /StoreKit/StoreKit_Prefix.pch
/UIKit/UIKit_Prefix.pch /UIKit/UIKit_Prefix.pch
] ]
computed = @pod.clean_paths.each{ |p| p.gsub!(@pod.root.to_s, '') } root = @pod.root.to_s.downcase
assert_array_equals(expected, computed) computed = @pod.clean_paths.each{ |p| p.gsub!(root, '') }
assert_array_equals(expected.map(&:downcase), computed)
end end
it "resolves the used files" do it "resolves the used files" do
......
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