cocoapods 0.37.1 → 0.37.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/lib/cocoapods/command/outdated.rb +2 -0
  4. data/lib/cocoapods/command/repo/lint.rb +2 -0
  5. data/lib/cocoapods/command/repo/push.rb +9 -3
  6. data/lib/cocoapods/command/spec/edit.rb +7 -0
  7. data/lib/cocoapods/config.rb +12 -0
  8. data/lib/cocoapods/downloader/cache.rb +8 -3
  9. data/lib/cocoapods/downloader/request.rb +5 -0
  10. data/lib/cocoapods/executable.rb +9 -1
  11. data/lib/cocoapods/external_sources.rb +13 -0
  12. data/lib/cocoapods/external_sources/abstract_external_source.rb +8 -1
  13. data/lib/cocoapods/gem_version.rb +1 -1
  14. data/lib/cocoapods/generator/copy_resources_script.rb +7 -3
  15. data/lib/cocoapods/generator/header.rb +2 -0
  16. data/lib/cocoapods/generator/info_plist_file.rb +2 -0
  17. data/lib/cocoapods/generator/module_map.rb +5 -3
  18. data/lib/cocoapods/generator/prefix_header.rb +2 -0
  19. data/lib/cocoapods/generator/target_environment_header.rb +1 -4
  20. data/lib/cocoapods/generator/umbrella_header.rb +2 -0
  21. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +3 -1
  22. data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +2 -0
  23. data/lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb +2 -0
  24. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +14 -7
  25. data/lib/cocoapods/hooks/installer_representation.rb +2 -0
  26. data/lib/cocoapods/hooks/library_representation.rb +4 -2
  27. data/lib/cocoapods/hooks/pod_representation.rb +6 -6
  28. data/lib/cocoapods/hooks_manager.rb +2 -0
  29. data/lib/cocoapods/installer.rb +43 -2
  30. data/lib/cocoapods/installer/analyzer.rb +16 -3
  31. data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +3 -1
  32. data/lib/cocoapods/installer/file_references_installer.rb +3 -1
  33. data/lib/cocoapods/installer/hooks_context.rb +9 -0
  34. data/lib/cocoapods/installer/migrator.rb +22 -1
  35. data/lib/cocoapods/installer/pod_source_installer.rb +16 -8
  36. data/lib/cocoapods/installer/pod_source_preparer.rb +2 -0
  37. data/lib/cocoapods/installer/user_project_integrator.rb +4 -2
  38. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +6 -2
  39. data/lib/cocoapods/open_uri.rb +8 -0
  40. data/lib/cocoapods/project.rb +3 -1
  41. data/lib/cocoapods/resolver.rb +10 -10
  42. data/lib/cocoapods/sandbox.rb +4 -0
  43. data/lib/cocoapods/sandbox/file_accessor.rb +3 -1
  44. data/lib/cocoapods/sandbox/headers_store.rb +4 -4
  45. data/lib/cocoapods/sandbox/path_list.rb +25 -6
  46. data/lib/cocoapods/sources_manager.rb +3 -1
  47. data/lib/cocoapods/target.rb +1 -1
  48. data/lib/cocoapods/target/aggregate_target.rb +8 -2
  49. data/lib/cocoapods/user_interface.rb +62 -0
  50. data/lib/cocoapods/validator.rb +6 -2
  51. metadata +34 -33
@@ -12,6 +12,8 @@ module Pod
12
12
  #
13
13
  attr_reader :path
14
14
 
15
+ # Initialize a new instance
16
+ #
15
17
  # @param [Specification] spec the root specification of the Pod.
16
18
  # @param [Pathname] path the folder where the source of the Pod is located.
17
19
  #
@@ -33,14 +33,16 @@ module Pod
33
33
  #
34
34
  attr_reader :installation_root
35
35
 
36
- # @return [Array<Target>] the targets represented in the Podfile.
36
+ # @return [Array<AggregateTarget>] the targets represented in the Podfile.
37
37
  #
38
38
  attr_reader :targets
39
39
 
40
+ # Init a new UserProjectIntegrator
41
+ #
40
42
  # @param [Podfile] podfile @see #podfile
41
43
  # @param [Sandbox] sandbox @see #sandbox
42
44
  # @param [Pathname] installation_root @see #installation_root
43
- # @param [Library] libraries @see #libraries
45
+ # @param [Array<AggregateTarget>] targets @see #targets
44
46
  #
45
47
  # @todo Too many initialization arguments
46
48
  #
@@ -14,11 +14,13 @@ module Pod
14
14
  #
15
15
  EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle].freeze
16
16
 
17
- # @return [Target] the target that should be integrated.
17
+ # @return [AggregateTarget] the target that should be integrated.
18
18
  #
19
19
  attr_reader :target
20
20
 
21
- # @param [Target] target @see #target_definition
21
+ # Init a new TargetIntegrator
22
+ #
23
+ # @param [AggregateTarget] target @see #target
22
24
  #
23
25
  def initialize(target)
24
26
  @target = target
@@ -257,6 +259,8 @@ module Pod
257
259
  # Read the project from the disk to ensure that it is up to date as
258
260
  # other TargetIntegrators might have modified it.
259
261
  #
262
+ # @return [Project]
263
+ #
260
264
  def user_project
261
265
  @user_project ||= Xcodeproj::Project.open(target.user_project_path)
262
266
  end
@@ -16,6 +16,14 @@ module OpenURI
16
16
  # (RFC 2109 4.3.1, RFC 2965 3.3, RFC 2616 15.1.3)
17
17
  # However this is ad hoc. It should be extensible/configurable.
18
18
  #
19
+ # @param [URI::Generic] uri1
20
+ # the origin uri from where the redirect origins
21
+ #
22
+ # @param [URI::Generic] uri2
23
+ # the target uri where to where the redirect points to
24
+ #
25
+ # @return [Bool]
26
+ #
19
27
  def self.redirectable?(uri1, uri2)
20
28
  uri1.scheme.downcase == uri2.scheme.downcase ||
21
29
  (/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
@@ -7,6 +7,8 @@ module Pod
7
7
  # through the installation process.
8
8
  #
9
9
  class Project < Xcodeproj::Project
10
+ # Initialize a new instance
11
+ #
10
12
  # @param [Pathname, String] path @see path
11
13
  # @param [Bool] skip_initialization
12
14
  # Whether the project should be initialized from scratch.
@@ -169,7 +171,7 @@ module Pod
169
171
  # The group for the new file reference.
170
172
  #
171
173
  # @param [Bool] reflect_file_system_structure
172
- # Wether group structure should reflect the file system structure.
174
+ # Whether group structure should reflect the file system structure.
173
175
  # If yes, where needed, intermediate groups are created, similar to
174
176
  # how mkdir -p operates.
175
177
  #
@@ -25,6 +25,8 @@ module Pod
25
25
  #
26
26
  attr_accessor :sources
27
27
 
28
+ # Init a new Resolver
29
+ #
28
30
  # @param [Sandbox] sandbox @see sandbox
29
31
  # @param [Podfile] podfile @see podfile
30
32
  # @param [Array<Dependency>] locked_dependencies @see locked_dependencies
@@ -53,7 +55,11 @@ module Pod
53
55
  dependencies = podfile.target_definition_list.map(&:dependencies).flatten
54
56
  @cached_sets = {}
55
57
  @activated = Molinillo::Resolver.new(self, self).resolve(dependencies, locked_dependencies)
56
- specs_by_target
58
+ specs_by_target.tap do |specs_by_target|
59
+ specs_by_target.values.flatten.each do |spec|
60
+ sandbox.store_head_pod(spec.name) if spec.version.head?
61
+ end
62
+ end
57
63
  rescue Molinillo::ResolverError => e
58
64
  handle_resolver_error(e)
59
65
  end
@@ -64,24 +70,18 @@ module Pod
64
70
  # @note The returned specifications can be subspecs.
65
71
  #
66
72
  def specs_by_target
67
- @specs_by_target ||= begin
68
- specs_by_target = {}
73
+ @specs_by_target ||= {}.tap do |specs_by_target|
69
74
  podfile.target_definition_list.each do |target|
70
- specs = target.dependencies.map(&:name).map do |name|
75
+ specs = target.dependencies.map(&:name).flat_map do |name|
71
76
  node = @activated.vertex_named(name)
72
77
  valid_dependencies_for_target_from_node(target, node) << node
73
78
  end
74
79
 
75
80
  specs_by_target[target] = specs.
76
- flatten.
77
81
  map(&:payload).
78
82
  uniq.
79
- sort_by(&:name).
80
- each do |spec|
81
- sandbox.store_head_pod(spec.name) if spec.version.head?
82
- end
83
+ sort_by(&:name)
83
84
  end
84
- specs_by_target
85
85
  end
86
86
  end
87
87
 
@@ -50,6 +50,8 @@ module Pod
50
50
  #
51
51
  attr_reader :public_headers
52
52
 
53
+ # Initialize a new instance
54
+ #
53
55
  # @param [String, Pathname] root @see root
54
56
  #
55
57
  def initialize(root)
@@ -246,6 +248,8 @@ module Pod
246
248
  # The contents of the specification (String) or the path to a
247
249
  # podspec file (Pathname).
248
250
  #
251
+ # @return [void]
252
+ #
249
253
  # @todo Store all the specifications (including those not originating
250
254
  # from external sources) so users can check them.
251
255
  #
@@ -27,6 +27,8 @@ module Pod
27
27
  #
28
28
  attr_reader :spec_consumer
29
29
 
30
+ # Initialize a new instance
31
+ #
30
32
  # @param [Sandbox::PathList, Pathname] path_list @see path_list
31
33
  # @param [Specification::Consumer] spec_consumer @see spec_consumer
32
34
  #
@@ -168,7 +170,7 @@ module Pod
168
170
  end
169
171
 
170
172
  # @return [Hash{String => Array<Pathname>}] A hash that describes the
171
- # resource bundles of the Pod. The keys reppresent the name of
173
+ # resource bundles of the Pod. The keys represent the name of
172
174
  # the bundle while the values the path of the resources.
173
175
  #
174
176
  def resource_bundles
@@ -56,19 +56,19 @@ module Pod
56
56
 
57
57
  # @!group Adding headers
58
58
 
59
- # Adds a header to the directory.
59
+ # Adds headers to the directory.
60
60
  #
61
- # @param [Pathname] namespace_path
61
+ # @param [Pathname] namespace
62
62
  # the path where the header file should be stored relative to the
63
63
  # headers directory.
64
64
  #
65
- # @param [Pathname] relative_header_path
65
+ # @param [Array<Pathname>] relative_header_paths
66
66
  # the path of the header file relative to the Pods project
67
67
  # (`PODS_ROOT` variable of the xcconfigs).
68
68
  #
69
69
  # @note This method adds the files to the search paths.
70
70
  #
71
- # @return [Pathname]
71
+ # @return [Array<Pathname>]
72
72
  #
73
73
  def add_files(namespace, relative_header_paths, platform)
74
74
  add_search_path(namespace, platform)
@@ -15,6 +15,8 @@ module Pod
15
15
  #
16
16
  attr_accessor :root
17
17
 
18
+ # Initialize a new instance
19
+ #
18
20
  # @param [Pathname] root The root of the PathList.
19
21
  #
20
22
  def initialize(root)
@@ -61,24 +63,41 @@ module Pod
61
63
 
62
64
  # @!group Globbing
63
65
 
64
- # @return [Array<Pathname>] Similar to {glob} but returns the absolute
65
- # paths.
66
+ # Similar to {glob} but returns the absolute paths.
67
+ #
68
+ # @param [String,Array<String>] patterns
69
+ # @see #relative_glob
70
+ #
71
+ # @param [Hash] options
72
+ # @see #relative_glob
73
+ #
74
+ # @return [Array<Pathname>]
66
75
  #
67
76
  def glob(patterns, options = {})
68
77
  relative_glob(patterns, options).map { |p| root + p }
69
78
  end
70
79
 
71
- # @return [Array<Pathname>] The list of relative paths that are case
72
- # insensitively matched by a given pattern. This method emulates
73
- # {Dir#glob} with the {File::FNM_CASEFOLD} option.
80
+ # The list of relative paths that are case insensitively matched by a
81
+ # given pattern. This method emulates {Dir#glob} with the
82
+ # {File::FNM_CASEFOLD} option.
74
83
  #
75
84
  # @param [String,Array<String>] patterns
76
85
  # A single {Dir#glob} like pattern, or a list of patterns.
77
86
  #
78
- # @param [String] dir_pattern
87
+ # @param [Hash] options
88
+ #
89
+ # @option options [String] :dir_pattern
79
90
  # An optional pattern to append to a pattern, if it is the path
80
91
  # to a directory.
81
92
  #
93
+ # @option options [Array<String>] :exclude_patterns
94
+ # Exclude specific paths given by those patterns.
95
+ #
96
+ # @option options [Array<String>] :include_dirs
97
+ # Additional paths to take into account for matching.
98
+ #
99
+ # @return [Array<Pathname>]
100
+ #
82
101
  def relative_glob(patterns, options = {})
83
102
  return [] if patterns.empty?
84
103
 
@@ -195,7 +195,9 @@ module Pod
195
195
  # Updates the local clone of the spec-repo with the given name or of all
196
196
  # the git repos if the name is omitted.
197
197
  #
198
- # @param [String] name
198
+ # @param [String] source_name
199
+ #
200
+ # @param [Bool] show_output
199
201
  #
200
202
  # @return [void]
201
203
  #
@@ -6,7 +6,7 @@ module Pod
6
6
  # This class is used to represent both the targets and their libraries.
7
7
  #
8
8
  class Target
9
- # @return [PBXNativeTarget] the target definition of the Podfile that
9
+ # @return [TargetDefinition] the target definition of the Podfile that
10
10
  # generated this target.
11
11
  #
12
12
  attr_reader :target_definition
@@ -3,6 +3,8 @@ module Pod
3
3
  # of the single Pods. The client targets will then depend on this one.
4
4
  #
5
5
  class AggregateTarget < Target
6
+ # Initialize a new instance
7
+ #
6
8
  # @param [TargetDefinition] target_definition @see target_definition
7
9
  # @param [Sandbox] sandbox @see sandbox
8
10
  #
@@ -51,8 +53,12 @@ module Pod
51
53
  #
52
54
  attr_accessor :user_target_uuids
53
55
 
54
- # @return [Array<PBXNativeTarget>] The list of all the user targets that
55
- # will be integrated by this target.
56
+ # List all user targets that will be integrated by this #target.
57
+ #
58
+ # @param [Xcodeproj::Project] project
59
+ # The project to search for the user targets
60
+ #
61
+ # @return [Array<PBXNativeTarget>]
56
62
  #
57
63
  def user_targets(project = nil)
58
64
  return [] unless user_project_path
@@ -37,6 +37,16 @@ module Pod
37
37
  # @todo Refactor to title (for always visible titles like search)
38
38
  # and sections (titles that represent collapsible sections).
39
39
  #
40
+ # @param [String] title
41
+ # The title to print
42
+ #
43
+ # @param [String] verbose_prefix
44
+ # See #message
45
+ #
46
+ # @param [FixNum] relative_indentation
47
+ # The indentation level relative to the current,
48
+ # when the message is printed.
49
+ #
40
50
  def section(title, verbose_prefix = '', relative_indentation = 0)
41
51
  if config.verbose?
42
52
  title(title, verbose_prefix, relative_indentation)
@@ -74,6 +84,16 @@ module Pod
74
84
 
75
85
  # A title opposed to a section is always visible
76
86
  #
87
+ # @param [String] title
88
+ # The title to print
89
+ #
90
+ # @param [String] verbose_prefix
91
+ # See #message
92
+ #
93
+ # @param [FixNum] relative_indentation
94
+ # The indentation level relative to the current,
95
+ # when the message is printed.
96
+ #
77
97
  def title(title, verbose_prefix = '', relative_indentation = 2)
78
98
  if @treat_titles_as_messages
79
99
  message(title, verbose_prefix)
@@ -102,6 +122,16 @@ module Pod
102
122
  #
103
123
  # @todo Clean interface.
104
124
  #
125
+ # @param [String] message
126
+ # The message to print.
127
+ #
128
+ # @param [String] verbose_prefix
129
+ # See #message
130
+ #
131
+ # @param [FixNum] relative_indentation
132
+ # The indentation level relative to the current,
133
+ # when the message is printed.
134
+ #
105
135
  def message(message, verbose_prefix = '', relative_indentation = 2)
106
136
  message = verbose_prefix + message if config.verbose?
107
137
  puts_indented message if config.verbose?
@@ -117,6 +147,9 @@ module Pod
117
147
  #
118
148
  # Any title printed in the optional block is treated as a message.
119
149
  #
150
+ # @param [String] message
151
+ # The message to print.
152
+ #
120
153
  def info(message)
121
154
  indentation = config.verbose? ? self.indentation_level : 0
122
155
  indented = wrap_string(message, indentation)
@@ -143,6 +176,9 @@ module Pod
143
176
  # The returned path is quoted. If the argument is nil it returns the
144
177
  # empty string.
145
178
  #
179
+ # @param [#to_str] pathname
180
+ # The path to print.
181
+ #
146
182
  def path(pathname)
147
183
  if pathname
148
184
  from_path = config.podfile_path.dirname if config.podfile_path
@@ -156,6 +192,12 @@ module Pod
156
192
 
157
193
  # Prints the textual representation of a given set.
158
194
  #
195
+ # @param [Set] set
196
+ # the set that should be presented.
197
+ #
198
+ # @param [Symbol] mode
199
+ # the presentation mode, either `:normal` or `:name_and_version`.
200
+ #
159
201
  def pod(set, mode = :normal)
160
202
  if mode == :name_and_version
161
203
  puts_indented "#{set.name} #{set.versions.first.version}"
@@ -190,6 +232,15 @@ module Pod
190
232
 
191
233
  # Prints a message with a label.
192
234
  #
235
+ # @param [String] label
236
+ # The label to print.
237
+ #
238
+ # @param [#to_s] value
239
+ # The value to print.
240
+ #
241
+ # @param [FixNum] justification
242
+ # The justification of the label.
243
+ #
193
244
  def labeled(label, value, justification = 12)
194
245
  if value
195
246
  title = "- #{label}:"
@@ -208,6 +259,9 @@ module Pod
208
259
  # Prints a message respecting the current indentation level and
209
260
  # wrapping it to the terminal width if necessary.
210
261
  #
262
+ # @param [String] message
263
+ # The message to print.
264
+ #
211
265
  def puts_indented(message = '')
212
266
  indented = wrap_string(message, self.indentation_level)
213
267
  puts(indented)
@@ -238,12 +292,18 @@ module Pod
238
292
 
239
293
  # prints a message followed by a new line unless config is silent.
240
294
  #
295
+ # @param [String] message
296
+ # The message to print.
297
+ #
241
298
  def puts(message = '')
242
299
  STDOUT.puts(message) unless config.silent?
243
300
  end
244
301
 
245
302
  # prints a message followed by a new line unless config is silent.
246
303
  #
304
+ # @param [String] message
305
+ # The message to print.
306
+ #
247
307
  def print(message)
248
308
  STDOUT.print(message) unless config.silent?
249
309
  end
@@ -259,6 +319,8 @@ module Pod
259
319
  #
260
320
  # @param [String] message The message to print.
261
321
  # @param [Array] actions The actions that the user should take.
322
+ # @param [Bool] verbose_only
323
+ # Restrict the appearance of the warning to verbose mode only
262
324
  #
263
325
  # return [void]
264
326
  #
@@ -16,6 +16,8 @@ module Pod
16
16
  #
17
17
  attr_reader :linter
18
18
 
19
+ # Initialize a new instance
20
+ #
19
21
  # @param [Specification, Pathname, String] spec_or_path
20
22
  # the Specification or the path of the `podspec` file to lint.
21
23
  #
@@ -167,7 +169,8 @@ module Pod
167
169
  result_type != :error && (result_type != :warning || allow_warnings)
168
170
  end
169
171
 
170
- # @return [Symbol]
172
+ # @return [Symbol] The type, which should been used to display the result.
173
+ # One of: `:error`, `:warning`, `:note`.
171
174
  #
172
175
  def result_type
173
176
  types = results.map(&:type).uniq
@@ -177,7 +180,8 @@ module Pod
177
180
  end
178
181
  end
179
182
 
180
- # @return [Symbol]
183
+ # @return [Symbol] The color, which should been used to display the result.
184
+ # One of: `:green`, `:yellow`, `:red`.
181
185
  #
182
186
  def result_color
183
187
  case result_type