cocoapods-deploy 0.0.11 → 0.0.12

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: 848abbd9996c26ac01f3f2db4bb916fbe01ca423
4
- data.tar.gz: f06ca063d50a5765f375eb34fe622f6abbd7b1c3
3
+ metadata.gz: 23f72e7976f12eea154d47725abec6817f285477
4
+ data.tar.gz: 35c215104c85952786895b18b2388e5dbd2213b6
5
5
  SHA512:
6
- metadata.gz: 707c57134eecedb0337869cb33afaecb318aca8f2b524e5f0d1f6f7cf2ca371a2be9af0cdce1940d793eec32beb54b3962af58c29ac7cca1c927231e817bd76a
7
- data.tar.gz: bdbe7a768450629ad2ed0f4a57f39bc075561ee4e50e8d28e55d34d9f7c10e9f22378df4c1b325b0a6cba0bcddac21704e47dd1fb38cabe1b17fffffe932ce55
6
+ metadata.gz: c33fc62c642222dcbab9b68215f4170bb3657c2061eb46a6e798fe6de708f1a1767b3a9eb52fe8f1a8a73a1b001d05412015f24cba91818f091b55308e4669c2
7
+ data.tar.gz: 6cec03f1019d8ad175c3a797d60ee95e2d817b0c8c7eb5ad3bc905b61d96506358b2298fdd7e38bd968579c25174b4d0131595e808c66da14115f0ea2df983c1
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: cocoapods-deploy 0.0.9 ruby lib
2
+ # stub: cocoapods-deploy 0.0.12 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "cocoapods-deploy"
6
- s.version = "0.0.11"
6
+ s.version = "0.0.12"
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_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"]
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", "lib/cocoapods-deploy/patches/write_lockfile_patch.rb"]
15
15
  s.homepage = "https://github.com/jcampbell05/cocoapods-deploy"
16
16
  s.licenses = ["MIT"]
17
17
  s.rubygems_version = "2.4.8"
@@ -1,3 +1,5 @@
1
+ # - Patch Lockfile to store URLs
2
+ # - Use the data in deploy
1
3
  module Pod
2
4
  class Command
3
5
  class Deploy < Command
@@ -43,7 +45,6 @@ module Pod
43
45
  # In the future passing the lockfile into the resolve is hacked
44
46
  # potentially we could have a special deploy subclass.
45
47
  #
46
- # TODO: BDD
47
48
  def apply_resolver_patch
48
49
  Resolver.class_eval do
49
50
 
@@ -77,28 +78,27 @@ module Pod
77
78
  end
78
79
  end
79
80
  end
80
-
81
+
81
82
  # Applies patch to external sources to add a no_validate option which
82
83
  # can be used to disable validation of downloaded podspecs. A normal install
83
84
  # doesn't validate the podspecs of non-external pods even though certain
84
85
  # podspecs are not entirely valid (for example an invalid license file type).
85
86
  # This would mean the normal install command can install certain pods that deploy
86
- # doesn't because of the validation. This patch makes sure validation doesn't
87
+ # doesn't because of the validation. This patch makes sure validation doesn't
87
88
  # happen when deploy is being used.
88
89
  #
89
- # TODO: BDD
90
90
  def apply_external_sources_patch
91
91
  ExternalSources::AbstractExternalSource.class_eval do
92
92
  attr_accessor :no_validate
93
-
93
+
94
94
  old_validate_podspec = instance_method(:validate_podspec)
95
-
95
+
96
96
  def validate_podspec(podspec)
97
97
  return if no_validate
98
98
  old_validate_podspec(podspec)
99
99
  end
100
100
  end
101
- end
101
+ end
102
102
 
103
103
  # Installs required sources for lockfile - TODO: Simplify code
104
104
  def install_sources_for_lockfile
@@ -119,15 +119,15 @@ module Pod
119
119
  # Triggers the CocoaPods install process
120
120
  def install(podfile)
121
121
  installer = DeployInstaller.new(config.sandbox, podfile, nil)
122
-
122
+
123
123
  # Disable updating of the CocoaPods Repo since we are directly
124
124
  # deploying using Podspecs
125
125
  installer.repo_update = false
126
126
 
127
127
  # Disable cleaning of the source file since we are deploying
128
128
  # and we don't need to keep things clean.
129
- installer.installation_options.clean = false
130
-
129
+ installer.installation_options.clean = false
130
+
131
131
  installer.install!
132
132
  end
133
133
 
@@ -135,7 +135,6 @@ module Pod
135
135
  setup_environment
136
136
  verify_environment
137
137
 
138
- # TODO: BDD Patch
139
138
  apply_resolver_patch
140
139
  apply_external_sources_patch
141
140
 
@@ -3,10 +3,12 @@ module Pod
3
3
 
4
4
  attr_accessor :lockfile
5
5
  attr_accessor :sandbox
6
+ attr_accessor :metadata
6
7
 
7
8
  def initialize(lockfile, sandbox)
8
9
  @lockfile = lockfile
9
10
  @sandbox = sandbox
