cocoapods 0.19.1 → 0.20.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7c98eebfe9dd50b6b4da71a5ac302de8192cfd6
4
- data.tar.gz: 2e03f615d405ef0a985a8583c49a8391f9879c15
3
+ metadata.gz: 8e3045ee47d6e2cd362547dc9d63ca8b0eafdd8b
4
+ data.tar.gz: 323a2df715f634f7b5fe0d5febb3d02f475e132a
5
5
  SHA512:
6
- metadata.gz: cf0a9ac7b7cff55600dcbaf3b02945e15eea8948f11d688e0bd3a6a9e7ead00d7165d0fd641e1a00e5e96da60b05b8e58c4b289dce05eb59ffb6b564471946cf
7
- data.tar.gz: 48a8203cc6981508df7e8e717621a6b9b4c79b576fcadb0865f388f074a38c2d54af094c49c37f4fe21ceb1b654e16c9087e5c816c7a3a146a22c2441d797d40
6
+ metadata.gz: c5cf5bf33c28c079571ea78cabc844bef8b08a1f667bc5b79ea256c54264740a0481b62b3739f08818b3ac2a29fb78c4603b84ed6f08269c57217e48aee5c5ac
7
+ data.tar.gz: 2c6b18713fbf58d90fef4290ccc550bd946cc0e5dcd404bb746ab49f3c3fe8d98790c637160ab0242408f25cab813479394ed7d98f539bd7960d25bdbbb6f578
@@ -4,6 +4,81 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  ## Master
6
6
 
7
+ ## 0.20.0
8
+ [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.19.0...0.20.0)
9
+ • [cocoapods-core](https://github.com/CocoaPods/Core/compare/0.19.0...0.20.0)
10
+ • [cocoapods-downloader](https://github.com/CocoaPods/CLAide/compare/0.1.0...0.1.1)
11
+ • [Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.5.5...0.6.0)
12
+ • [CLAide](https://github.com/CocoaPods/CLAide/compare/0.2.0...0.3.0)
13
+
14
+ ###### Enhancements
15
+
16
+ * Introduces an experimental sandbox feature.
17
+ [#939](https://github.com/CocoaPods/CocoaPods/issues/939)
18
+
19
+ Let’s face it, even though we have a great community that spends an amazing
20
+ amount of time on curating the specifications, the internet can be a hostile
21
+ place and the community is growing too large to take a naive approach any
22
+ longer.
23
+
24
+ As such, we have started leveraging OS X’s sandbox facilities to disallow
25
+ unsanctioned operations. This is still very experimental and therefore has to
26
+ be used explicitely, for now, but that does **not** mean we don’t want you to
27
+ start using it and **report issues**.
28
+
29
+ To use the sandbox, simply use the `sandbox-pod` command instead. E.g.:
30
+
31
+ $ sandbox-pod install
32
+
33
+ In case of issues, be sure to check `/var/log/system.log` for ‘deny’ messages.
34
+ For instance, here’s an example where the sandbox denies read access to `/`:
35
+
36
+ May 16 00:23:35 Khaos kernel[0]: Sandbox: ruby(98430) deny file-read-data /
37
+
38
+ **NOTE**: _The above example is actually one that we know of. We’re not sure
39
+ yet which process causes this, but there shouldn’t be a need for any process
40
+ to read data from the root path anyways._
41
+
42
+ **NOTE 2**: _At the moment the sandbox is not compatible with the `:path` option
43
+ when referencing Pods that are not stored within the directory of the Podfile._
44
+
45
+ * The naked `pod` command now defaults to `pod install`.
46
+ [#958](https://github.com/CocoaPods/CocoaPods/issues/958)
47
+
48
+ * CocoaPods will look for the Podfile in the ancestors paths if one is
49
+ not available in the working directory.
50
+ [#940](https://github.com/CocoaPods/CocoaPods/issues/940)
51
+
52
+ * Documentation generation has been removed from CocoaPods as it graduated
53
+ to CocoaDocs. This decision was taken because CocoaDocs is a much better
54
+ solution which doesn't clutter Xcode's docsets while still allowing
55
+ access to the docsets with Xcode and with Dash. Removing this feature
56
+ keeps the installer leaner and easier to develop and paves the way for the
57
+ upcoming sandbox. Private pods can use pre install hook to generate the
58
+ documentation. If there will be enough demand this feature might be
59
+ reintegrated as plugin (see
60
+ [#1037](https://github.com/CocoaPods/CocoaPods/issues/1037)).
61
+
62
+ * Improved performance of the copy resources script and thus build time of
63
+ the integrated targets. Contribution by [@onato](https://github.com/onato)
64
+ [#1050](https://github.com/CocoaPods/CocoaPods/issues/1050).
65
+
66
+ * The changelog for the current version is printed after CocoaPods is
67
+ installed/updated.
68
+ [#853](https://github.com/CocoaPods/CocoaPods/issues/853).
69
+
70
+
71
+ ###### Bug fixes
72
+
73
+ * Inheriting `inhibit_warnings` per pod is now working
74
+ [#1032](https://github.com/CocoaPods/CocoaPods/issues/1032)
75
+ * Fix copy resources script for iOS < 6 and OS X < 10.8 by removing the
76
+ `--reference-external-strings-file`
77
+ flag. [#1030](https://github.com/CocoaPods/CocoaPods/pull/1030)
78
+ * Fixed issues with the `:head` option of the Podfile.
79
+ [#1046](https://github.com/CocoaPods/CocoaPods/issues/1046)
80
+ [#1039](https://github.com/CocoaPods/CocoaPods/issues/1039)
81
+
7
82
  ## 0.19.1
8
83
  [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.19.0...0.19.1)
9
84
  • [cocoapods-core](https://github.com/CocoaPods/Core/compare/0.19.0...0.19.1)
@@ -29,6 +104,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
29
104
  * CocoaPods now defines the `COCOAPODS=1` macro in the Pod and the Client
30
105
  targets. This is useful for libraries which conditionally expose interfaces.
31
106
  [#903](https://github.com/CocoaPods/CocoaPods/issues/903)
107
+ * Added support for the `private_header_files` attribute of the Specification
108
+ DSL.
109
+ [#998](https://github.com/CocoaPods/CocoaPods/issues/998)
32
110
  * CocoaPods now defines the deployment target of the Pods project computed as
33
111
  the minimum deployment target of the Pods libraries.
34
112
  [#556](https://github.com/CocoaPods/CocoaPods/issues/556)
@@ -46,8 +124,8 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
46
124
 
47
125
  ###### Deprecations
48
126
 
49
- * The `:local` flag in Podfile has been renamed to `:path` and has been
50
- deprecated.
127
+ * The `:local` flag in Podfile has been renamed to `:path` and the old syntax
128
+ has been deprecated.
51
129
  [#971](https://github.com/CocoaPods/CocoaPods/issues/971)
52
130
 
53
131
  ###### Bug fixes
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # CocoaPods – an Objective-C library manager
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/cocoapods.png)](http://badge.fury.io/rb/cocoapods)
4
- [![Dependency Status](https://gemnasium.com/CocoaPods/CocoaPods.png)](https://gemnasium.com/CocoaPods/CocoaPods)
5
3
  [![Build Status](https://travis-ci.org/CocoaPods/CocoaPods.png?branch=master)](https://travis-ci.org/CocoaPods/CocoaPods)
4
+ [![Code Climate](https://codeclimate.com/github/CocoaPods/CocoaPods.png)](https://codeclimate.com/github/CocoaPods/CocoaPods)
5
+ [![Dependency Status](https://gemnasium.com/CocoaPods/CocoaPods.png)](https://gemnasium.com/CocoaPods/CocoaPods)
6
+ [![Gem Version](https://badge.fury.io/rb/cocoapods.png)](http://badge.fury.io/rb/cocoapods)
6
7
 
7
8
  CocoaPods manages library dependencies for your Xcode project.
8
9
 
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This bin wrapper runs the `pod` command in a OS X sandbox. The reason for this
4
+ # is to ensure that people can’t use malicious code from pod specifications.
5
+ #
6
+ # It does this by creating a ‘seatbelt’ profile on the fly and executing the
7
+ # given command through `/usr/bin/sandbox-exec`. This profile format is an
8
+ # undocumented format, which uses TinyScheme to implement its DSL.
9
+ #
10
+ # Even though it uses a undocumented format, it’s actually very self-explanatory.
11
+ # Because we use a whitelist approach, `(deny default)`, any action that is
12
+ # denied is logged to `/var/log/system.log`. So tailing that should provide
13
+ # enough information on steps that need to be take to get something to work.
14
+ #
15
+ # For more information see:
16
+ #
17
+ # * https://github.com/CocoaPods/CocoaPods/issues/939
18
+ # * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Slides.pdf
19
+ # * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Paper.pdf
20
+ # * https://github.com/s7ephen/OSX-Sandbox--Seatbelt--Profiles
21
+ # * `$ man sandbox-exec`
22
+ # * `$ ls /usr/share/sandbox`
23
+
24
+ if $0 == __FILE__
25
+ $:.unshift File.expand_path('../../lib', __FILE__)
26
+ end
27
+ require 'pathname'
28
+ require 'cocoapods/config'
29
+
30
+
31
+ pod_bin = File.expand_path('../pod', __FILE__)
32
+ pod_prefix = File.expand_path('../..', pod_bin)
33
+
34
+ require 'rbconfig'
35
+ ruby_bin = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
36
+ ruby_prefix = RbConfig::CONFIG['prefix']
37
+
38
+ prefixes = ['/bin', '/usr/bin', '/usr/libexec']
39
+ prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
40
+ # From asking people, it seems MacPorts does not have a `prefix` command, like
41
+ # Homebrew does, so make an educated guess:
42
+ unless (port = `which port`.strip).empty?
43
+ prefixes << File.dirname(File.dirname(port))
44
+ end
45
+
46
+ developer_prefix = `xcode-select --print-path`.strip
47
+ xcode_app_path = File.expand_path('../..', developer_prefix)
48
+
49
+ require 'erb'
50
+ profile = ERB.new(DATA.read, 0, '>').result(TOPLEVEL_BINDING)
51
+ #puts profile
52
+
53
+ command = ['/usr/bin/sandbox-exec', '-p', profile, pod_bin, *ARGV]
54
+ exec *command
55
+
56
+
57
+ __END__
58
+ (version 1)
59
+ (debug allow)
60
+
61
+ (import "mDNSResponder.sb")
62
+
63
+ (allow file-ioctl)
64
+ (allow sysctl-read)
65
+ (allow mach-lookup)
66
+ (allow ipc-posix-shm)
67
+ (allow process-fork)
68
+ (allow system-socket)
69
+
70
+ ; TODO make this stricter if possible
71
+ (allow network-outbound)
72
+
73
+ (allow process-exec
74
+ (literal
75
+ "<%= pod_bin %>"
76
+ "<%= ruby_bin %>"
77
+ "<%= File.join(developer_prefix, 'usr/bin/xcrun') %>"
78
+ "<%= File.join(developer_prefix, 'usr/bin/xcodebuild') %>"
79
+ )
80
+ (regex
81
+ <% prefixes.each do |prefix| %>
82
+ #"^<%= prefix %>/*"
83
+ <% end %>
84
+ )
85
+ )
86
+
87
+ (allow file-read-metadata)
88
+ (allow file-read*
89
+ ; This is currenly only added because using `xcodebuild` to build a resource
90
+ ; bundle target starts a FSEvents stream on `/`. No idea why that would be
91
+ ; needed, but for now it doesn’t seem like a real problem.
92
+ (literal "/")
93
+ (regex
94
+ ; TODO see if we can restrict this more, but it's going to be hard
95
+ #"^/Users/[^.]+/*"
96
+ ;#"^/Users/[^.]+/.netrc"
97
+ ;#"^/Users/[^.]+/.gemrc"
98
+ ;#"^/Users/[^.]+/.gem/*"
99
+ ;#"^/Users/[^.]+/Library/.*"
100
+ #"^/Library/*"
101
+ #"^/System/Library/*"
102
+ #"^/usr/lib/*"
103
+ #"^/usr/share/*"
104
+ #"^/private/*"
105
+ #"^/dev/*"
106
+ #"^<%= ruby_prefix %>"
107
+ #"^<%= pod_prefix %>"
108
+ #"^<%= xcode_app_path %>"
109
+ #"^<%= Pod::Config.instance.repos_dir %>"
110
+ <% prefixes.each do |prefix| %>
111
+ #"^<%= prefix %>/*"
112
+ <% end %>
113
+ )
114
+ )
115
+
116
+ (allow file-write*
117
+ (literal
118
+ "/dev/dtracehelper"
119
+ "/dev/null"
120
+ )
121
+ (regex
122
+ #"^<%= Pod::Config.instance.project_root %>"
123
+ #"^<%= Pod::Config.instance.repos_dir %>"
124
+ #"^/Users/[^.]+/Library/Caches/CocoaPods/*"
125
+ #"^/dev/tty"
126
+ #"^/private/var"
127
+ )
128
+ )
129
+
130
+ (deny default)
@@ -9,8 +9,7 @@ module Pod
9
9
  require 'cocoapods-core'
10
10
  require 'cocoapods/file_list'
11
11
  require 'cocoapods/config'
12
-
13
- autoload :Downloader, 'cocoapods/downloader'
12
+ require 'cocoapods/downloader'
14
13
 
15
14
  # Indicates an user error. This is defined in cocoapods-core.
16
15
  #
@@ -55,7 +54,6 @@ module Pod
55
54
  autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
56
55
  autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
57
56
  autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
58
- autoload :Documentation, 'cocoapods/generator/documentation'
59
57
  autoload :DummySource, 'cocoapods/generator/dummy_source'
60
58
  autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
61
59
  autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
@@ -21,6 +21,7 @@ module Pod
21
21
  require 'cocoapods/command/podfile_info'
22
22
 
23
23
  self.abstract_command = true
24
+ self.default_subcommand = 'install'
24
25
  self.command = 'pod'
25
26
  self.description = 'CocoaPods, the Objective-C library package manager.'
26
27
 
@@ -5,7 +5,7 @@ module Pod
5
5
  self.arguments = '[COMMAND]'
6
6
 
7
7
  def initialize(argv)
8
- @help_command = Pod::Command.parse(argv) unless argv.empty?
8
+ @help_command = Pod::Command.parse(argv)
9
9
  super
10
10
  end
11
11
 
@@ -16,7 +16,7 @@ module Pod
16
16
  private
17
17
 
18
18
  def help_command
19
- @help_command || self
19
+ @help_command
20
20
  end
21
21
  end
22
22
  end
@@ -9,7 +9,6 @@ module Pod
9
9
  def options
10
10
  [
11
11
  ["--no-clean", "Leave SCM dirs like `.git' and `.svn' intact after downloading"],
12
- ["--no-doc", "Skip documentation generation with appledoc"],
13
12
  ["--no-integrate", "Skip integration of the Pods libraries in the Xcode project(s)"],
14
13
  ["--no-repo-update", "Skip running `pod repo update` before install"],
15
14
  ].concat(super)
@@ -22,7 +21,6 @@ module Pod
22
21
 
23
22
  def initialize(argv)
24
23
  config.clean = argv.flag?('clean', config.clean)
25
- config.generate_docs = argv.flag?('doc', config.generate_docs)
26
24
  config.integrate_targets = argv.flag?('integrate', config.integrate_targets)
27
25
  config.skip_repo_update = !argv.flag?('repo-update', !config.skip_repo_update)
28
26
  super
@@ -12,12 +12,12 @@ module Pod
12
12
  self.arguments = '[QUERY]'
13
13
 
14
14
  def self.options
15
- [[
16
- "--full", "Search by name, summary, and description",
17
- "--stats", "Show additional stats (like GitHub watchers and forks)",
18
- "--ios", "Restricts the search to Pods supported on iOS",
19
- "--osx", "Restricts the search to Pods supported on OS X",
20
- ]].concat(super)
15
+ [
16
+ ["--full", "Search by name, summary, and description"],
17
+ ["--stats", "Show additional stats (like GitHub watchers and forks)"],
18
+ ["--ios", "Restricts the search to Pods supported on iOS"],
19
+ ["--osx", "Restricts the search to Pods supported on OS X"]
20
+ ].concat(super)
21
21
  end
22
22
 
23
23
  def initialize(argv)
@@ -11,8 +11,7 @@ module Pod
11
11
  #
12
12
  # ---
13
13
  # skip_repo_update: true
14
- # generate_docs: false
15
- # install_docs: false
14
+ # new_version_message: false
16
15
  #
17
16
  DEFAULTS = {
18
17
  :verbose => false,
@@ -21,13 +20,13 @@ module Pod
21
20
  :aggressive_cache => false,
22
21
 
23
22
  :clean => true,
24
- :generate_docs => true,
25
- :install_docs => true,
26
23
  :integrate_targets => true,
27
24
  :new_version_message => true,
28
25
  }
29
26
 
30
- #--------------------------------------#
27
+ public
28
+
29
+ #-------------------------------------------------------------------------#
31
30
 
32
31
  # @!group UI
33
32
 
@@ -42,13 +41,13 @@ module Pod
42
41
  attr_accessor :silent
43
42
  alias_method :silent?, :silent
44
43
 
45
- # @return [Bool] Whether the generated documentation should be installed to
46
- # Xcode.
44
+ # @return [Bool] Whether a message should be printed when a new version of
45
+ # CocoaPods is available.
47
46
  #
48
47
  attr_accessor :new_version_message
49
48
  alias_method :new_version_message?, :new_version_message
50
49
 
51
- #--------------------------------------#
50
+ #-------------------------------------------------------------------------#
52
51
 
53
52
  # @!group Installation
54
53
 
@@ -57,18 +56,6 @@ module Pod
57
56
  attr_accessor :clean
58
57
  alias_method :clean?, :clean
59
58
 
60
- # @return [Bool] Whether the documentation should be generated for the
61
- # installed Pods.
62
- #
63
- attr_accessor :generate_docs
64
- alias_method :generate_docs?, :generate_docs
65
-
66
- # @return [Bool] Whether the generated documentation should be installed to
67
- # Xcode.
68
- #
69
- attr_accessor :install_docs
70
- alias_method :install_docs?, :install_docs
71
-
72
59
  # @return [Bool] Whether CocoaPods should integrate a user target and build
73
60
  # the workspace or just create the Pods project.
74
61
  #
@@ -81,13 +68,24 @@ module Pod
81
68
  attr_accessor :skip_repo_update
82
69
  alias_method :skip_repo_update?, :skip_repo_update
83
70
 
71
+ # Allows to set whether the downloader should use more aggressive caching
72
+ # options.
73
+ #
74
+ # @note The aggressive cache has lead to issues if a tag is updated to
75
+ # point to another commit.
76
+ #
77
+ attr_writer :aggressive_cache
78
+
84
79
  # @return [Bool] Whether the downloader should use more aggressive caching
85
80
  # options.
86
81
  #
87
- attr_accessor :aggressive_cache
88
- alias_method :aggressive_cache?, :aggressive_cache
82
+ def aggressive_cache?
83
+ @aggressive_cache || (ENV['CP_AGGRESSIVE_CACHE'] != 'FALSE')
84
+ end
85
+
86
+ public
89
87
 
90
- #--------------------------------------#
88
+ #-------------------------------------------------------------------------#
91
89
 
92
90
  # @!group Initialization
93
91
 
@@ -105,7 +103,9 @@ module Pod
105
103
  @verbose && !silent
106
104
  end
107
105
 
108
- #--------------------------------------#
106
+ public
107
+
108
+ #-------------------------------------------------------------------------#
109
109
 
110
110
  # @!group Paths
111
111
 
@@ -121,7 +121,22 @@ module Pod
121
121
  # Podfile is located.
122
122
  #
123
123
  def installation_root
124
- @installation_root ||= Pathname.pwd
124
+ current_path = Pathname.pwd
125
+ unless @installation_root
126
+ while(!current_path.root?)
127
+ if podfile_path_in_dir(current_path)
128
+ @installation_root = current_path
129
+ unless current_path == Pathname.pwd
130
+ UI.puts ("[in #{current_path}]")
131
+ end
132
+ break
133
+ else
134
+ current_path = current_path.parent
135
+ end
136
+ end
137
+ @installation_root ||= Pathname.pwd
138
+ end
139
+ @installation_root
125
140
  end
126
141
 
127
142
  attr_writer :installation_root
@@ -143,23 +158,46 @@ module Pod
143
158
  end
144
159
 
145
160
  # @return [Podfile] The Podfile to use for the current execution.
161
+ # @return [Nil] If no Podfile is available.
146
162
  #
147
163
  def podfile
148
- @podfile ||= Podfile.from_file(podfile_path) if podfile_path.exist?
164
+ @podfile ||= Podfile.from_file(podfile_path) if podfile_path
149
165
  end
150
166
  attr_writer :podfile
151
167
 
152
168
  # @return [Lockfile] The Lockfile to use for the current execution.
169
+ # @return [Nil] If no Lockfile is available.
153
170
  #
154
171
  def lockfile
155
- @lockfile ||= Lockfile.from_file(lockfile_path) if lockfile_path.exist?
172
+ @lockfile ||= Lockfile.from_file(lockfile_path) if lockfile_path
173
+ end
174
+
175
+ # Returns the path of the Podfile.
176
+ #
177
+ # @note The Podfile can be named either `CocoaPods.podfile.yaml`,
178
+ # `CocoaPods.podfile` or `Podfile`. The first two are preferred as
179
+ # they allow to specify an OS X UTI.
180
+ #
181
+ # @return [Pathname]
182
+ # @return [Nil]
183
+ #
184
+ def podfile_path
185
+ @podfile_path ||= podfile_path_in_dir(installation_root)
186
+ end
187
+
188
+ # Returns the path of the Lockfile.
189
+ #
190
+ # @note The Lockfile is named `Podfile.lock`.
191
+ #
192
+ def lockfile_path
193
+ @lockfile_path ||= installation_root + 'Podfile.lock'
156
194
  end
157
195
 
158
- #--------------------------------------#
196
+ private
159
197
 
160
- # @!group Helpers
198
+ #-------------------------------------------------------------------------#
161
199
 
162
- # private
200
+ # @!group Private helpers
163
201
 
164
202
  # @return [Pathname] The path of the file which contains the user settings.
165
203
  #
@@ -181,30 +219,38 @@ module Pod
181
219
  end
182
220
  end
183
221
 
184
- # Returns the path of the Podfile.
222
+ # @return [Array<String>] The filenames that the Podfile can have ordered
223
+ # by priority.
185
224
  #
186
- # @note The Podfile can be named either `CocoaPods.podfile` or `Podfile`.
187
- # The first is preferred as it allows to specify an OS X UTI.
188
- #
189
- def podfile_path
190
- unless @podfile_path
191
- path = installation_root + 'CocoaPods.podfile.yaml'
192
- path = installation_root + 'CocoaPods.podfile' unless path.exist?
193
- path = installation_root + 'Podfile' unless path.exist?
194
- @podfile_path = path
195
- end
196
- @podfile_path
197
- end
225
+ PODFILE_NAMES = [
226
+ 'CocoaPods.podfile.yaml',
227
+ 'CocoaPods.podfile',
228
+ 'Podfile',
229
+ ]
198
230
 
199
- # Returns the path of the Lockfile.
231
+ # Returns the path of the Podfile in the given dir if any exists.
200
232
  #
201
- # @note The Lockfile is named `Podfile.lock`.
233
+ # @param [Pathname] dir
234
+ # The directory where to look for the Podfile.
202
235
  #
203
- def lockfile_path
204
- @lockfile_path ||= installation_root + 'Podfile.lock'
236
+ # @return [Pathname] The path of the Podfile.
237
+ # @return [Nil] If not Podfile was found in the given dir
238
+ #
239
+ def podfile_path_in_dir(dir)
240
+ PODFILE_NAMES.each do |filename|
241
+ candidate = dir + filename
242
+ if candidate.exist?
243
+ return candidate
244
+ end
245
+ end
246
+ nil
205
247
  end
206
248
 
207
- #--------------------------------------#
249
+ public
250
+
251
+ #-------------------------------------------------------------------------#
252
+
253
+ # @!group Singleton
208
254
 
209
255
  # @return [Config] the current config instance creating one if needed.
210
256
  #
@@ -223,8 +269,6 @@ module Pod
223
269
  @instance = instance
224
270
  end
225
271
 
226
- #-------------------------------------------------------------------------#
227
-
228
272
  # Provides support for accessing the configuration instance in other
229
273
  # scopes.
230
274
  #