cocoapods-downloader 0.7.1 → 0.7.2

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
  SHA1:
3
- metadata.gz: 68831d76366281bca8558fb7bdd5daddbb277763
4
- data.tar.gz: 31d2c74d3b451373ededbd926c39ce04eddbe2e1
3
+ metadata.gz: 65525beb4889730013a64bf195c72153f5916fda
4
+ data.tar.gz: dcc5e05077d04952762dfc49946c062ed1406518
5
5
  SHA512:
6
- metadata.gz: abbd94ca42ef5e0f4deeab4ffd34f8220542da81581c9c287c115c69a73930baf086a27f5dc328d5550e6ab573665730fc69b9db8723ffe1b51e3b8c3f449674
7
- data.tar.gz: 861cca68ba4a61421ea9ee183e5b6e7b4af44ca86871cf6dfa32b39f8a785f5e8f20fd543025355b28a6969443fd17fde589b3346fd4ca99b68590c256fac989
6
+ metadata.gz: 8f0c7598747396d1ac4f004de4e8dd8a65e19af439badd70faf861e9ce4b5f30efd089e0b2f1349241c99415aa4a7d0d54b0deb4d106fc33613d3f3d5a907ad7
7
+ data.tar.gz: 64668c107e549505955a18725c3732c63b2fd2f9b8b2326efd246c2e68606a4ab629791956b2cbfe4b139688467a617fefdc0d8f76b8df43495d2d3c1f79b3dd
@@ -121,7 +121,7 @@ module Pod
121
121
 
122
122
  #-----------------------------------------------------------------------#
123
123
 
124
- # Defines two methods for an executable, based on its name. The bag
124
+ # Defines two methods for an executable, based on its name. The bang
125
125
  # version raises if the executable terminates with a non-zero exit code.
126
126
  #
127
127
  # For example
@@ -3,6 +3,6 @@ module Pod
3
3
  # @return [String] Downloader’s version, following
4
4
  # [semver](http://semver.org).
5
5
  #
6
- VERSION = '0.7.1'
6
+ VERSION = '0.7.2'
7
7
  end
8
8
  end
@@ -55,22 +55,50 @@ module Pod
55
55
  # If any specific option should be ignored and the HEAD of the
56
56
  # repo should be cloned.
57
57
  #
58
- def clone(force_head = false)
58
+ # @param [Bool] shallow_clone
59
+ # Whether a shallow clone of the repo should be attempted, if
60
+ # possible given the specified {#options}.
61
+ #
62
+ def clone(force_head = false, shallow_clone = true)
59
63
  ui_sub_action('Git download') do
60
- command = ['clone', url.shellescape, target_path.shellescape]
61
-
62
- unless options[:commit]
63
- command += ['--single-branch', '--depth 1']
64
- end
65
-
66
- unless force_head
67
- if tag_or_branch = options[:tag] || options[:branch]
68
- command += ['--branch', tag_or_branch]
64
+ begin
65
+ git! clone_arguments(force_head, shallow_clone).join(' ')
66
+ rescue DownloaderError => e
67
+ if e.message =~ /^fatal:.*does not support --depth$/im
68
+ clone(force_head, false)
69
+ else
70
+ raise
69
71
  end
70
72
  end
73
+ end
74
+ end
75
+
76
+ # The arguments to pass to `git` to clone the repo.
77
+ #
78
+ # @param [Bool] force_head
79
+ # If any specific option should be ignored and the HEAD of the
80
+ # repo should be cloned.
81
+ #
82
+ # @param [Bool] shallow_clone
83
+ # Whether a shallow clone of the repo should be attempted, if
84
+ # possible given the specified {#options}.
85
+ #
86
+ # @return [Array<String>] arguments to pass to `git` to clone the repo.
87
+ #
88
+ def clone_arguments(force_head, shallow_clone)
89
+ command = ['clone', url.shellescape, target_path.shellescape]
71
90
 
72
- git! command.join(' ')
91
+ if shallow_clone && !options[:commit]
92
+ command += ['--single-branch', '--depth 1']
73
93
  end
94
+
95
+ unless force_head
96
+ if tag_or_branch = options[:tag] || options[:branch]
97
+ command += ['--branch', tag_or_branch]
98
+ end
99
+ end
100
+
101
+ command
74
102
  end
75
103
 
76
104
  # Checks out a specific commit of the cloned repo.
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: 0.7.1
4
+ version: 0.7.2
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: 2014-09-26 00:00:00.000000000 Z
12
+ date: 2014-10-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -56,3 +56,4 @@ signing_key:
56
56
  specification_version: 3
57
57
  summary: A small library for downloading files from remotes in a folder.
58
58
  test_files: []
59
+ has_rdoc: