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: 0c99050dd6e16cfc696b4b51fd7b8129cf3f8d5e
4
- data.tar.gz: c118ec2a24af0a384ccebf6614345a38df724890
3
+ metadata.gz: 77628aea13e4f43dab5e7d7ee3dde65fe4967c1f
4
+ data.tar.gz: ce13406a3822d843918d7f6c0a29f2d6ad0b4333
5
5
  SHA512:
6
- metadata.gz: 8fa04b230f3fecf955fba9ec09ff3eb11b76a1e9b424b55a686de1ab60f22a67a14899ce51e8a4786afa1f241f423256d36f3991f9147e148e0c039ccf85016f
7
- data.tar.gz: a7827f903da75753cf62d48c0aa999d61626453f7bbcb418449a482c19cd4b0bbf85a92b50c2bba701dc9aad18163d2888c9e1b042c06b4d5c8c5cc8b24d46a2
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, @url, @options = Pathname.new(target_path), url, options
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?
@@ -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.9.3'
6
+ VERSION = '1.0.0.beta.1'.freeze
7
7
  end
8
8
  end
@@ -17,6 +17,7 @@ module Pod
17
17
  options = {}
18
18
  options[:git] = url
19
19
  options[:commit] = `git rev-parse HEAD`.chomp
20
+ options[:submodules] = true if self.options[:submodules]
20
21
  options
21
22
  end
22
23
  end
@@ -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
- path = URI.parse(url).path
55
- if path =~ /.zip$/
56
+ case URI.parse(url).path
57
+ when /\.zip$/
56
58
  :zip
57
- elsif path =~ /.(tgz|tar\.gz)$/
59
+ when /\.(tgz|tar\.gz)$/
58
60
  :tgz
59
- elsif path =~ /.tar$/
61
+ when /\.tar$/
60
62
  :tar
61
- elsif path =~ /.(tbz|tar\.bz2)$/
63
+ when /\.(tbz|tar\.bz2)$/
62
64
  :tbz
63
- elsif path =~ /.(txz|tar\.xz)$/
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 << '/' << options[:folder] if options[:folder]
55
- result << '/tags/' << options[:tag] if options[:tag]
54
+ result << '/' << options[:folder] if options[:folder]
55
+ result << '/tags/' << options[:tag] if options[:tag]
56
56
  result = [result]
57
- result << '-r' << options[:revision] if options[:revision]
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.9.3
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-08-28 00:00:00.000000000 Z
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.4.8
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.