cocoapods-downloader 0.8.1 → 0.9.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
  SHA1:
3
- metadata.gz: c5b19edc103afbfa96e6594effa1b279a07cc5a9
4
- data.tar.gz: 71f247553c5e0c1395aa62299aac6a7d59849ddc
3
+ metadata.gz: b242104578fbc99f8c538ae8be3b168a36675dc3
4
+ data.tar.gz: ec05c46011c4a75379e2d6a28ad2abf5981ea89f
5
5
  SHA512:
6
- metadata.gz: c3747760712b1ec112a275b5870050b27690530163e5672ef05f612385d6fc73e681a2a4a9e85fdfe17075903c60cad47b8f209316564e0fa1b0451b590608dd
7
- data.tar.gz: 0c3b7da117c02b3b430d9dfdbc4cd3244fbf573aac6b9ac4ae614b5de467def745c96810180e6e19226c082fd0f8c794c2f8506ee97344b19de5f33b25824e43
6
+ metadata.gz: f06e8796132833ad69e887b86c1b005daf7ee8db83bcdbb9c728080e56b772376beb5fa0036a0dac9f48438dafadbdeda646892486d1432ed05e76b10b43e5a2
7
+ data.tar.gz: 7d9c5932b1a983cc4014bbffe126240851545259301a951b8d23be70d5acb95c464e39b188a067c7a237527e2ac89c3d5947f3098775f352b6895826ce167e92
@@ -8,6 +8,8 @@ module Pod
8
8
  # @return [String] the output of the command.
9
9
  #
10
10
  def execute_command(executable, command, raise_on_failure = false)
11
+ require 'shellwords'
12
+ command = command.map(&:to_s).map(&:shellescape).join(' ')
11
13
  output = `\n#{executable} #{command} 2>&1`
12
14
  check_exit_code!(executable, command, output) if raise_on_failure
13
15
  puts output
@@ -144,12 +144,12 @@ module Pod
144
144
  # @return [void]
145
145
  #
146
146
  def self.executable(name)
147
- define_method(name) do |command|
148
- execute_command(name.to_s, command, false)
147
+ define_method(name) do |*command|
148
+ execute_command(name.to_s, command.flatten, false)
149
149
  end
150
150
 
151
- define_method(name.to_s + '!') do |command|
152
- execute_command(name.to_s, command, true)
151
+ define_method(name.to_s + '!') do |*command|
152
+ execute_command(name.to_s, command.flatten, true)
153
153
  end
154
154
  end
155
155
  end
@@ -36,11 +36,11 @@ module Pod
36
36
  end
37
37
 
38
38
  def download_head!
39
- bzr! %(branch "#{url}" #{dir_opts} #{@target_path.shellescape})
39
+ bzr! 'branch', url, *dir_opts, target_path
40
40
  end
41
41
 
42
42
  def download_revision!(rev)
43
- bzr! %(branch "#{url}" #{dir_opts} -r '#{rev}' #{@target_path.shellescape})
43
+ bzr! 'branch', url, *dir_opts, '-r', rev, @target_path
44
44
  end
45
45
 
46
46
  # @return [String] The command line flags to use according to whether the
@@ -48,9 +48,9 @@ module Pod
48
48
  #
49
49
  def dir_opts
50
50
  if @target_path.exist?
51
- '--use-existing-dir'
51
+ %w(--use-existing-dir)
52
52
  else
53
- ''
53
+ []
54
54
  end
55
55
  end
56
56
 
@@ -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.8.1'
6
+ VERSION = '0.9.0'
7
7
  end
8
8
  end
@@ -62,7 +62,7 @@ module Pod
62
62
  def clone(force_head = false, shallow_clone = true)
63
63
  ui_sub_action('Git download') do
64
64
  begin
65
- git! clone_arguments(force_head, shallow_clone).join(' ')
65
+ git! clone_arguments(force_head, shallow_clone)
66
66
  rescue DownloaderError => e
67
67
  if e.message =~ /^fatal:.*does not support --depth$/im
68
68
  clone(force_head, false)
@@ -86,10 +86,10 @@ module Pod
86
86
  # @return [Array<String>] arguments to pass to `git` to clone the repo.
87
87
  #
88
88
  def clone_arguments(force_head, shallow_clone)
89
- command = ['clone', url.shellescape, target_path.shellescape]
89
+ command = ['clone', url, target_path]
90
90
 
91
91
  if shallow_clone && !options[:commit]
92
- command += ['--single-branch', '--depth 1']
92
+ command += %w(--single-branch --depth 1)
93
93
  end
94
94
 
95
95
  unless force_head
@@ -105,7 +105,7 @@ module Pod
105
105
  #
106
106
  def checkout_commit
107
107
  Dir.chdir(target_path) do
108
- git! "checkout -b activated-commit #{options[:commit]}"
108
+ git! 'checkout', '-b', 'activated-commit', options[:commit]
109
109
  end
110
110
  end
111
111
 
@@ -113,7 +113,7 @@ module Pod
113
113
  #
114
114
  def init_submodules
115
115
  Dir.chdir(target_path) do
116
- git! 'submodule update --init'
116
+ git! %w(submodule update --init)
117
117
  end
118
118
  end
119
119
  end
@@ -62,8 +62,6 @@ module Pod
62
62
  :tbz
63
63
  elsif path =~ /.(txz|tar\.xz)$/
64
64
  :txz
65
- else
66
- nil
67
65
  end
68
66
  end
69
67
 
@@ -85,23 +83,23 @@ module Pod
85
83
  end
86
84
 
87
85
  def download_file(full_filename)
88
- curl! %(-f -L -o #{full_filename.shellescape} "#{url}" --create-dirs)
86
+ curl! '-f', '-L', '-o', full_filename, url, '--create-dirs'
89
87
  end
90
88
 
91
89
  def extract_with_type(full_filename, type = :zip)
92
- unpack_from = full_filename.shellescape
93
- unpack_to = @target_path.shellescape
90
+ unpack_from = full_filename
91
+ unpack_to = @target_path
94
92
  case type
95
93
  when :zip
96
- unzip! %(#{unpack_from} -d #{unpack_to})
94
+ unzip! unpack_from, '-d', unpack_to
97
95
  when :tgz
98
- tar! %(xfz #{unpack_from} -C #{unpack_to})
96
+ tar! 'xfz', unpack_from, '-C', unpack_to
99
97
  when :tar
100
- tar! %(xf #{unpack_from} -C #{unpack_to})
98
+ tar! 'xf', unpack_from, '-C', unpack_to
101
99
  when :tbz
102
- tar! %(xfj #{unpack_from} -C #{unpack_to})
100
+ tar! 'xfj', unpack_from, '-C', unpack_to
103
101
  when :txz
104
- tar! %(xf #{unpack_from} -C #{unpack_to})
102
+ tar! 'xf', unpack_from, '-C', unpack_to
105
103
  else
106
104
  raise UnsupportedFileTypeError, "Unsupported file type: #{type}"
107
105
  end
@@ -35,19 +35,19 @@ module Pod
35
35
  end
36
36
 
37
37
  def download_head!
38
- hg! %(clone #{url} #{@target_path.shellescape})
38
+ hg! 'clone', url, @target_path
39
39
  end
40
40
 
41
41
  def download_revision!
42
- hg! %(clone "#{url}" --rev '#{options[:revision]}' #{@target_path.shellescape})
42
+ hg! 'clone', url, '--rev', options[:revision], @target_path
43
43
  end
44
44
 
45
45
  def download_tag!
46
- hg! %(clone "#{url}" --updaterev '#{options[:tag]}' #{@target_path.shellescape})
46
+ hg! 'clone', url, '--updaterev', options[:tag], @target_path
47
47
  end
48
48
 
49
49
  def download_branch!
50
- hg! %(clone "#{url}" --updaterev '#{options[:branch]}' #{@target_path.shellescape})
50
+ hg! 'clone', url, '--updaterev', options[:branch], @target_path
51
51
  end
52
52
  end
53
53
  end
@@ -23,12 +23,12 @@ module Pod
23
23
  executable :svn
24
24
 
25
25
  def download!
26
- output = svn!(%(#{subcommand} "#{reference_url}" #{@target_path.shellescape}))
26
+ output = svn!(*subcommand, *reference_url, @target_path)
27
27
  store_exported_revision(output)
28
28
  end
29
29
 
30
30
  def download_head!
31
- output = svn!(%(#{subcommand} "#{trunk_url}" #{@target_path.shellescape}))
31
+ output = svn!(*subcommand, *trunk_url, @target_path)
32
32
  store_exported_revision(output)
33
33
  end
34
34
 
@@ -39,13 +39,13 @@ module Pod
39
39
 
40
40
  def subcommand
41
41
  if options[:checkout]
42
- result = 'checkout'
42
+ result = %w(checkout)
43
43
  else
44
- result = 'export'
44
+ result = %w(export)
45
45
  end
46
46
 
47
- result << ' --non-interactive --trust-server-cert --force'
48
- result << ' --ignore-externals' if options[:externals] == false
47
+ result += %w(--non-interactive --trust-server-cert --force)
48
+ result << '--ignore-externals' if options[:externals] == false
49
49
  result
50
50
  end
51
51
 
@@ -53,7 +53,8 @@ module Pod
53
53
  result = url.dup
54
54
  result << '/' << options[:folder] if options[:folder]
55
55
  result << '/tags/' << options[:tag] if options[:tag]
56
- result << '" -r "' << options[:revision] if options[:revision]
56
+ result = [result]
57
+ result << '-r' << options[:revision] if options[:revision]
57
58
  result
58
59
  end
59
60
 
@@ -61,7 +62,7 @@ module Pod
61
62
  result = url.dup
62
63
  result << '/' << options[:folder] if options[:folder]
63
64
  result << '/trunk'
64
- result
65
+ [result]
65
66
  end
66
67
  end
67
68
  end
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.8.1
4
+ version: 0.9.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: 2014-12-25 00:00:00.000000000 Z
12
+ date: 2015-04-01 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: 2.0.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.0.14
54
+ rubygems_version: 2.4.6
55
55
  signing_key:
56
56
  specification_version: 3
57
57
  summary: A small library for downloading files from remotes in a folder.