cocoapods-git-tarball 0.0.1
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 +7 -0
- data/README.md +36 -0
- data/lib/cocoapods_git_tarball.rb +2 -0
- data/lib/cocoapods_git_tarball/downloader_git.rb +28 -0
- data/lib/cocoapods_git_tarball/gem_version.rb +4 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/spec_helper.rb +45 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dca405da11182546b17fd13aabd2191f8fdb9509c67d5eeec06f057d5fb0d8f4
|
4
|
+
data.tar.gz: d7d84665a20becf523d4c09f95400b63217b52c5a21772198b00f38019b07087
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 78046298943b15f30020062dd86d600cb55694ce2caba100819d12c01ca67b8bf980810daeec36d496a94cc32125b4b8794f3a60daf0697ae8e3fbb8bbcc7d25
|
7
|
+
data.tar.gz: ec79bdea14873668f8d39083491de810ffcff98944b27a636d4813e46013a2d39be008fd9172aa96a43e5497b28c3de99c9601a2a888a3502e3070038b7018f8
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# cocoapods-git-tarball
|
2
|
+
|
3
|
+
`cocoapods-git-tarball` is a CocoaPods plugin that checks whether a pod is being downloaded from a git repo that supports tarballing, and uses HTTP download when this is possible. This saves a lot of time for large repos.
|
4
|
+
|
5
|
+
## Background
|
6
|
+
|
7
|
+
When you use a published pod, e.g. from the main spec repo, the source for the pod itself is usually published in a git repo. Cloning a git repo, even in a shallow clone, takes more time than would a plain tarball download.
|
8
|
+
|
9
|
+
This plugin hooks into `cocoapods-downloader` and modifies its behavior when a git repo can be downloaded as a tarball.
|
10
|
+
|
11
|
+
Currently supported git providers:
|
12
|
+
|
13
|
+
* GitHub
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Install with `gem install`:
|
18
|
+
|
19
|
+
$ gem install cocoapods-git-tarball
|
20
|
+
|
21
|
+
Or add cocoapods-git-tarball to your `Gemfile`:
|
22
|
+
|
23
|
+
gem 'cocoapods-git-tarball'
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
cocoapods-git-tarball is used by adding it to your `Podfile` like this:
|
28
|
+
|
29
|
+
```
|
30
|
+
platform :ios, '11.0'
|
31
|
+
plugin 'cocoapods-git-tarball'
|
32
|
+
|
33
|
+
target :MyTarget do
|
34
|
+
# Dependencies here
|
35
|
+
end
|
36
|
+
```
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'cocoapods-downloader'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
module Downloader
|
6
|
+
# Concreted Downloader class that provides support for specifications with
|
7
|
+
# git sources.
|
8
|
+
#
|
9
|
+
class Git
|
10
|
+
def download_from_github!
|
11
|
+
base_url = url.chomp('.git').chomp('/')
|
12
|
+
ref = options[:commit] || options[:tag] || options[:branch] || 'master'
|
13
|
+
download_url = "#{base_url}/archive/#{ref.to_s}.tar.gz"
|
14
|
+
Http.new(target_path, download_url, {}).download
|
15
|
+
end
|
16
|
+
|
17
|
+
alias_method :orig_download!, :download!
|
18
|
+
|
19
|
+
def download!
|
20
|
+
if url.start_with?('https://github.com/') && !options[:submodules]
|
21
|
+
download_from_github!
|
22
|
+
else
|
23
|
+
orig_download!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods_git_tarball'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'rspec'
|
7
|
+
require 'pathname'
|
8
|
+
require 'cocoapods'
|
9
|
+
|
10
|
+
require 'cocoapods_plugin'
|
11
|
+
|
12
|
+
#-----------------------------------------------------------------------------#
|
13
|
+
|
14
|
+
module Pod
|
15
|
+
|
16
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
17
|
+
#
|
18
|
+
UI.disable_wrap = true
|
19
|
+
|
20
|
+
# Redirects the messages to an internal store.
|
21
|
+
#
|
22
|
+
module UI
|
23
|
+
@output = ''
|
24
|
+
@warnings = ''
|
25
|
+
|
26
|
+
class << self
|
27
|
+
attr_accessor :output
|
28
|
+
attr_accessor :warnings
|
29
|
+
|
30
|
+
def puts(message = '')
|
31
|
+
@output << "#{message}\n"
|
32
|
+
end
|
33
|
+
|
34
|
+
def warn(message = '', actions = [])
|
35
|
+
@warnings << "#{message}\n"
|
36
|
+
end
|
37
|
+
|
38
|
+
def print(message)
|
39
|
+
@output << message
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-git-tarball
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Igor Makarov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.3.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.3.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: cocoapods-downloader
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.3'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.3'
|
47
|
+
description: A CocoaPods plugin that downloads pods from git repos as tarballs, if
|
48
|
+
possible.
|
49
|
+
email:
|
50
|
+
- igormaka@gmail.com
|
51
|
+
executables: []
|
52
|
+
extensions: []
|
53
|
+
extra_rdoc_files:
|
54
|
+
- README.md
|
55
|
+
files:
|
56
|
+
- README.md
|
57
|
+
- lib/cocoapods_git_tarball.rb
|
58
|
+
- lib/cocoapods_git_tarball/downloader_git.rb
|
59
|
+
- lib/cocoapods_git_tarball/gem_version.rb
|
60
|
+
- lib/cocoapods_plugin.rb
|
61
|
+
- spec/spec_helper.rb
|
62
|
+
homepage: https://github.com/igor-makarov/cocoapods-git-tarball
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubygems_version: 3.0.3
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: cocoapods-git-tarball is a CocoaPods plugin that checks whether a pod is
|
85
|
+
being downloaded from a git repo that supports tarballing, and uses HTTP download
|
86
|
+
when this is possible. This saves a lot of time for large repos.
|
87
|
+
test_files:
|
88
|
+
- spec/spec_helper.rb
|