cocoapods-downloader 0.9.3 → 1.0.0.beta.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77628aea13e4f43dab5e7d7ee3dde65fe4967c1f
|
4
|
+
data.tar.gz: ce13406a3822d843918d7f6c0a29f2d6ad0b4333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88cc2ae88bdaf585db5360c53f2a5197ba0557cecfd55e609f7c7aa10e69572701aa9f121854c7cf02682bedf5920b57d40b1990a85ce2c6088337112ba1633c
|
7
|
+
data.tar.gz: b2a0108e8b3243e0a783fc9139fb49c48be204c99f2f8fd034c25fc882cc8e27b93aacc968d9772657c90b76795d9c1e18b5e68504b0b47b6a75f926132bc97a
|
@@ -47,7 +47,9 @@ module Pod
|
|
47
47
|
#
|
48
48
|
def initialize(target_path, url, options)
|
49
49
|
require 'pathname'
|
50
|
-
@target_path
|
50
|
+
@target_path = Pathname.new(target_path)
|
51
|
+
@url = url
|
52
|
+
@options = options
|
51
53
|
|
52
54
|
unrecognized_options = options.keys - self.class.options
|
53
55
|
unless unrecognized_options.empty?
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'zlib'
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
module Pod
|
4
5
|
module Downloader
|
@@ -14,6 +15,7 @@ module Pod
|
|
14
15
|
executable :curl
|
15
16
|
executable :unzip
|
16
17
|
executable :tar
|
18
|
+
executable :hdiutil
|
17
19
|
|
18
20
|
attr_accessor :filename, :download_path
|
19
21
|
|
@@ -51,17 +53,19 @@ module Pod
|
|
51
53
|
end
|
52
54
|
|
53
55
|
def type_with_url(url)
|
54
|
-
|
55
|
-
|
56
|
+
case URI.parse(url).path
|
57
|
+
when /\.zip$/
|
56
58
|
:zip
|
57
|
-
|
59
|
+
when /\.(tgz|tar\.gz)$/
|
58
60
|
:tgz
|
59
|
-
|
61
|
+
when /\.tar$/
|
60
62
|
:tar
|
61
|
-
|
63
|
+
when /\.(tbz|tar\.bz2)$/
|
62
64
|
:tbz
|
63
|
-
|
65
|
+
when /\.(txz|tar\.xz)$/
|
64
66
|
:txz
|
67
|
+
when /\.dmg$/
|
68
|
+
:dmg
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
@@ -77,6 +81,8 @@ module Pod
|
|
77
81
|
'file.tbz'
|
78
82
|
when :txz
|
79
83
|
'file.txz'
|
84
|
+
when :dmg
|
85
|
+
'file.dmg'
|
80
86
|
else
|
81
87
|
raise UnsupportedFileTypeError, "Unsupported file type: #{type}"
|
82
88
|
end
|
@@ -100,6 +106,8 @@ module Pod
|
|
100
106
|
tar! 'xfj', unpack_from, '-C', unpack_to
|
101
107
|
when :txz
|
102
108
|
tar! 'xf', unpack_from, '-C', unpack_to
|
109
|
+
when :dmg
|
110
|
+
extract_dmg(unpack_from, unpack_to)
|
103
111
|
else
|
104
112
|
raise UnsupportedFileTypeError, "Unsupported file type: #{type}"
|
105
113
|
end
|
@@ -117,6 +125,16 @@ module Pod
|
|
117
125
|
end
|
118
126
|
end
|
119
127
|
|
128
|
+
def extract_dmg(unpack_from, unpack_to)
|
129
|
+
require 'rexml/document'
|
130
|
+
plist_s = hdiutil! 'attach', '-plist', '-nobrowse', unpack_from, '-mountrandom', unpack_to
|
131
|
+
plist = REXML::Document.new plist_s
|
132
|
+
xpath = '//key[.="mount-point"]/following-sibling::string'
|
133
|
+
mount_point = REXML::XPath.first(plist, xpath).text
|
134
|
+
FileUtils.cp_r(Dir.glob(mount_point + '/*'), unpack_to)
|
135
|
+
hdiutil! 'detach', mount_point
|
136
|
+
end
|
137
|
+
|
120
138
|
def compare_hash(filename, hasher, hash)
|
121
139
|
incremental_hash = hasher.new
|
122
140
|
|
@@ -51,10 +51,10 @@ module Pod
|
|
51
51
|
|
52
52
|
def reference_url
|
53
53
|
result = url.dup
|
54
|
-
result << '/'
|
55
|
-
result << '/tags/'
|
54
|
+
result << '/' << options[:folder] if options[:folder]
|
55
|
+
result << '/tags/' << options[:tag] if options[:tag]
|
56
56
|
result = [result]
|
57
|
-
result << '-r'
|
57
|
+
result << '-r' << options[:revision] if options[:revision]
|
58
58
|
result
|
59
59
|
end
|
60
60
|
|
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.
|
4
|
+
version: 1.0.0.beta.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: 2015-
|
12
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.5.1
|
55
55
|
signing_key:
|
56
56
|
specification_version: 3
|
57
57
|
summary: A small library for downloading files from remotes in a folder.
|