cocoapods-downloader 1.4.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.

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: 128f7eaefbd34c1b7f9c66c06a45dd5e3d186322938a8346fc5283df450617d0
4
- data.tar.gz: 60a084074452df93b41cfda6248c2fc455b8111c109fc471075e96ca7085e5b9
3
+ metadata.gz: c97d257d2ddac34f6116fd99c16d44d77f2db914d87ab4e9a3b60c4460281fc8
4
+ data.tar.gz: fead38dd215fc932fe50deb288ddc5db9e9a38077b6185017043ac878dd9b992
5
5
  SHA512:
6
- metadata.gz: 2fd8b780dc60807be9317865fea329ecf608f18ce1e81bca8653c23b548589d9b7c3099d4e82ff7c7097e75f256e856ff788d2691f34312798e61f13f13154f3
7
- data.tar.gz: 8435a98df7285ea8753b443656e306d1467dc8bfa28551c70d018630c03ad8820dc564576bd70a90d51d848cdad184a8e8b00ab59d05950740af4548d0971ae0
6
+ metadata.gz: a4b95d247caec0895f112376d34a9815eea2ed3e3ecddf469074bfd952dd0b18fad8d49d6f2699c03c84cbde525c1e007d2ff5c1233dd20e113018ce6e20d98e
7
+ data.tar.gz: 35ea901675d445329421332622fd1093e96aa7e0ce8a322ff3cc40ffa936cf899439a5ddc128c55c1e91ca66ae2de7c8aaf64c75fe68d7657f9a8813b4bb9e9f
data/README.markdown CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  A small library for downloading files from remotes in a folder.
4
4
 
5
- [![Build Status](https://img.shields.io/travis/CocoaPods/cocoapods-downloader/master.svg?style=flat)](https://travis-ci.org/CocoaPods/cocoapods-downloader)
6
- [![Coverage](https://img.shields.io/codeclimate/coverage/github/CocoaPods/cocoapods-downloader.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader)
7
- [![Code Climate](https://img.shields.io/codeclimate/github/CocoaPods/cocoapods-downloader.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader)
5
+ [![Build Status](https://img.shields.io/github/workflow/status/CocoaPods/CocoaPods-Downloader/Spec)](https://github.com/CocoaPods/cocoapods-downloader/actions)
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/2253ffb0c2c98e4d1c71/maintainability)](https://codeclimate.com/github/CocoaPods/cocoapods-downloader/maintainability)
8
8
 
9
9
  ## Install
10
10
 
@@ -72,6 +72,10 @@ All CocoaPods development happens on GitHub, there is a repository for [CocoaPod
72
72
 
73
73
  Follow [@CocoaPods](http://twitter.com/CocoaPods) to get up to date information about what's going on in the CocoaPods world.
74
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
+
75
79
  ## License
76
80
 
77
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.4.0'.freeze
6
+ VERSION = '1.6.0'.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,11 +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
- match = %r{([a-z0-9]*)\trefs\/(heads|tags)\/#{Regexp.quote(branch_name)}}.match(output)
56
+ encoded_branch_name = branch_name.dup.force_encoding(Encoding::ASCII_8BIT)
57
+ match = %r{([a-z0-9]*)\trefs\/(heads|tags)\/#{Regexp.quote(encoded_branch_name)}}.match(output)
56
58
  match[1] unless match.nil?
57
59
  end
58
60
 
59
- private_class_method :commit_from_ls_remote
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
60
68
 
61
69
  private
62
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
@@ -93,13 +93,7 @@ module Pod
93
93
  case type
94
94
  when :zip
95
95
  unzip! unpack_from, '-d', unpack_to
96
- when :tgz
97
- tar! 'xfz', unpack_from, '-C', unpack_to
98
- when :tar
99
- tar! 'xf', unpack_from, '-C', unpack_to
100
- when :tbz
101
- tar! 'xfj', unpack_from, '-C', unpack_to
102
- when :txz
96
+ when :tar, :tgz, :tbz, :txz
103
97
  tar! 'xf', unpack_from, '-C', unpack_to
104
98
  when :dmg
105
99
  extract_dmg(unpack_from, unpack_to)
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
8
8
  - Fabio Pelosin
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-17 00:00:00.000000000 Z
12
+ date: 2022-03-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description:
14
+ description:
15
15
  email:
16
16
  - eloy.de.enige@gmail.com
17
17
  - fabiopelosin@gmail.com
@@ -37,7 +37,7 @@ homepage: https://github.com/CocoaPods/cocoapods-downloader
37
37
  licenses:
38
38
  - MIT
39
39
  metadata: {}
40
- post_install_message:
40
+ post_install_message:
41
41
  rdoc_options: []
42
42
  require_paths:
43
43
  - lib
@@ -52,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.0.3
56
- signing_key:
55
+ rubygems_version: 3.1.6
56
+ signing_key:
57
57
  specification_version: 3
58
58
  summary: A small library for downloading files from remotes in a folder.
59
59
  test_files: []