cocoapods 0.6.0.rc4 → 0.6.0.rc5

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.
@@ -1,5 +1,5 @@
1
1
  module Pod
2
- VERSION = '0.6.0.rc4'
2
+ VERSION = '0.6.0.rc5'
3
3
 
4
4
  class PlainInformative < StandardError
5
5
  end
@@ -65,7 +65,9 @@ module Pod
65
65
 
66
66
  def self.run(*argv)
67
67
  sub_command = parse(*argv)
68
- Setup.new(ARGV.new).run_if_needed
68
+ unless ENV['SKIP_SETUP']
69
+ Setup.new(ARGV.new).run_if_needed
70
+ end
69
71
  sub_command.run
70
72
 
71
73
  rescue Interrupt
@@ -11,15 +11,16 @@ module Pod
11
11
  Creates a PodSpec, in the current working dir, called `NAME.podspec'.
12
12
  If a GitHub url is passed the spec is prepopulated.
13
13
 
14
- $ pod spec lint [ NAME.podspec | REPO ]
14
+ $ pod spec lint [ NAME.podspec | DIRECTORY ]
15
15
 
16
- Validates `NAME.podspec'. In case `NAME.podspec' is omitted, it defaults
17
- to `*.podspec' in the current working dir. If the name of a repo is
18
- provided it validates all its specs.}
16
+ Validates `NAME.podspec'. If a directory is provided it performs a quick
17
+ validation on all the podspec files found, including subfolders. In case
18
+ the argument is omitted, it defaults to the current working dir.
19
+ }
19
20
  end
20
21
 
21
22
  def self.options
22
- [ ["--quick", "Lint skips checks that would require to donwload and build the spec"],
23
+ [ ["--quick", "Lint skips checks that would require to download and build the spec"],
23
24
  ["--only-errors", "Lint validates even if warnings are present"],
24
25
  ["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super)
25
26
  end
@@ -74,10 +75,10 @@ module Pod
74
75
  invalid_count = lint_podspecs
75
76
  count = specs_to_lint.count
76
77
  if invalid_count == 0
77
- lint_passed_message = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation" : "All the #{count} specs passed validation"
78
+ lint_passed_message = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation." : "All the specs passed validation."
78
79
  puts lint_passed_message.green << "\n\n" unless config.silent?
79
80
  else
80
- raise Informative, count == 1 ? "The spec did not pass validation" : "#{invalid_count} out of #{count} specs failed validation"
81
+ raise Informative, count == 1 ? "The spec did not pass validation." : "#{invalid_count} out of #{count} specs failed validation."
81
82
  end
82
83
  end
83
84
 
@@ -87,12 +88,12 @@ module Pod
87
88
  invalid_count = 0
88
89
  specs_to_lint.each do |spec|
89
90
  # Show immediatly which pod is being processed.
90
- print " -> #{spec}\r" unless config.silent? || is_repo?
91
+ print " -> #{spec}\r" unless config.silent? || @multiple_files
91
92
  $stdout.flush
92
93
 
93
94
  linter = Linter.new(spec)
94
95
  linter.lenient = @only_errors
95
- linter.quick = @quick || is_repo?
96
+ linter.quick = @quick || @multiple_files
96
97
  linter.no_clean = @no_clean
97
98
  invalid_count += 1 unless linter.lint
98
99
 
@@ -104,7 +105,7 @@ module Pod
104
105
 
105
106
  puts unless config.silent? || should_skip?(linter)
106
107
  end
107
- puts "Analyzed #{specs_to_lint.count} specs in #{podspecs_to_lint.count} podspecs files.\n\n" if is_repo? && !config.silent?
108
+ puts "Analyzed #{specs_to_lint.count} specs in #{podspecs_to_lint.count} podspecs files.\n\n" if @multiple_files && !config.silent?
108
109
  invalid_count
109
110
  end
110
111
 
@@ -119,7 +120,7 @@ module Pod
119
120
  end
120
121
 
121
122
  def should_skip?(linter)
122
- is_repo? && linter.errors.empty? && linter.warnings.empty? && linter.notes.empty?
123
+ @multiple_files && linter.errors.empty? && linter.warnings.empty? && linter.notes.empty?
123
124
  end
124
125
 
125
126
  def print_messages(spec, type, messages)
@@ -129,14 +130,14 @@ module Pod
129
130
 
130
131
  def podspecs_to_lint
131
132
  @podspecs_to_lint ||= begin
132
- if (is_repo?)
133
- files = (config.repos_dir + @repo_or_podspec).glob('**/*.podspec')
134
- elsif @repo_or_podspec
135
- files = [Pathname.new(@repo_or_podspec)]
136
- raise Informative, "Unable to find a spec named #{@repo_or_podspec}" unless files[0].exist? && @repo_or_podspec.include?('.podspec')
133
+ path = Pathname.new(@repo_or_podspec || '.')
134
+ if path.directory?
135
+ files = path.glob('**/*.podspec')
136
+ raise Informative, "No specs found in the current directory." if files.empty?
137
+ @multiple_files = true
137
138
  else
138
- files = Pathname.pwd.glob('*.podspec')
139
- raise Informative, "No specs found in the current directory" if files.empty?
139
+ files = [path]
140
+ raise Informative, "Unable to find a spec named `#{@repo_or_podspec}'." unless files[0].exist? && @repo_or_podspec.include?('.podspec')
140
141
  end
141
142
  files
142
143
  end
@@ -152,10 +153,6 @@ module Pod
152
153
  end
153
154
  end
154
155
 
155
- def is_repo?
156
- @is_repo ||= @repo_or_podspec && (config.repos_dir + @repo_or_podspec).exist? && !@repo_or_podspec.include?('/')
157
- end
158
-
159
156
  # Linter class
160
157
  #
161
158
  class Linter
@@ -311,7 +308,7 @@ module Pod
311
308
  # Some values are multiplaform
312
309
  patterns = patterns.is_a?(Hash) ? patterns.values.flatten(1) : patterns
313
310
  patterns.each do |pattern|
314
- # Skip Filelist that would otherwise be resolved from the working directory resulting
311
+ # Skip FileList that would otherwise be resolved from the working directory resulting
315
312
  # in a potentially very expensi operation
316
313
  next if pattern.is_a?(FileList)
317
314
  invalid = pattern.is_a?(Array) ? pattern.any? { |path| path.start_with?('/') } : pattern.start_with?('/')
@@ -338,7 +335,7 @@ module Pod
338
335
  messages << "The description should end with a dot" if @spec.description !~ /.*\./ && @spec.description != @spec.summary
339
336
  messages << "Git sources should specify either a tag or a commit" if source[:git] && !source[:commit] && !source[:tag]
340
337
  messages << "Github repositories should end in `.git'" if github_source? && source[:git] !~ /.*\.git/
341
- # messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
338
+ messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
342
339
  messages << "Comments must be deleted" if text =~ /^\w*#\n\w*#/ # allow a single line comment as it is generally used in subspecs
343
340
  messages
344
341
  end
@@ -71,7 +71,9 @@ module Pod
71
71
  end
72
72
 
73
73
  def already_installed?
74
- Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.#{name.gsub(/ /,'-')}.docset")).exist?
74
+ index = spec_appledoc_options.index('--company-id')
75
+ company_id = index ? spec_appledoc_options[index + 1] : docs_id
76
+ Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/#{company_id}.#{name.gsub(/ /,'-')}.docset")).exist?
75
77
  end
76
78
 
77
79
  def generate(install = false)
@@ -450,10 +450,7 @@ module Pod
450
450
  if pattern.directory? && options[:glob]
451
451
  pattern += options[:glob]
452
452
  end
453
-
454
- pattern.glob.map do |file|
455
- file
456
- end
453
+ pattern.glob
457
454
  end.flatten
458
455
  end
459
456
  end
@@ -33,12 +33,6 @@ module Pod
33
33
  # Platform.new(:ios)
34
34
  # Platform.new(:ios, '4.3')
35
35
  #
36
- # @overload initialize(name, opts)
37
- # @deprecated Remove after adding a warning to {Podfile} class.
38
- # @param [Symbol] name The name of platform.
39
- # @param [Hash] opts The options to create a platform with.
40
- # @option opts [String, Version] :deployment_target The deployment target.
41
- #
42
36
  # @overload initialize(platform)
43
37
  # @param [Platform] platform Another {Platform}.
44
38
  #
@@ -51,23 +45,9 @@ module Pod
51
45
  if input.is_a? Platform
52
46
  @symbolic_name = input.name
53
47
  @deployment_target = input.deployment_target
54
- @declared_deployment_target = input.declared_deployment_target
55
48
  else
56
49
  @symbolic_name = input
57
-
58
50
  target = target[:deployment_target] if target.is_a?(Hash)
59
- @declared_deployment_target = target
60
-
61
- unless target
62
- case @symbolic_name
63
- when :ios
64
- target = '4.3'
65
- when :osx
66
- target = '10.6'
67
- else
68
- target = ''
69
- end
70
- end
71
51
  @deployment_target = Version.create(target)
72
52
  end
73
53
  end
@@ -82,10 +62,6 @@ module Pod
82
62
  #
83
63
  attr_reader :deployment_target
84
64
 
85
- # @return [Version] The deployment target declared on initialization.
86
- #
87
- attr_reader :declared_deployment_target
88
-
89
65
  # @param [Platform, Symbol] other The other platform to check.
90
66
  #
91
67
  # @note If a symbol is passed the comparison does not take into account
@@ -109,7 +85,11 @@ module Pod
109
85
  #
110
86
  def supports?(other)
111
87
  other = Platform.new(other)
88
+ if other.deployment_target && deployment_target
112
89
  (other.name == name) && (other.deployment_target <= deployment_target)
90
+ else
91
+ other.name == name
92
+ end
113
93
  end
114
94
 
115
95
  # @return [String] A string representation including the deployment target.
@@ -121,7 +101,7 @@ module Pod
121
101
  when :osx
122
102
  s = 'OS X'
123
103
  end
124
- s << " #{declared_deployment_target}" if declared_deployment_target
104
+ s << " #{deployment_target}" if deployment_target
125
105
  s
126
106
  end
127
107
 
@@ -134,7 +114,7 @@ module Pod
134
114
  # @return Whether the platform requires legacy architectures for iOS.
135
115
  #
136
116
  def requires_legacy_ios_archs?
137
- (name == :ios) && (deployment_target < Version.new("4.3"))
117
+ (name == :ios) && deployment_target && (deployment_target < Version.new("4.3"))
138
118
  end
139
119
  end
140
120
  end
@@ -173,19 +173,35 @@ module Pod
173
173
  end
174
174
 
175
175
  # Specifies the platform for which a static library should be build.
176
- #
177
176
  # This can be either `:osx` for Mac OS X applications, or `:ios` for iOS
178
177
  # applications.
179
178
  #
180
- # For iOS applications, you can set the deployment target by passing a :deployment_target
181
- # option, e.g:
179
+ # @param [Symbol] name The name of platform.
180
+ # @param [String, Version] target The optional deployment.
181
+ # If not provided a default value according to the platform name will
182
+ # be assigned.
183
+ #
184
+ # @example
182
185
  #
183
- # platform :ios, :deployment_target => "4.0"
186
+ # platform :ios, "4.0"
187
+ # platform :ios
184
188
  #
185
- # If the deployment target requires it (< 4.3), armv6 will be added to ARCHS.
189
+ # @note If the deployment target requires it (< 4.3), armv6 will be added
190
+ # to ARCHS.
186
191
  #
187
- def platform(platform, options={})
188
- @target_definition.platform = Platform.new(platform, options)
192
+ def platform(name, target = nil)
193
+ # Support for deprecated options parameter
194
+ target = target[:deployment_target] if target.is_a?(Hash)
195
+
196
+ unless target
197
+ case name
198
+ when :ios
199
+ target = '4.3'
200
+ when :osx
201
+ target = '10.6'
202
+ end
203
+ end
204
+ @target_definition.platform = Platform.new(name, target)
189
205
  end
190
206
 
191
207
  # Specifies the Xcode workspace that should contain all the projects.
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.6.0.rc4
4
+ version: 0.6.0.rc5
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -232,7 +232,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  segments:
234
234
  - 0
235
- hash: 3019462591125545831
235
+ hash: -1664248091750403569
236
236
  required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  none: false
238
238
  requirements: