cocoapods-dependencies 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a74299e7af9cc89d54bc189db11d54bc6950c8
4
- data.tar.gz: f15b4438c1993d7e5d0ca709e084392caaf0e1a6
3
+ metadata.gz: 003404a5b3ff8e166064c092a39b6acdcdfc77a3
4
+ data.tar.gz: 399610903d83d9062b206590f94788e9f1dadf13
5
5
  SHA512:
6
- metadata.gz: e039777b64e3b566f2bb06ce396bd4123cf3476fa870cee6860047fdcc32520ba74406e973ed495707435e82602ac550d80dce9f31734b855b423105da85d4f4
7
- data.tar.gz: 4450becbde4e74625b527346a819a8ef0859d9ced7f846b847607fe4a2262aca7873b9f2e4df919873d7728565c0171fd46870c8239e2ef960bfbc0324b09500
6
+ metadata.gz: 946125627d445fde912a98e9f09bff89a0f4b786efa1852874a56f7b1b27d3aed6bde3e7cfedc764a3737b016ef393c88768bf5d1c3defe555db40df49a4823a
7
+ data.tar.gz: 952f705d820b08466c052cd349cd15bed003dd276be8ca43b41bb6756090110fc14d30add4e9b7bc70be68eae692b9701552170dbcbc82db34fc18feec6ed7a3
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  module Dependencies
3
- VERSION = "0.2.1"
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -9,35 +9,86 @@ module Pod
9
9
 
10
10
  def self.options
11
11
  [
12
- ['--ignore-lockfile', 'whether the lockfile should be ignored when calculating the dependency graph'],
12
+ ['--ignore-lockfile', 'Whether the lockfile should be ignored when calculating the dependency graph'],
13
+ ['--repo-update', 'Fetch external podspecs and run `pod repo update` before calculating the dependency graph'],
14
+ ].concat(super)
15
+ end
16
+
17
+ def self.arguments
18
+ [
19
+ CLAide::Argument.new('PODSPEC', false)
13
20
  ].concat(super)
14
21
  end
15
22
 
16
23
  def initialize(argv)
24
+ @podspec_name = argv.shift_argument
17
25
  @ignore_lockfile = argv.flag?('ignore-lockfile', false)
26
+ @repo_update = argv.flag?('repo-update', false)
18
27
  super
19
28
  end
20
29
 
30
+ def validate!
31
+ super
32
+ if @podspec_name
33
+ require 'pathname'
34
+ path = Pathname.new(@podspec_name)
35
+ if path.exist?
36
+ @podspec = Specification.from_file(path)
37
+ else
38
+ @podspec = SourcesManager.
39
+ search(Dependency.new(@podspec_name)).
40
+ specification.
41
+ subspec_by_name(@podspec_name)
42
+ end
43
+ end
44
+ end
45
+
21
46
  def run
22
- UI.section 'Project Dependencies' do
23
- STDOUT.puts dependencies.to_yaml
47
+ UI.title 'Dependencies' do
48
+ UI.puts dependencies.to_yaml
24
49
  end
25
50
  end
26
51
 
27
52
  def dependencies
28
53
  @dependencies ||= begin
29
- verify_podfile_exists!
30
54
  analyzer = Installer::Analyzer.new(
31
- config.sandbox,
32
- config.podfile,
55
+ sandbox,
56
+ podfile,
33
57
  @ignore_lockfile ? nil : config.lockfile
34
58
  )
35
- specs = analyzer.analyze(true).specs_by_target.values.flatten(1)
36
- lockfile = Lockfile.generate(config.podfile, specs)
59
+
60
+ integrate_targets = config.integrate_targets
61
+ config.integrate_targets = false
62
+ specs = analyzer.analyze(@repo_update).specs_by_target.values.flatten(1)
63
+ config.integrate_targets = integrate_targets
64
+
65
+ lockfile = Lockfile.generate(podfile, specs)
37
66
  pods = lockfile.to_hash['PODS']
38
67
  end
39
68
  end
40
69
 
70
+ def podfile
71
+ @podfile ||= begin
72
+ if podspec = @podspec
73
+ platform = podspec.available_platforms.first
74
+ platform_name, platform_version = platform.name, platform.deployment_target.to_s
75
+ sources = SourcesManager.all.map(&:url)
76
+ Podfile.new do
77
+ sources.each { |s| source s }
78
+ platform platform_name, platform_version
79
+ pod podspec.name
80
+ end
81
+ else
82
+ verify_podfile_exists!
83
+ config.podfile
84
+ end
85
+ end
86
+ end
87
+
88
+ def sandbox
89
+ @podspec ? Sandbox.new(Dir.mktmpdir) : config.sandbox
90
+ end
91
+
41
92
  end
42
93
  end
43
94
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel E. Giddins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler