cocoapods 0.32.1 → 0.33.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,21 +81,22 @@ module Pod
81
81
  #
82
82
  def create_workspace
83
83
  all_projects = user_project_paths.sort.push(sandbox.project_path).uniq
84
- projpaths = all_projects.map do |path|
85
- path.relative_path_from(workspace_path.dirname).to_s
84
+ file_references = all_projects.map do |path|
85
+ relative_path = path.relative_path_from(workspace_path.dirname).to_s
86
+ Xcodeproj::Workspace::FileReference.new(relative_path, 'group')
86
87
  end
87
88
 
88
89
  if workspace_path.exist?
89
90
  workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
90
- new_projpaths = projpaths - workspace.projpaths
91
- unless new_projpaths.empty?
92
- workspace.projpaths.concat(new_projpaths)
91
+ new_file_references = file_references - workspace.file_references
92
+ unless new_file_references.empty?
93
+ workspace.file_references.concat(new_file_references)
93
94
  workspace.save_as(workspace_path)
94
95
  end
95
96
 
96
97
  else
97
98
  UI.notice "From now on use `#{workspace_path.basename}`."
98
- workspace = Xcodeproj::Workspace.new(*projpaths)
99
+ workspace = Xcodeproj::Workspace.new(*file_references)
99
100
  workspace.save_as(workspace_path)
100
101
  end
101
102
  end
@@ -152,8 +152,13 @@ module Pod
152
152
  sources.each do |source|
153
153
  UI.section "Updating spec repo `#{source.name}`" do
154
154
  Dir.chdir(source.data_provider.repo) do
155
- output = git!("pull --no-rebase --no-commit")
156
- UI.puts output if show_output && !config.verbose?
155
+ begin
156
+ output = git!("pull --ff-only")
157
+ UI.puts output if show_output && !config.verbose?
158
+ rescue Informative => e
159
+ raise Informative, 'An error occurred while performing ' \
160
+ "`git pull` on repo `#{source.name}`.\n" + e.message
161
+ end
157
162
  end
158
163
  check_version_information(source.data_provider.repo)
159
164
  end
@@ -201,13 +206,16 @@ module Pod
201
206
  min, max = versions['min'], versions['max']
202
207
  version_msg = ( min == max ) ? min : "#{min} - #{max}"
203
208
  raise Informative, "The `#{dir.basename}` repo requires " \
204
- "CocoaPods #{version_msg}\n".red +
209
+ "CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red +
205
210
  "Update CocoaPods, or checkout the appropriate tag in the repo."
206
211
  end
207
212
 
213
+ needs_sudo = path_writable?(__FILE__)
214
+
208
215
  if config.new_version_message? && cocoapods_update?(versions)
209
216
  UI.puts "\nCocoaPods #{versions['last']} is available.\n" \
210
- "To update use: [sudo] gem install cocoapods\n".green
217
+ "To update use: #{needs_sudo ? 'sudo ' : ''}" \
218
+ 'gem install cocoapods\n'.green
211
219
  end
212
220
  end
213
221
 
@@ -259,7 +267,16 @@ module Pod
259
267
  def version_information(dir)
260
268
  require 'yaml'
261
269
  yaml_file = dir + 'CocoaPods-version.yml'
262
- yaml_file.exist? ? YAML.load_file(yaml_file) : {}
270
+ return {} unless yaml_file.exist?
271
+ begin
272
+ yaml = Pathname.new(yaml_file).read
273
+ YAMLHelper.load(yaml)
274
+ rescue Informative => e
275
+ raise Informative, "There was an error reading '#{yaml_file}'.\n" \
276
+ 'Please consult http://blog.cocoapods.org/' \
277
+ 'Repairing-Our-Broken-Specs-Repository/ ' \
278
+ 'for more information.'
279
+ end
263
280
  end
264
281
 
265
282
  public
@@ -284,6 +301,12 @@ module Pod
284
301
 
285
302
  #-----------------------------------------------------------------------#
286
303
 
304
+ private
305
+
306
+ def path_writable?(path)
307
+ Pathname(path).dirname.writable?
308
+ end
309
+
287
310
  end
288
311
  end
289
312
  end
@@ -184,10 +184,10 @@ module Pod
184
184
 
185
185
  # Prints a message with a label.
186
186
  #
187
- def labeled(label, value)
187
+ def labeled(label, value, justification = 16)
188
188
  if value
189
189
  ''.tap do |t|
190
- t << " - #{label}:".ljust(16)
190
+ t << " - #{label}:".ljust(justification)
191
191
  if value.is_a?(Array)
192
192
  separator = "\n - "
193
193
  puts_indented t << separator << value.join(separator)
@@ -45,7 +45,7 @@ Repositories : #{repo_information.join("\n ")}
45
45
  #{'[!] Oh no, an error occurred.'.red}
46
46
  #{error_from_podfile(exception)}
47
47
  #{'Search for existing github issues similar to yours:'.yellow}
48
- #{"https://github.com/CocoaPods/CocoaPods/search?q=#{CGI.escape(exception.message)}&type=Issues"}
48
+ #{issues_url(exception)}
49
49
 
50
50
  #{'If none exists, create a ticket, with the template displayed above, on:'.yellow}
51
51
  https://github.com/CocoaPods/CocoaPods/issues/new
@@ -57,6 +57,10 @@ EOS
57
57
 
58
58
  private
59
59
 
60
+ def pathless_exception_message(message)
61
+ message.gsub(/- \(.*\):/, '-')
62
+ end
63
+
60
64
  def markdown_podfile
61
65
  return '' unless Config.instance.podfile_path && Config.instance.podfile_path.exist?
62
66
  <<-EOS
@@ -75,6 +79,16 @@ EOS
75
79
  end
76
80
  end
77
81
 
82
+ def remove_color(string)
83
+ string.gsub(/\e\[(\d+)m/, '')
84
+ end
85
+
86
+ def issues_url(exception)
87
+ message = remove_color(pathless_exception_message(exception.message))
88
+ 'https://github.com/CocoaPods/CocoaPods/search?q=' \
89
+ "#{CGI.escape(message)}&type=Issues"
90
+ end
91
+
78
92
  def host_information
79
93
  product, version, build =`sw_vers`.strip.split("\n").map { |line| line.split(":").last.strip }
80
94
  "#{product} #{version} (#{build})"
@@ -198,6 +198,9 @@ module Pod
198
198
  def perform_extensive_analysis(spec)
199
199
  validate_homepage(spec)
200
200
  validate_screenshots(spec)
201
+ validate_social_media_url(spec)
202
+ validate_documentation_url(spec)
203
+ validate_docset_url(spec)
201
204
 
202
205
  spec.available_platforms.each do |platform|
203
206
  UI.message "\n\n#{spec} - Analyzing on #{platform} platform.".green.reversed
@@ -223,38 +226,14 @@ module Pod
223
226
  attr_accessor :consumer
224
227
  attr_accessor :subspec_name
225
228
 
226
- MAX_HTTP_REDIRECTS = 3
227
-
228
229
  # Performs validation of a URL
229
230
  #
230
231
  def validate_url(url)
231
- require 'rest'
232
-
233
- begin
234
- redirects = 0
235
- resp = nil
236
- loop do
237
- resp = ::REST.head(url)
232
+ resp = Pod::HTTP::validate_url(url)
238
233
 
239
- if resp.status_code >= 400
240
- resp = ::REST.get(url)
241
- end
242
-
243
- if [301, 302, 303, 307, 308].include? resp.status_code
244
- url = resp.headers['location'].first
245
- redirects += 1
246
- else
247
- break
248
- end
249
-
250
- break unless redirects < MAX_HTTP_REDIRECTS
251
- end
252
- rescue
234
+ if !resp
253
235
  warning "There was a problem validating the URL #{url}."
254
- resp = nil
255
- end
256
-
257
- if resp && !resp.success?
236
+ elsif !resp.success?
258
237
  warning "The URL (#{url}) is not reachable."
259
238
  end
260
239
 
@@ -280,6 +259,24 @@ module Pod
280
259
  end
281
260
  end
282
261
 
262
+ # Performs validations related to the `social_media_url` attribute.
263
+ #
264
+ def validate_social_media_url(spec)
265
+ validate_url(spec.social_media_url) if spec.social_media_url
266
+ end
267
+
268
+ # Performs validations related to the `documentation_url` attribute.
269
+ #
270
+ def validate_documentation_url(spec)
271
+ validate_url(spec.documentation_url) if spec.documentation_url
272
+ end
273
+
274
+ # Performs validations related to the `docset_url` attribute.
275
+ #
276
+ def validate_docset_url(spec)
277
+ validate_url(spec.docset_url) if spec.docset_url
278
+ end
279
+
283
280
  def setup_validation_environment
284
281
  validation_dir.rmtree if validation_dir.exist?
285
282
  validation_dir.mkpath
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.1
4
+ version: 0.33.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-04-15 00:00:00.000000000 Z
12
+ date: 2014-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cocoapods-core
@@ -17,58 +17,58 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.32.1
20
+ version: 0.33.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.32.1
27
+ version: 0.33.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: claide
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.5.0
34
+ version: 0.6.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.5.0
41
+ version: 0.6.0
42
42
  - !ruby/object:Gem::Dependency
43
- name: cocoapods-downloader
43
+ name: xcodeproj
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.5.0
48
+ version: 0.17.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 0.5.0
55
+ version: 0.17.0
56
56
  - !ruby/object:Gem::Dependency
57
- name: xcodeproj
57
+ name: cocoapods-downloader
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 0.16.1
62
+ version: 0.6.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.16.1
69
+ version: 0.6.0
70
70
  - !ruby/object:Gem::Dependency
71
- name: cocoapods-try
71
+ name: cocoapods-plugins
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
@@ -81,6 +81,34 @@ dependencies:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: 0.2.0
84
+ - !ruby/object:Gem::Dependency
85
+ name: cocoapods-try
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.3.0
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 0.3.0
98
+ - !ruby/object:Gem::Dependency
99
+ name: cocoapods-trunk
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 0.1.0
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 0.1.0
84
112
  - !ruby/object:Gem::Dependency
85
113
  name: colored
86
114
  requirement: !ruby/object:Gem::Requirement
@@ -216,6 +244,7 @@ files:
216
244
  - lib/cocoapods/command/project.rb
217
245
  - lib/cocoapods/command/push.rb
218
246
  - lib/cocoapods/command/repo.rb
247
+ - lib/cocoapods/command/repo/push.rb
219
248
  - lib/cocoapods/command/search.rb
220
249
  - lib/cocoapods/command/setup.rb
221
250
  - lib/cocoapods/command/spec.rb
@@ -272,9 +301,49 @@ homepage: https://github.com/CocoaPods/CocoaPods
272
301
  licenses:
273
302
  - MIT
274
303
  metadata: {}
275
- post_install_message: "\nCHANGELOG:\n\n## 0.32.1\n\n##### Bug Fixes\n\n* Fixed the
276
- Podfile `default_subspec` attribute in nested subspecs. \n [Fabio Pelosin][irrationalfab]\n
277
- \ [#2050](https://github.com/CocoaPods/CocoaPods/issues/2050)\n\n\n"
304
+ post_install_message: "\nCHANGELOG:\n\n## 0.33.0\n\n##### Breaking\n\n* The deprecated
305
+ `pre_install` and the `pod_install` hooks of the specification\n class have been
306
+ removed. \n [Fabio Pelosin][irrationalfab]\n [#2151](https://github.com/CocoaPods/CocoaPods/issues/2151)\n
307
+ \ [#2153](https://github.com/CocoaPods/CocoaPods/pull/2153)\n\n##### Enhancements\n\n*
308
+ Added the `cocoapods-trunk` plugin which introduces the `trunk` subcommand. \n
309
+ \ [Fabio Pelosin][irrationalfab]\n [#2151](https://github.com/CocoaPods/CocoaPods/issues/2151)\n
310
+ \ [#2153](https://github.com/CocoaPods/CocoaPods/pull/2153)\n\n* The `pod push`
311
+ sub-command has been moved to the `pod repo push` sub-command.\n Moreover pushing
312
+ to the master repo from it has been disabled. \n [Fabio Pelosin][irrationalfab]\n
313
+ \ [#2151](https://github.com/CocoaPods/CocoaPods/issues/2151)\n [#2153](https://github.com/CocoaPods/CocoaPods/pull/2153)\n\n*
314
+ Overhauled command line interface. Add support for auto-completion script\n (d).
315
+ If auto-completion is enabled for your shell you can configure it for\n CocoaPods
316
+ with the following command:\n\n rm -f /usr/local/share/zsh/site-functions/_pod\n
317
+ \ dpod --completion-script > /usr/local/share/zsh/site-functions/_pod\n exec
318
+ zsh\n\n Currently only the Z shell is supported. \n [Fabio Pelosin][irrationalfab]\n
319
+ \ [CLAide#25](https://github.com/CocoaPods/CLAide/issues/25)\n [CLAide#20](https://github.com/CocoaPods/CLAide/issues/20)\n
320
+ \ [CLAide#19](https://github.com/CocoaPods/CLAide/issues/19)\n [CLAide#17](https://github.com/CocoaPods/CLAide/issues/17)\n
321
+ \ [CLAide#12](https://github.com/CocoaPods/CLAide/issues/12)\n\n* The `--version`
322
+ flag is now only supported for the root `pod` command. If\n used in conjunction
323
+ with the `--verbose` flag the version of the detected\n plugins will be printed
324
+ as well. \n [Fabio Pelosin][irrationalfab]\n [CLAide#13](https://github.com/CocoaPods/CLAide/issues/13)\n
325
+ \ [CLAide#14](https://github.com/CocoaPods/CLAide/issues/14)\n\n* The extremely
326
+ meta `cocoaPods-plugins` is now installed by default providing\n information about
327
+ the available and the installed plug-ins. \n [David Grandinetti](https://github.com/dbgrandi)\n
328
+ \ [Olivier Halligon](https://github.com/AliSoftware)\n [Fabio Pelosin][irrationalfab]\n
329
+ \ [#2092](https://github.com/CocoaPods/CocoaPods/issues/2092)\n\n* Validate the
330
+ reachability of `social_media_url`, `documentation_url` and\n `docset_url` in podspecs
331
+ we while linting a specification. \n [Kyle Fuller](https://github.com/kylef)\n
332
+ \ [#2025](https://github.com/CocoaPods/CocoaPods/issues/2025)\n\n* Print the current
333
+ version when the repo/lockfile requires a higher version. \n [Samuel E. Giddins](https://github.com/segiddins)\n
334
+ \ [#2049](https://github.com/CocoaPods/CocoaPods/issues/2049)\n\n* Show `help` when
335
+ running the `pod` command instead of defaulting to `pod\n install`. \n [Kyle
336
+ Fuller](https://github.com/kylef)\n [#1771](https://github.com/CocoaPods/CocoaPods/issues/1771)\n\n#####
337
+ Bug Fixes\n\n* Show the actual executable when external commands fail. \n [Boris
338
+ Bügling][neonichu]\n [#2102](https://github.com/CocoaPods/CocoaPods/issues/2102)\n\n*
339
+ Fixed support for file references in the workspace generated by CocoaPods. \n [Kyle
340
+ Fuller][kylef]\n [Fabio Pelosin][irrationalfab]\n [Xcodeproj#105](https://github.com/CocoaPods/Xcodeproj/pull/150)\n\n*
341
+ Show a helpful error message when reading version information with merge\n conflict.
342
+ \ \n [Samuel E. Giddins][segiddins]\n [#1853](https://github.com/CocoaPods/CocoaPods/issues/1853)\n\n*
343
+ Show deprecated specs when invoking `pod outdated`. \n [Samuel E. Giddins](https://github.com/segiddins)\n
344
+ \ [#2003](https://github.com/CocoaPods/CocoaPods/issues/2003)\n\n* Fixes an issue
345
+ where `pod repo update` may start an un-committed merge. \n [Kyle Fuller][kylef]\n
346
+ \ [#2024](https://github.com/CocoaPods/CocoaPods/issues/2024)\n\n"
278
347
  rdoc_options: []
279
348
  require_paths:
280
349
  - lib