cocoapods-downloader 1.6.0 → 1.6.3

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
  SHA256:
3
- metadata.gz: c97d257d2ddac34f6116fd99c16d44d77f2db914d87ab4e9a3b60c4460281fc8
4
- data.tar.gz: fead38dd215fc932fe50deb288ddc5db9e9a38077b6185017043ac878dd9b992
3
+ metadata.gz: 552e14f661a129b219df83f3db56753d10be764ad6e6e3b304e8f8249ee13c1b
4
+ data.tar.gz: 47c19e50a1d7ea407552c99052834f037a7bc72b56ad86d100194a45014731f7
5
5
  SHA512:
6
- metadata.gz: a4b95d247caec0895f112376d34a9815eea2ed3e3ecddf469074bfd952dd0b18fad8d49d6f2699c03c84cbde525c1e007d2ff5c1233dd20e113018ce6e20d98e
7
- data.tar.gz: 35ea901675d445329421332622fd1093e96aa7e0ce8a322ff3cc40ffa936cf899439a5ddc128c55c1e91ca66ae2de7c8aaf64c75fe68d7657f9a8813b4bb9e9f
6
+ metadata.gz: '09adf719b95b1f6973515377a5b0f96522e03c6d778ae2440a99f0787eedb5dd637163e80a371735bdd40dd2fd8ba237296116581e86ca7243e9c990153d884f'
7
+ data.tar.gz: e2b21b9bc0c0feb48be075ab70c8e178a66f4fe35851e8df28e079ae7aa7d7887c249a6ce414e4b5ad30bdbe80a3822774ce235b926c321114548e2e00c3da0b
@@ -77,6 +77,7 @@ module Pod
77
77
  # @return [void]
78
78
  #
79
79
  def download
80
+ validate_input
80
81
  ui_action("#{name} download") do
81
82
  target_path.mkpath
82
83
  download!
@@ -121,6 +122,14 @@ module Pod
121
122
  raise 'Abstract method'
122
123
  end
123
124
 
125
+ # Provides a before-download check for safety of the options in the
126
+ # concrete downloader.
127
+ #
128
+ # @return [void]
129
+ #
130
+ def validate_input
131
+ end
132
+
124
133
  # Returns a User-Agent string that itentifies http network requests as
125
134
  # originating from CocoaPods.
126
135
  # Contains version numbers from the CocoaPods Gem and the cocoapods-downloader Gem.
@@ -3,6 +3,6 @@ module Pod
3
3
  # @return [String] Downloader’s version, following
4
4
  # [semver](http://semver.org).
5
5
  #
6
- VERSION = '1.6.0'.freeze
6
+ VERSION = '1.6.3'.freeze
7
7
  end
8
8
  end
@@ -21,12 +21,17 @@ module Pod
21
21
  end
22
22
 
23
23
  def self.preprocess_options(options)
24
- validate_input options
25
24
  return options unless options[:branch]
26
25
 
26
+ input = [options[:git], options[:commit]].map(&:to_s)
27
+ invalid = input.compact.any? { |value| value.start_with?('--') || value.include?(' --') }
28
+ raise DownloaderError, "Provided unsafe input for git #{options}." if invalid
29
+
27
30
  command = ['ls-remote',
31
+ '--',
28
32
  options[:git],
29
33
  options[:branch]]
34
+
30
35
  output = Git.execute_command('git', command)
31
36
  match = commit_from_ls_remote output, options[:branch]
32
37
 
@@ -58,13 +63,7 @@ module Pod
58
63
  match[1] unless match.nil?
59
64
  end
60
65
 
61
- def self.validate_input(options)
62
- input = [options[:git], options[:branch], options[:commit], options[:tag]]
63
- invalid = input.compact.any? { |value| value.start_with?('--') || value.include?(' --') }
64
- raise DownloaderError, "Provided unsafe input for git #{options}." if invalid
65
- end
66
-
67
- private_class_method :commit_from_ls_remote, :validate_input
66
+ private_class_method :commit_from_ls_remote
68
67
 
69
68
  private
70
69
 
@@ -160,6 +159,12 @@ module Pod
160
159
  def target_git(*args)
161
160
  git!(['-C', target_path] + args)
162
161
  end
162
+
163
+ def validate_input
164
+ input = [url, options[:branch], options[:commit], options[:tag]].map(&:to_s)
165
+ invalid = input.compact.any? { |value| value.start_with?('--') || value.include?(' --') }
166
+ raise DownloaderError, "Provided unsafe input for git #{options}." if invalid
167
+ end
163
168
  end
164
169
  end
165
170
  end
@@ -18,19 +18,6 @@ module Pod
18
18
  end
19
19
  end
20
20
 
21
- def self.preprocess_options(options)
22
- validate_input options
23
- options
24
- end
25
-
26
- def self.validate_input(options)
27
- input = [options[:hg], options[:revision], options[:branch], options[:tag]].map(&:to_s)
28
- invalid = input.compact.any? { |value| value.start_with?('--') || value.include?(' --') }
29
- raise DownloaderError, "Provided unsafe input for hg #{options}." if invalid
30
- end
31
-
32
- private_class_method :validate_input
33
-
34
21
  private
35
22
 
36
23
  executable :hg
@@ -62,6 +49,12 @@ module Pod
62
49
  def download_branch!
63
50
  hg! 'clone', url, '--updaterev', options[:branch], @target_path
64
51
  end
52
+
53
+ def validate_input
54
+ input = [url, options[:revision], options[:branch], options[:tag]].map(&:to_s)
55
+ invalid = input.compact.any? { |value| value.start_with?('--') || value.include?(' --') }
56
+ raise DownloaderError, "Provided unsafe input for hg #{options}." if invalid
57
+ end
65
58
  end
66
59
  end
67
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-22 00:00:00.000000000 Z
12
+ date: 2022-04-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: