cocoapods-core 0.34.0.rc2 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-core/gem_version.rb +1 -1
- data/lib/cocoapods-core/podfile/dsl.rb +5 -6
- data/lib/cocoapods-core/source.rb +6 -1
- data/lib/cocoapods-core/source/abstract_data_provider.rb +6 -0
- data/lib/cocoapods-core/source/file_system_data_provider.rb +9 -0
- data/lib/cocoapods-core/specification/linter.rb +3 -8
- metadata +13 -14
- data/lib/cocoapods-core/source/github_data_provider.rb +0 -144
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 237eccff7f8b4432a3ef7962c927be95e439d3e0
|
4
|
+
data.tar.gz: 94a8c5202c580be60024816ed300d4ea68aef020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6b4e009611ea7b9aa7e7a49f59e6b5ab31115eb6ef0615f0ac913ec6b33eda55ec1fa6e126a4334bf7c59545ddbf293c11a7a6ddcd986786cf22d7237c9f87
|
7
|
+
data.tar.gz: b72004d474e08fb4c33a5f51323f9a79a141aee78f321a73bb3a5fa887f06ed52a14c04649216f4c9f2fb5295a26219be775bc7c234d033f684f7055b94b8ecc
|
@@ -480,21 +480,20 @@ module Pod
|
|
480
480
|
#
|
481
481
|
# -----
|
482
482
|
#
|
483
|
-
# By default, the
|
484
|
-
# method to specify
|
483
|
+
# By default, the GitHub Cocoapods/Specs repository is used. Use this
|
484
|
+
# method to specify sources. The order of the sources is
|
485
485
|
# relevant. CocoaPods will use the highest version of a Pod of the first
|
486
486
|
# source which includes the Pod (regardless whether other sources have a
|
487
487
|
# higher version).
|
488
488
|
#
|
489
489
|
# @param [String] source
|
490
|
-
# The
|
491
|
-
# via pod repo add command
|
490
|
+
# The URL of a specs repo.
|
492
491
|
#
|
493
492
|
# @example Specifying to use first `my_private_repo` and then the
|
494
493
|
# CocoaPods Master Repo
|
495
494
|
#
|
496
|
-
# source 'my_private_repo'
|
497
|
-
# source '
|
495
|
+
# source 'https://banana.com/corp/my_private_repo.git'
|
496
|
+
# source 'https://github.com/CocoaPods/Specs.git'
|
498
497
|
#
|
499
498
|
# @return [void]
|
500
499
|
#
|
@@ -3,7 +3,6 @@ require 'cocoapods-core/source/aggregate'
|
|
3
3
|
require 'cocoapods-core/source/health_reporter'
|
4
4
|
require 'cocoapods-core/source/abstract_data_provider'
|
5
5
|
require 'cocoapods-core/source/file_system_data_provider'
|
6
|
-
require 'cocoapods-core/source/github_data_provider'
|
7
6
|
|
8
7
|
module Pod
|
9
8
|
# The Source class is responsible to manage a collection of podspecs.
|
@@ -38,6 +37,12 @@ module Pod
|
|
38
37
|
data_provider.name
|
39
38
|
end
|
40
39
|
|
40
|
+
# @return [String] The URL of the source.
|
41
|
+
#
|
42
|
+
def url
|
43
|
+
data_provider.url
|
44
|
+
end
|
45
|
+
|
41
46
|
# @return [String] The type of the source.
|
42
47
|
#
|
43
48
|
def type
|
@@ -14,6 +14,12 @@ module Pod
|
|
14
14
|
raise StandardError, 'Abstract method.'
|
15
15
|
end
|
16
16
|
|
17
|
+
# @return [String] The URL of the source.
|
18
|
+
#
|
19
|
+
def url
|
20
|
+
raise StandardError, 'Abstract method.'
|
21
|
+
end
|
22
|
+
|
17
23
|
# @return [String] The user friendly type of the source.
|
18
24
|
#
|
19
25
|
def type
|
@@ -25,6 +25,15 @@ module Pod
|
|
25
25
|
repo.basename.to_s
|
26
26
|
end
|
27
27
|
|
28
|
+
# @return [String] The URL of the source.
|
29
|
+
#
|
30
|
+
def url
|
31
|
+
Dir.chdir(repo) do
|
32
|
+
remote = `git ls-remote --get-url`.chomp
|
33
|
+
remote if $?.success?
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
28
37
|
# @return [String] The user friendly type of the source.
|
29
38
|
#
|
30
39
|
def type
|
@@ -304,13 +304,8 @@ module Pod
|
|
304
304
|
if tag && !tag.to_s.include?(version)
|
305
305
|
warning '[source] The version should be included in the Git tag.'
|
306
306
|
end
|
307
|
-
if
|
308
|
-
|
309
|
-
error '[source] Git sources should specify either a commit or' \
|
310
|
-
'a tag.'
|
311
|
-
end
|
312
|
-
else
|
313
|
-
warning '[source] Git sources should specify a tag.' if tag.nil?
|
307
|
+
if tag.nil?
|
308
|
+
warning '[source] Git sources should specify a tag.'
|
314
309
|
end
|
315
310
|
end
|
316
311
|
|
@@ -349,7 +344,7 @@ module Pod
|
|
349
344
|
if git = s[:git]
|
350
345
|
if git =~ /\w+\@(\w|\.)+\:(\/\w+)*/
|
351
346
|
warning '[source] Git SSH URLs will NOT work for people behind' \
|
352
|
-
'firewalls configured to only allow HTTP,
|
347
|
+
'firewalls configured to only allow HTTP, therefore HTTPS is' \
|
353
348
|
'preferred.'
|
354
349
|
end
|
355
350
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.34.0
|
4
|
+
version: 0.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -92,9 +92,6 @@ executables: []
|
|
92
92
|
extensions: []
|
93
93
|
extra_rdoc_files: []
|
94
94
|
files:
|
95
|
-
- LICENSE
|
96
|
-
- README.md
|
97
|
-
- lib/cocoapods-core.rb
|
98
95
|
- lib/cocoapods-core/core_ui.rb
|
99
96
|
- lib/cocoapods-core/dependency.rb
|
100
97
|
- lib/cocoapods-core/gem_version.rb
|
@@ -102,38 +99,40 @@ files:
|
|
102
99
|
- lib/cocoapods-core/http.rb
|
103
100
|
- lib/cocoapods-core/lockfile.rb
|
104
101
|
- lib/cocoapods-core/platform.rb
|
105
|
-
- lib/cocoapods-core/podfile.rb
|
106
102
|
- lib/cocoapods-core/podfile/dsl.rb
|
107
103
|
- lib/cocoapods-core/podfile/target_definition.rb
|
104
|
+
- lib/cocoapods-core/podfile.rb
|
108
105
|
- lib/cocoapods-core/requirement.rb
|
109
|
-
- lib/cocoapods-core/source.rb
|
110
106
|
- lib/cocoapods-core/source/abstract_data_provider.rb
|
111
107
|
- lib/cocoapods-core/source/acceptor.rb
|
112
108
|
- lib/cocoapods-core/source/aggregate.rb
|
113
109
|
- lib/cocoapods-core/source/file_system_data_provider.rb
|
114
|
-
- lib/cocoapods-core/source/github_data_provider.rb
|
115
110
|
- lib/cocoapods-core/source/health_reporter.rb
|
116
|
-
- lib/cocoapods-core/
|
111
|
+
- lib/cocoapods-core/source.rb
|
117
112
|
- lib/cocoapods-core/specification/consumer.rb
|
118
|
-
- lib/cocoapods-core/specification/dsl.rb
|
119
113
|
- lib/cocoapods-core/specification/dsl/attribute.rb
|
120
114
|
- lib/cocoapods-core/specification/dsl/attribute_support.rb
|
121
115
|
- lib/cocoapods-core/specification/dsl/deprecations.rb
|
122
116
|
- lib/cocoapods-core/specification/dsl/platform_proxy.rb
|
117
|
+
- lib/cocoapods-core/specification/dsl.rb
|
123
118
|
- lib/cocoapods-core/specification/json.rb
|
124
|
-
- lib/cocoapods-core/specification/linter.rb
|
125
119
|
- lib/cocoapods-core/specification/linter/analyzer.rb
|
126
120
|
- lib/cocoapods-core/specification/linter/result.rb
|
121
|
+
- lib/cocoapods-core/specification/linter.rb
|
127
122
|
- lib/cocoapods-core/specification/root_attribute_accessors.rb
|
128
|
-
- lib/cocoapods-core/specification/set.rb
|
129
123
|
- lib/cocoapods-core/specification/set/presenter.rb
|
130
124
|
- lib/cocoapods-core/specification/set/statistics.rb
|
125
|
+
- lib/cocoapods-core/specification/set.rb
|
126
|
+
- lib/cocoapods-core/specification.rb
|
131
127
|
- lib/cocoapods-core/standard_error.rb
|
132
|
-
- lib/cocoapods-core/vendor.rb
|
133
128
|
- lib/cocoapods-core/vendor/requirement.rb
|
134
129
|
- lib/cocoapods-core/vendor/version.rb
|
130
|
+
- lib/cocoapods-core/vendor.rb
|
135
131
|
- lib/cocoapods-core/version.rb
|
136
132
|
- lib/cocoapods-core/yaml_helper.rb
|
133
|
+
- lib/cocoapods-core.rb
|
134
|
+
- README.md
|
135
|
+
- LICENSE
|
137
136
|
homepage: https://github.com/CocoaPods/CocoaPods
|
138
137
|
licenses:
|
139
138
|
- MIT
|
@@ -154,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
153
|
version: '0'
|
155
154
|
requirements: []
|
156
155
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.0.14
|
158
157
|
signing_key:
|
159
158
|
specification_version: 3
|
160
159
|
summary: The models of CocoaPods
|
@@ -1,144 +0,0 @@
|
|
1
|
-
module Pod
|
2
|
-
class Source
|
3
|
-
# Data provider for a `Pod::Source` backed by a repository hosted on GitHub
|
4
|
-
# and accessed via the HTTP API. Only pure JSON repos using the `Specs`
|
5
|
-
# subdir to store the specifications are supported.
|
6
|
-
#
|
7
|
-
class GitHubDataProvider < AbstractDataProvider
|
8
|
-
# @return [String] The identifier of the repository (user name and repo
|
9
|
-
# name) or the full URL of the repo.
|
10
|
-
#
|
11
|
-
attr_reader :repo_id
|
12
|
-
|
13
|
-
# @return [String] The branch of the repo if the default one shouldn't be
|
14
|
-
# used.
|
15
|
-
#
|
16
|
-
attr_reader :branch
|
17
|
-
|
18
|
-
# @param [String] repo_id @see repo_id
|
19
|
-
# @param [String] branch @see branch
|
20
|
-
#
|
21
|
-
def initialize(repo_id, branch = nil)
|
22
|
-
@repo_id = repo_id
|
23
|
-
@branch = branch
|
24
|
-
end
|
25
|
-
|
26
|
-
public
|
27
|
-
|
28
|
-
# @group Data Source
|
29
|
-
#-----------------------------------------------------------------------#
|
30
|
-
|
31
|
-
# @return [String] The name of the Source. User name and repo.
|
32
|
-
#
|
33
|
-
def name
|
34
|
-
GitHub.normalized_repo_id(repo_id)
|
35
|
-
end
|
36
|
-
|
37
|
-
# @return [String] The user friendly type of the source.
|
38
|
-
#
|
39
|
-
def type
|
40
|
-
'GitHub API'
|
41
|
-
end
|
42
|
-
|
43
|
-
# @return [Array<String>] The list of the name of all the Pods known to
|
44
|
-
# the Source.
|
45
|
-
#
|
46
|
-
def pods
|
47
|
-
root_contents = get_github_contents('Specs')
|
48
|
-
pods = dir_names(root_contents)
|
49
|
-
pods.sort if pods
|
50
|
-
end
|
51
|
-
|
52
|
-
# @return [Array<String>] All the available versions of a given Pod,
|
53
|
-
# sorted from highest to lowest.
|
54
|
-
#
|
55
|
-
# @param [String] name
|
56
|
-
# The name of the Pod.
|
57
|
-
#
|
58
|
-
def versions(name)
|
59
|
-
raise ArgumentError, 'No name' unless name
|
60
|
-
contents = get_github_contents("Specs/#{name}")
|
61
|
-
pre_vers = dir_names(contents)
|
62
|
-
return nil if pre_vers.nil?
|
63
|
-
pre_vers.each do |v|
|
64
|
-
Version.new(v)
|
65
|
-
end.sort.reverse.map(&:to_s)
|
66
|
-
end
|
67
|
-
|
68
|
-
# @return [Specification] The specification for a given version of a Pod.
|
69
|
-
#
|
70
|
-
# @param [String] name
|
71
|
-
# The name of the Pod.
|
72
|
-
#
|
73
|
-
# @param [String] version
|
74
|
-
# The version of the Pod.
|
75
|
-
#
|
76
|
-
def specification(name, version)
|
77
|
-
raise ArgumentError, 'No name' unless name
|
78
|
-
raise ArgumentError, 'No version' unless version
|
79
|
-
spec_content = specification_contents(name, version)
|
80
|
-
if spec_content
|
81
|
-
Pod::Specification.from_json(spec_content)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
# @return [Specification] The contents of the specification for a given
|
86
|
-
# version of a Pod.
|
87
|
-
#
|
88
|
-
# @param [String] name
|
89
|
-
# the name of the Pod.
|
90
|
-
#
|
91
|
-
# @param [String] version
|
92
|
-
# the version of the Pod.
|
93
|
-
#
|
94
|
-
def specification_contents(name, version)
|
95
|
-
raise ArgumentError, 'No name' unless name
|
96
|
-
raise ArgumentError, 'No version' unless version
|
97
|
-
path = "Specs/#{name}/#{version}/#{name}.podspec.json"
|
98
|
-
file_contents = get_github_contents(path)
|
99
|
-
if file_contents
|
100
|
-
if file_contents['encoding'] == 'base64'
|
101
|
-
require 'base64'
|
102
|
-
Base64.decode64(file_contents['content'])
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
private
|
108
|
-
|
109
|
-
# @group Private Helpers
|
110
|
-
#-----------------------------------------------------------------------#
|
111
|
-
|
112
|
-
# Performs a get request with the given URL.
|
113
|
-
#
|
114
|
-
# @param [String] url
|
115
|
-
# The URL of the resource.
|
116
|
-
#
|
117
|
-
# @return [Array, Hash] The information of the resource as Ruby objects.
|
118
|
-
#
|
119
|
-
def get_github_contents(path = nil)
|
120
|
-
Pod::GitHub.contents(repo_id, path, branch)
|
121
|
-
end
|
122
|
-
|
123
|
-
# @param [Array] [Array<Hash>] The contents of a directory.
|
124
|
-
#
|
125
|
-
# @return [Array<String>] Returns the list of the directories given the
|
126
|
-
# contents returned for the API of a directory.
|
127
|
-
#
|
128
|
-
# @return [Nil] If the directory was not found or the contents is not an
|
129
|
-
# array.
|
130
|
-
#
|
131
|
-
def dir_names(contents)
|
132
|
-
if contents.is_a?(Array)
|
133
|
-
contents.map do |entry|
|
134
|
-
if entry['type'] == 'dir'
|
135
|
-
entry['name']
|
136
|
-
end
|
137
|
-
end.compact
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
#-----------------------------------------------------------------------#
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|