cocoapods-deploy 0.0.6 → 0.0.7

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: caac0af8af8f237b9b9beb5272ba6468a95f2c40
4
- data.tar.gz: 726d38f4416117734b98f7d96fc652b0f4f925e8
3
+ metadata.gz: 90f3a90e11046e84badd618da744dc2d426ec367
4
+ data.tar.gz: 160d698aff261e326d129a95d1bd1f06c2358cb5
5
5
  SHA512:
6
- metadata.gz: 349b5870d177943816a653891df7b81e2becf6f0554230eaa3a8b627eabdc51cb63f53f760fd6b93fc8115f9393918da78abed8337fdb0fd5e651bc070d3f113
7
- data.tar.gz: 2ea2b5b8e7a29752e8d72b8407256c0d37053cf7e6f4f564b17bd5714fe37c4537654f47563e1474b842fecee5464325426e3dced79b55b19ffb3a1492d427cd
6
+ metadata.gz: 85eb0606e6e10cfe348dee88d0c1e1495dda94fbdfc8d0056329764de191491eb6efeb712eab97212fda55c2215103ff8ffd50643372280dd873fcb9f0b85a7a
7
+ data.tar.gz: ca4d18151bac93fffcf3f5161f397678c457fb3a4af0dd997ef51521a1f28cc732d64d2bff0332ea9b4ca2f61d40f44669487e4020f3f73758ac6159879e9407
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: cocoapods-deploy 0.0.6 ruby lib
2
+ # stub: cocoapods-deploy 0.0.7 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "cocoapods-deploy"
6
- s.version = "0.0.6"
6
+ s.version = "0.0.7"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.date = "2016-03-07"
12
12
  s.description = "Implement's bundler's --deployment functionality in CocoaPods."
13
13
  s.email = ["james@supmenow.com"]
14
- s.files = [".gitignore", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "cocoapods-deploy.gemspec", "lib/cocoapods-deploy/command.rb", "lib/cocoapods-deploy/command/deploy.rb", "lib/cocoapods-deploy/deploy_transformer.rb", "lib/cocoapods-deploy/deploy_analyzer.rb", "lib/cocoapods-deploy/deploy_installer.rb", "lib/cocoapods-deploy/gem_version.rb", "lib/cocoapods-deploy.rb", "lib/cocoapods_plugin.rb", "spec/spec_helper.rb"]
14
+ s.files = [".gitignore", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "cocoapods-deploy.gemspec", "lib/cocoapods-deploy/command.rb", "lib/cocoapods-deploy/command/deploy.rb", "lib/cocoapods-deploy/deploy_transformer.rb", "lib/cocoapods-deploy/deploy_analyzer.rb", "lib/cocoapods-deploy/deploy_downloader.rb", "lib/cocoapods-deploy/deploy_installer.rb", "lib/cocoapods-deploy/gem_version.rb", "lib/cocoapods-deploy.rb", "lib/cocoapods_plugin.rb", "spec/spec_helper.rb"]
15
15
  s.homepage = "https://github.com/jcampbell05/cocoapods-deploy"
16
16
  s.licenses = ["MIT"]
17
17
  s.rubygems_version = "2.4.8"
@@ -0,0 +1,65 @@
1
+ module Pod
2
+ class DeployDownloader
3
+
4
+ attr_accessor :dependency
5
+
6
+ def initialize(dependency)
7
+ @dependency = dependency
8
+ end
9
+
10
+ def download(config)
11
+ if @dependency.external_source.key?(:podspec)
12
+ download_podspec(config)
13
+ else
14
+ download_source(config)
15
+ end
16
+ end
17
+
18
+ def download_source(config)
19
+ source = ExternalSources.from_dependency(dependency, config.podfile.defined_in_file)
20
+ source.fetch
21
+ end
22
+
23
+ def download_podspec(config)
24
+ dependencies_for_sources(config).each do |dep|
25
+ source = ExternalSources.from_dependency(dep, config.podfile.defined_in_file)
26
+
27
+ begin
28
+ return source.fetch(config.sandbox)
29
+ rescue Exception
30
+ puts "Not Found"
31
+ end
32
+ end
33
+
34
+ raise Informative, "Failed to deploy podspec for `#{@dependency.name}`."
35
+ end
36
+
37
+ def podfile_sources(config)
38
+ return ["https://github.com/CocoaPods/CocoaPods.git"] if config.podfile.sources.empty?
39
+ return config.podfile.sources
40
+ end
41
+
42
+ def dependencies_for_sources(config)
43
+ podfile_sources(config).map do |source|
44
+ filename = File.basename(source, ".*")
45
+ raw_url = File.join( File.dirname(source), filename )
46
+ root_urls = [
47
+ "#{raw_url}/raw/master/Specs",
48
+ "#{raw_url}/raw/master"
49
+ ]
50
+
51
+ root_urls.map do |url|
52
+ source = @dependency.external_source[:podspec].gsub('{root-url}', url)
53
+ dependencies_for_url(source)
54
+ end
55
+ end.flatten
56
+ end
57
+
58
+ def dependencies_for_url(url)
59
+ [
60
+ Dependency.new(@dependency.name, {:podspec => "#{url}.podspec"}),
61
+ Dependency.new(@dependency.name, {:podspec => "#{url}.podspec.json"})
62
+ ]
63
+ end
64
+ end
65
+ end
@@ -64,7 +64,7 @@ module Pod
64
64
  end
65
65
 
66
66
  def podspec_url(pod, version)
67
- "{root-url}/master/Specs/#{pod}/#{version}/#{pod}.podspec.json"
67
+ "{root-url}/#{pod}/#{version}/#{pod}"
68
68
  end
69
69
 
70
70
  def collect_podspec_dependencies(name_or_hash)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Campbell
@@ -55,6 +55,7 @@ files:
55
55
  - lib/cocoapods-deploy/command.rb
56
56
  - lib/cocoapods-deploy/command/deploy.rb
57
57
  - lib/cocoapods-deploy/deploy_analyzer.rb
58
+ - lib/cocoapods-deploy/deploy_downloader.rb
58
59
  - lib/cocoapods-deploy/deploy_installer.rb
59
60
  - lib/cocoapods-deploy/deploy_transformer.rb
60
61
  - lib/cocoapods-deploy/gem_version.rb