cocoapods-check 0.1.0 → 0.1.1.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d464625d3eba53ea9ddf31b4ba57ebc0c37fcad2
4
- data.tar.gz: fc987db227dccab588e97345a3c30e3ec3692f53
3
+ metadata.gz: 38dd0d306636bbbf15886d98e25b2d476693be3e
4
+ data.tar.gz: 6e4e8cef74676f758b7246e60932e67311883424
5
5
  SHA512:
6
- metadata.gz: 4d55b9d5ab7d111d799954a6c119a30a49217035cba4158c7c377017967b80ae5fa478711444af103b7d6f47faacec596586f4758902cc778bd4875d3bef4875
7
- data.tar.gz: 520e7086f606c0cbb03f51fa5cc28018af3fb1f34f103813bd8ad4ebf36d0c3f893f511cab0d1d1678a1534bfee97b00771325b192c5d1234d9fef4105d968b9
6
+ metadata.gz: c8c62dcbda488a41a8cb548e337f6701f00ad38f91cf8453f1929c359ba686bef4431857f8a9fe0e38c85e9977af7f5424473ac789cf56aa5bccb57d41e7dd83
7
+ data.tar.gz: 841188e28bab7332ebfdbfd590ceb127f5baf2c7d6cf720184a7949427e2d91b4fa1f1225e4cb389bff8adafb96f3c74ba31ccff32554a8d261ca2c459234028
@@ -0,0 +1,16 @@
1
+ Contributing
2
+ ============
3
+
4
+ If you would like to contribute code to cocoapods-check you can do so through GitHub by
5
+ forking the repository and sending a pull request.
6
+
7
+ When submitting code, please make every effort to follow existing conventions
8
+ and style in order to keep the code as readable as possible. Please also make
9
+ sure your code has tests.
10
+
11
+ Before your code can be accepted into the project you must also sign the
12
+ [Individual Contributor License Agreement (CLA)][1].
13
+
14
+
15
+ [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1
16
+
data/Rakefile CHANGED
@@ -3,4 +3,5 @@ require "bundler/gem_tasks"
3
3
  require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task :default => :spec
7
+
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_development_dependency 'bundler', '~> 1.10.6'
20
+ spec.add_development_dependency 'bundler', '~> 1.0'
21
21
  spec.add_development_dependency "rake", '~> 10.0'
22
22
  spec.add_development_dependency "rspec"
23
23
 
24
- spec.add_dependency 'cocoapods', "~> 0.39.0"
24
+ spec.add_dependency 'cocoapods', '~> 1.0.0.beta.3'
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsCheck
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1.beta.1'
3
3
  end
@@ -62,13 +62,13 @@ module Pod
62
62
  manifest_version = nil
63
63
  end
64
64
 
65
- # If this is a development Pod
66
- if development_pods[spec_name] != nil
67
- development_result(spec_name, development_pods[spec_name])
68
-
69
65
  # If this Pod is installed
70
- elsif manifest_version
71
- if locked_version != manifest_version
66
+ if manifest_version
67
+ if development_pods[spec_name] != nil
68
+ if is_development_pod_modified?(config, development_pods[spec_name])
69
+ changed_result(spec_name, manifest_version, locked_version)
70
+ end
71
+ elsif locked_version != manifest_version
72
72
  changed_result(spec_name, manifest_version, locked_version)
73
73
  end
74
74
 
@@ -79,11 +79,40 @@ module Pod
79
79
  end.compact
80
80
  end
81
81
 
82
- def development_result(spec_name, external_source)
83
- if @check_command_verbose
84
- "#{spec_name} #{external_source}"
82
+ def is_development_pod_modified?(config, development_pod)
83
+ development_podspec_file = development_pod[:path]
84
+ development_pod_dir = File.dirname(development_podspec_file)
85
+ spec = Specification.from_file(development_podspec_file)
86
+
87
+ # Gather all the dependencies used by the spec, across all platforms, and including subspecs.
88
+ all_files = [spec, spec.subspecs].flatten.map { |a_spec|
89
+ a_spec.available_platforms.map { |platform|
90
+ accessor = Sandbox::FileAccessor.new(Sandbox::PathList.new(Pathname.new(development_pod_dir)), a_spec.consumer(platform))
91
+ [
92
+ accessor.vendored_frameworks,
93
+ accessor.vendored_libraries,
94
+ accessor.resource_bundle_files,
95
+ accessor.license,
96
+ accessor.prefix_header,
97
+ accessor.preserve_paths,
98
+ accessor.readme,
99
+ accessor.resources,
100
+ accessor.source_files
101
+ ].compact
102
+ }
103
+ }.flatten
104
+
105
+ # Also check the podspec date
106
+ all_files.push(development_podspec_file)
107
+
108
+ latest_modified_file = all_files.max_by {|f| File.mtime(f)}
109
+
110
+ if latest_modified_file
111
+ pod_mtime = File.mtime(latest_modified_file)
112
+ manifest_mtime = File.mtime(config.lockfile.defined_in_file)
113
+ pod_mtime >= manifest_mtime
85
114
  else
86
- "Δ#{spec_name}"
115
+ false
87
116
  end
88
117
  end
89
118
 
@@ -1,4 +1,6 @@
1
1
  require 'cocoapods'
2
+ require 'tempfile'
3
+
2
4
  require_relative '../lib/pod/command/check'
3
5
 
4
6
  describe Pod::Command::Check do
@@ -59,26 +61,56 @@ describe Pod::Command::Check do
59
61
  expect(results).to eq([ 'pod_three newly added', 'pod_two 2.0 -> 3.0' ])
60
62
  end
61
63
 
62
- it 'handles development pods' do
64
+ it 'handles development pods with changes' do
63
65
  check = Pod::Command::Check.new(CLAide::ARGV.new([]))
64
66
 
65
- config = create_config({ :pod_one => '1.0', :pod_two => nil }, { :pod_one => '1.0', :pod_two => nil })
67
+ config = create_config({ :pod_one => '1.0', :pod_two => '1.0' }, { :pod_one => '1.0', :pod_two => '1.0' })
66
68
 
67
- development_pods = { :pod_two => 'source' }
68
- results = check.find_differences(config, development_pods)
69
+ # Make an actual file because 'check' needs the modified time
70
+ lockfile_path = Tempfile.new('dev-pod-test-lockfile').path
71
+ allow(config.lockfile).to receive(:defined_in_file).and_return(lockfile_path)
72
+
73
+ # Ensure development pod modified time is after lockfile modified time
74
+ sleep(1)
75
+
76
+ # Create a temp dir with a temp file and run the check in that context
77
+ Dir.mktmpdir('dev-pod-test-dir') do |dir|
78
+ source_file = Tempfile.new('some-pod-file', dir)
69
79
 
70
- expect(results).to eq([ 'Δpod_two' ])
80
+ File.write("#{dir}/foo.podspec", "Pod::Spec.new do |s| s.source_files = '#{File.basename(source_file)}' end")
81
+ puts(File.read("#{dir}/foo.podspec"))
82
+
83
+ development_pods = { :pod_two => { :path => "#{dir}/foo.podspec" } }
84
+ results = check.find_differences(config, development_pods)
85
+
86
+ expect(results).to eq([ '~pod_two' ])
87
+ end
71
88
  end
72
89
 
73
- it 'handles development pods with verbosity' do
74
- check = Pod::Command::Check.new(CLAide::ARGV.new([ '--verbose' ]))
90
+ it 'handles development pods no changes reported' do
91
+ check = Pod::Command::Check.new(CLAide::ARGV.new([]))
75
92
 
76
- config = create_config({ :pod_one => '1.0', :pod_two => nil }, { :pod_one => '1.0', :pod_two => nil })
93
+ config = create_config({ :pod_one => '1.0', :pod_two => '1.0' }, { :pod_one => '1.0', :pod_two => '1.0' })
77
94
 
78
- development_pods = { :pod_two => 'source' }
79
- results = check.find_differences(config, development_pods)
95
+ # Create a temp dir with a temp file and run the check in that context
96
+ Dir.mktmpdir('dev-pod-test-dir') do |dir|
97
+ Tempfile.new('some-pod-file', dir)
98
+
99
+ # Ensure lockfile modified time is after development pod modified time
100
+ sleep(1)
101
+
102
+ # Make an actual file because 'check' needs the modified time
103
+ lockfile_path = Tempfile.new('dev-pod-test-lockfile').path
104
+ allow(config.lockfile).to receive(:defined_in_file).and_return(lockfile_path)
80
105
 
81
- expect(results).to eq([ 'pod_two source' ])
106
+ puts("#{dir}/foo.podspec")
107
+ File.write("#{dir}/foo.podspec", "Pod::Spec.new do |s| s.source_files = 'ack' end")
108
+
109
+ development_pods = { :pod_two => { :path => "#{dir}/foo.podspec" } }
110
+ results = check.find_differences(config, development_pods)
111
+
112
+ expect(results).to eq([])
113
+ end
82
114
  end
83
115
 
84
116
  def create_config(lockfile_hash, manifest_hash)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Di Iorio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-09 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.6
19
+ version: '1.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.6
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.39.0
61
+ version: 1.0.0.beta.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.39.0
68
+ version: 1.0.0.beta.3
69
69
  description: "'check' plugin for CocoaPods"
70
70
  email:
71
71
  - doo@squareup.com
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - CONTRIBUTING.md
77
78
  - Gemfile
78
79
  - LICENSE
79
80
  - README.md
@@ -97,9 +98,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
98
  version: '0'
98
99
  required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
- - - ">="
101
+ - - ">"
101
102
  - !ruby/object:Gem::Version
102
- version: '0'
103
+ version: 1.3.1
103
104
  requirements: []
104
105
  rubyforge_project:
105
106
  rubygems_version: 2.4.6