cocoapods-downloader 1.5.0 → 1.6.1

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.

Potentially problematic release.


This version of cocoapods-downloader might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc4fe940ffcfe1f304e30cf50212217dc821e13e3a3431e73c01af91f54139b7
4
- data.tar.gz: e71b8009f6c2f939cac92ef1ecbff51f824e2d1ea394d5b1d9936c14d41d2c61
3
+ metadata.gz: d788d8599f683b58ee1859e835a12fd09db9aa8852ea7cf4af572cf99ca73e86
4
+ data.tar.gz: 3c323bca7678037e3c03fe8942a18acf7ed44216f09bde9ce6c6773f4cebe26b
5
5
  SHA512:
6
- metadata.gz: 9a3666c592eaedbd7e87a550520d6184548e9cb9d71c0b16eef51ea961a5a5b12a5803d563cb16fc1c12e07bba5892cca44520d0b9ffc38909ededee9696c86a
7
- data.tar.gz: c7059215e47fc5bc22026ea3b5b4a502b39b24f377280e9242a61a11e317bfa73cbee6f1d6737885c5e4da6d6ca95bf62971e283241b7878b2cb943d09a7d380
6
+ metadata.gz: 166cd1b6b112c3c2a903477ab1f33b58bb6fc6ff269f0a63486a56726d110cba0d32162c9e8662109736310b5d3bb800d1de8358050125cf4974e7a33adcfff6
7
+ data.tar.gz: 840d72c9021a93c9bd2e28f0bbd6fab767227f1d4f4fad9a701055022d022d6702fbca3181532eba184456a4212130e5721ca9b0739bc6043549fd88badcef46
data/README.markdown CHANGED
@@ -4,8 +4,7 @@ A small library for downloading files from remotes in a folder.
4
4
 
5
5
  [![Build Status](https://img.shields.io/github/workflow/status/CocoaPods/CocoaPods-Downloader/Spec)](https://github.com/CocoaPods/cocoapods-downloader/actions)
6
6
  [![Gem Version](https://img.shields.io/gem/v/cocoapods-downloader)](https://rubygems.org/gems/cocoapods-downloader)
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader/maintainability)
8
- [![Test Coverage](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/test_coverage)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader/test_coverage)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/2253ffb0c2c98e4d1c71/maintainability)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader/maintainability)
9
8
 
10
9
  ## Install
11
10
 
@@ -73,6 +72,10 @@ All CocoaPods development happens on GitHub, there is a repository for [CocoaPod
73
72
 
74
73
  Follow [@CocoaPods](http://twitter.com/CocoaPods) to get up to date information about what's going on in the CocoaPods world.
75
74
 
75
+ ## Development
76
+
77
+ You need to have `svn`, `bzr`, `hg` and `git` installed to run the specs. There are some specs which require `hdiutil` which will only run on macOS.
78
+
76
79
  ## License
77
80
 
78
81
  This gem and CocoaPods are available under the MIT license.
@@ -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.5.0'.freeze
6
+ VERSION = '1.6.1'.freeze
7
7
  end
8
8
  end
@@ -21,6 +21,7 @@ module Pod
21
21
  end
22
22
 
23
23
  def self.preprocess_options(options)
24
+ validate_input options
24
25
  return options unless options[:branch]
25
26
 
26
27
  command = ['ls-remote',
@@ -52,12 +53,18 @@ module Pod
52
53
  #
53
54
  def self.commit_from_ls_remote(output, branch_name)
54
55
  return nil if branch_name.nil?
55
- encoded_branch_name = branch_name.force_encoding(Encoding::ASCII_8BIT)
56
+ encoded_branch_name = branch_name.dup.force_encoding(Encoding::ASCII_8BIT)
56
57
  match = %r{([a-z0-9]*)\trefs\/(heads|tags)\/#{Regexp.quote(encoded_branch_name)}}.match(output)
57
58
  match[1] unless match.nil?
58
59
  end
59
60
 
60
- private_class_method :commit_from_ls_remote
61
+ def self.validate_input(options)
62
+ input = [options[:git], options[:branch], options[:commit], options[:tag]].map(&:to_s)
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
61
68
 
62
69
  private
63
70
 
@@ -18,6 +18,19 @@ 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
+
21
34
  private
22
35
 
23
36
  executable :hg
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.5.0
4
+ version: 1.6.1
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: 2021-08-31 00:00:00.000000000 Z
12
+ date: 2022-03-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.2.3
55
+ rubygems_version: 3.1.6
56
56
  signing_key:
57
57
  specification_version: 3
58
58
  summary: A small library for downloading files from remotes in a folder.