11
+ @metadata = Source::Metadata.new({'prefix_lengths' => [1, 1, 1]})
10
12
  end
11
13
 
12
14
  def transform_podfile(podfile)
@@ -64,7 +66,8 @@ module Pod
64
66
  end
65
67
 
66
68
  def podspec_url(pod, version)
67
- "{root-url}/#{pod}/#{version}/#{pod}"
69
+ path_fragment = metadata.path_fragment(pod)
70
+ "{root-url}/#{path_fragment}/#{version}/#{pod}"
68
71
  end
69
72
 
70
73
  def collect_podspec_dependencies(name_or_hash)
@@ -1,3 +1,3 @@
1
1
  module CocoapodsDeploy
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -0,0 +1,87 @@
1
+ module Pod
2
+
3
+ # - Apply patch to sandbox
4
+ # - Both work together to record URI of ext pod
5
+ # - deploy transformer should use this data
6
+ # - Help people upgrade to 0.1 of cocoapods-deploy
7
+
8
+ Sandbox.class_eval do
9
+
10
+ def external_podspecs
11
+ @external_podspecs
12
+ end
13
+
14
+ def store_external_podspec(name, url)
15
+ UI.message("store #{name} and #{url}")
16
+ @external_podspecs ||= {}
17
+ @external_podspecs[name] = url
18
+ end
19
+ end
20
+
21
+ Installer.class_eval do
22
+
23
+ def apply_lockfile_patch
24
+
25
+ ExternalSources::DownloaderSource.class_eval do
26
+ def pre_download(sandbox)
27
+
28
+ # - Call original and just apply the store section afterwards
29
+
30
+ strategy = Downloader.strategy_from_options(params)
31
+ options = params.dup
32
+ url = options.delete(strategy)
33
+
34
+ title = "Pre-downloading: `#{name}` #{description}"
35
+ UI.titled_section(title, :verbose_prefix => '-> ') do
36
+ target = sandbox.pod_dir(name)
37
+ download_result = Downloader.download(download_request, target, :can_cache => can_cache)
38
+ spec = download_result.spec
39
+
40
+ raise Informative, "Unable to find a specification for '#{name}'." unless spec
41
+
42
+ store_podspec(sandbox, spec)
43
+ sandbox.store_external_podspec(name, url)
44
+ sandbox.store_pre_downloaded_pod(name)
45
+ sandbox.store_checkout_source(name, download_result.checkout_options)
46
+ end
47
+ end
48
+ end
49
+
50
+ Lockfile.class_eval do
51
+ def self.generate(podfile, specs, checkout_options, podspecs)
52
+ hash = {
53
+ 'PODS' => generate_pods_data(specs),
54
+ 'DEPENDENCIES' => generate_dependencies_data(podfile),
55
+ 'EXTERNAL SOURCES' => generate_external_sources_data(podfile),
56
+ 'CHECKOUT OPTIONS' => checkout_options,
57
+ 'SPEC CHECKSUMS' => generate_checksums(specs),
58
+ 'PODFILE CHECKSUM' => podfile.checksum,
59
+ 'EXTERNAL PODSPECS' => podspecs,
60
+ 'COCOAPODS' => CORE_VERSION,
61
+ 'COCOAPODS DEPLOY' => '0.0.11' # - Get from cocoapods version
62
+ }
63
+ Lockfile.new(hash)
64
+ end
65
+ end
66
+ end
67
+
68
+ def write_lockfiles
69
+ apply_lockfile_patch
70
+
71
+ # How do we get URL for podspec on download that we can put here ?
72
+ external_source_pods = podfile.dependencies.select(&:external_source).map(&:root_name).uniq
73
+ checkout_options = sandbox.checkout_sources.select { |root_name, _| external_source_pods.include? root_name }
74
+ @lockfile = Lockfile.generate(podfile, analysis_result.specifications, checkout_options, sandbox.external_podspecs)
75
+
76
+ UI.message "- Writing Lockfile in #{UI.path config.lockfile_path}" do
77
+ @lockfile.write_to_disk(config.lockfile_path)
78
+ end
79
+
80
+ UI.message "- Writing Manifest in #{UI.path sandbox.manifest_path}" do
81
+ sandbox.manifest_path.open('w') do |f|
82
+ f.write config.lockfile_path.read
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -3,3 +3,4 @@ require 'cocoapods-deploy/deploy_downloader'
3
3
  require 'cocoapods-deploy/deploy_installer'
4
4
  require 'cocoapods-deploy/deploy_transformer'
5
5
  require 'cocoapods-deploy/command'
6
+ require 'cocoapods-deploy/patches/write_lockfile_patch'
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.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Campbell
@@ -61,6 +61,7 @@ files:
61
61
  - lib/cocoapods-deploy.rb
62
62
  - lib/cocoapods_plugin.rb
63
63
  - spec/spec_helper.rb
64
+ - lib/cocoapods-deploy/patches/write_lockfile_patch.rb
64
65
  - spec/command/deploy_spec.rb
65
66
  homepage: https://github.com/jcampbell05/cocoapods-deploy
66
67
  licenses: