File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
lib/cocoapods-core/podfile Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,35 @@ def pod(name = nil, *requirements)
306306 current_target_definition . store_pod ( name , *requirements )
307307 end
308308
309+ def git_package ( url , *requirements )
310+ unless url
311+ raise StandardError , 'A git package requires an URL.'
312+ end
313+
314+ options = requirements . last
315+ unless options . is_a? ( Hash )
316+ options = { }
317+ requirements << options
318+ end
319+ options [ :source ] = url
320+
321+ name = options . delete ( :name ) || url . gsub ( /.git$/ , '' ) . gsub ( %r{^/} , '' ) . split ( '/' ) . last
322+
323+ unless name
324+ raise StandardError , "Could not infer pod name from '#{ url } ' and no `:name` was specified."
325+ end
326+
327+ current_target_definition . store_pod ( name , *requirements )
328+ end
329+
330+ def github_package ( url_fragment , *requirements )
331+ unless url_fragment
332+ raise StandardError , 'A GitHub package requires an URL fragment, e.g. `username/reponame`.'
333+ end
334+
335+ git_package ( "https://github.com/#{ url_fragment } " , *requirements )
336+ end
337+
309338 # Use just the dependencies of a Pod defined in the given podspec file.
310339 # If no arguments are passed the first podspec in the root of the Podfile
311340 # is used. It is intended to be used by the project of a library. Note:
You can’t perform that action at this time.
0 commit comments