cocoapods-downloader 0.3.0 → 0.4.0
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 +4 -4
- data/README.markdown +5 -4
- data/lib/cocoapods-downloader.rb +0 -1
- data/lib/cocoapods-downloader/base.rb +10 -0
- data/lib/cocoapods-downloader/bazaar.rb +15 -4
- data/lib/cocoapods-downloader/gem_version.rb +1 -1
- data/lib/cocoapods-downloader/git.rb +1 -1
- data/lib/cocoapods-downloader/http.rb +11 -9
- data/lib/cocoapods-downloader/mercurial.rb +2 -2
- data/lib/cocoapods-downloader/subversion.rb +5 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f28eb1ab8b3da09fd0ad05abdd2b524aa81e329
|
4
|
+
data.tar.gz: 91e761ece6ef2da8f5b4086e2f9961cd66dc4daf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 504d84edc7468bc3daebac5778ebd984425c703175a21cd0df78a34d9911a8cd92128e7e3700ec8b671323862457a43c6fe4bbed26bb80fe0278cc7af126658b
|
7
|
+
data.tar.gz: 68479c06a8cf758c63851155bea0413d43ea15e62afbca1c35d5d8a25c93d5449ed271562087dbd1b2f3a256720ae8340c6c9bcc6464b23b528589bd2fe7400f
|
data/README.markdown
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
A small library for downloading files from remotes in a folder.
|
4
4
|
|
5
|
-
[](https://travis-ci.org/CocoaPods/cocoapods-downloader)
|
6
|
+
[](https://coveralls.io/r/CocoaPods/cocoapods-downloader)
|
7
|
+
[](https://codeclimate.com/github/CocoaPods/cocoapods-downloader)
|
7
8
|
|
8
9
|
## Install
|
9
10
|
|
@@ -18,7 +19,7 @@ require 'cocoapods-downloader'
|
|
18
19
|
|
19
20
|
target_path = './Downloads/MyDownload'
|
20
21
|
options = { :git => 'example.com' }
|
21
|
-
downloader = Pod::
|
22
|
+
downloader = Pod::Downloader.for_target(target_path, options)
|
22
23
|
downloader.cache_root = '~/Library/Caches/APPNAME'
|
23
24
|
downloader.max_cache_size = 500
|
24
25
|
downloader.download
|
@@ -30,7 +31,7 @@ The downloader class supports the following option keys:
|
|
30
31
|
- git: commit, tag, branch, submodules
|
31
32
|
- hg: revision
|
32
33
|
- bzr: revision, tag
|
33
|
-
- svn: revision, tag, folder
|
34
|
+
- svn: revision, tag, folder, externals
|
34
35
|
- http: type
|
35
36
|
|
36
37
|
The downloader also provides hooks which allow to customize its output or the way in which the commands are executed
|
data/lib/cocoapods-downloader.rb
CHANGED
@@ -21,6 +21,9 @@ module Pod
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
+
# @group Private Helpers
|
25
|
+
#-----------------------------------------------------------------------#
|
26
|
+
|
24
27
|
executable :bzr
|
25
28
|
|
26
29
|
def download!
|
@@ -34,18 +37,26 @@ module Pod
|
|
34
37
|
end
|
35
38
|
|
36
39
|
def download_head!
|
37
|
-
bzr! %|branch "#{url}" #{dir_opts}
|
40
|
+
bzr! %|branch "#{url}" #{dir_opts} #{@target_path.shellescape}|
|
38
41
|
end
|
39
42
|
|
40
43
|
def download_revision!(rev)
|
41
|
-
bzr! %|branch "#{url}" #{dir_opts} -r '#{rev}'
|
44
|
+
bzr! %|branch "#{url}" #{dir_opts} -r '#{rev}' #{@target_path.shellescape}|
|
42
45
|
end
|
43
46
|
|
47
|
+
# @return [String] The command line flags to use according to whether the
|
48
|
+
# target path exits.
|
49
|
+
#
|
44
50
|
def dir_opts
|
45
|
-
|
46
|
-
|
51
|
+
if @target_path.exist?
|
52
|
+
'--use-existing-dir'
|
53
|
+
else
|
54
|
+
''
|
55
|
+
end
|
47
56
|
end
|
48
57
|
|
58
|
+
#-----------------------------------------------------------------------#
|
59
|
+
|
49
60
|
end
|
50
61
|
end
|
51
62
|
end
|
@@ -20,7 +20,7 @@ module Pod
|
|
20
20
|
|
21
21
|
def download!
|
22
22
|
@filename = filename_with_type(type)
|
23
|
-
@download_path = target_path + @filename
|
23
|
+
@download_path = (target_path + @filename)
|
24
24
|
download_file(@download_path)
|
25
25
|
extract_with_type(@download_path, type)
|
26
26
|
end
|
@@ -84,29 +84,31 @@ module Pod
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def download_file(full_filename)
|
87
|
-
curl!
|
87
|
+
curl! %|-L -o #{full_filename.shellescape} #{url} --create-dirs|
|
88
88
|
end
|
89
89
|
|
90
90
|
def extract_with_type(full_filename, type=:zip)
|
91
|
+
unpack_from = full_filename.shellescape
|
92
|
+
unpack_to = @target_path.shellescape
|
91
93
|
case type
|
92
94
|
when :zip
|
93
|
-
unzip!
|
95
|
+
unzip! %|#{unpack_from} -d #{unpack_to}|
|
94
96
|
when :tgz
|
95
|
-
tar!
|
97
|
+
tar! %|xfz #{unpack_from} -C #{unpack_to}|
|
96
98
|
when :tar
|
97
|
-
tar!
|
99
|
+
tar! %|xf #{unpack_from} -C #{unpack_to}|
|
98
100
|
when :tbz
|
99
|
-
tar!
|
101
|
+
tar! %|xfj #{unpack_from} -C #{unpack_to}|
|
100
102
|
when :txz
|
101
|
-
tar!
|
103
|
+
tar! %|xf #{unpack_from} -C #{unpack_to}|
|
102
104
|
else
|
103
105
|
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
|
104
106
|
end
|
105
107
|
|
106
108
|
# If the archive is a tarball and it only contained a folder, move its contents to the target (#727)
|
107
109
|
if should_flatten?
|
108
|
-
contents = target_path.children
|
109
|
-
contents.delete(
|
110
|
+
contents = @target_path.children
|
111
|
+
contents.delete(target_path + @filename)
|
110
112
|
entry = contents.first
|
111
113
|
if contents.count == 1 && entry.directory?
|
112
114
|
FileUtils.move(entry.children, target_path)
|
@@ -32,11 +32,11 @@ module Pod
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def download_head!
|
35
|
-
hg! %|clone
|
35
|
+
hg! %|clone #{url} #{@target_path.shellescape}|
|
36
36
|
end
|
37
37
|
|
38
38
|
def download_revision!
|
39
|
-
hg! %|clone "#{url}" --rev '#{options[:revision]}'
|
39
|
+
hg! %|clone "#{url}" --rev '#{options[:revision]}' #{@target_path.shellescape}|
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
@@ -3,7 +3,7 @@ module Pod
|
|
3
3
|
class Subversion < Base
|
4
4
|
|
5
5
|
def self.options
|
6
|
-
[:revision, :tag, :folder]
|
6
|
+
[:revision, :tag, :folder, :externals]
|
7
7
|
end
|
8
8
|
|
9
9
|
def options_specific?
|
@@ -23,12 +23,12 @@ module Pod
|
|
23
23
|
executable :svn
|
24
24
|
|
25
25
|
def download!
|
26
|
-
output = svn!(%|#{export_subcommand} "#{reference_url}"
|
26
|
+
output = svn!(%|#{export_subcommand} "#{reference_url}" #{@target_path.shellescape}|)
|
27
27
|
store_exported_revision(output)
|
28
28
|
end
|
29
29
|
|
30
30
|
def download_head!
|
31
|
-
output = svn!(%|#{export_subcommand} "#{trunk_url}"
|
31
|
+
output = svn!(%|#{export_subcommand} "#{trunk_url}" #{@target_path.shellescape}|)
|
32
32
|
store_exported_revision(output)
|
33
33
|
end
|
34
34
|
|
@@ -39,6 +39,8 @@ module Pod
|
|
39
39
|
|
40
40
|
def export_subcommand
|
41
41
|
result = 'export --non-interactive --trust-server-cert --force'
|
42
|
+
result << ' --ignore-externals' if options[:externals] == false
|
43
|
+
result
|
42
44
|
end
|
43
45
|
|
44
46
|
def reference_url
|
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: 0.4.0
|
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:
|
12
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|
@@ -19,6 +19,9 @@ executables: []
|
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
|
+
- LICENSE
|
23
|
+
- README.markdown
|
24
|
+
- lib/cocoapods-downloader.rb
|
22
25
|
- lib/cocoapods-downloader/api.rb
|
23
26
|
- lib/cocoapods-downloader/api_exposable.rb
|
24
27
|
- lib/cocoapods-downloader/base.rb
|
@@ -28,9 +31,6 @@ files:
|
|
28
31
|
- lib/cocoapods-downloader/http.rb
|
29
32
|
- lib/cocoapods-downloader/mercurial.rb
|
30
33
|
- lib/cocoapods-downloader/subversion.rb
|
31
|
-
- lib/cocoapods-downloader.rb
|
32
|
-
- README.markdown
|
33
|
-
- LICENSE
|
34
34
|
homepage: https://github.com/CocoaPods/Downloader
|
35
35
|
licenses:
|
36
36
|
- MIT
|
@@ -41,17 +41,17 @@ require_paths:
|
|
41
41
|
- lib
|
42
42
|
required_ruby_version: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- -
|
49
|
+
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.2.2
|
55
55
|
signing_key:
|
56
56
|
specification_version: 3
|
57
57
|
summary: A small library for downloading files from remotes in a folder.
|