cocoapods-core 0.20.2 → 0.21.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/cocoapods-core/dependency.rb +2 -1
- data/lib/cocoapods-core/gem_version.rb +1 -1
- data/lib/cocoapods-core/github.rb +103 -0
- data/lib/cocoapods-core/specification/consumer.rb +1 -5
- data/lib/cocoapods-core/specification/dsl/attribute.rb +0 -4
- data/lib/cocoapods-core/specification/linter.rb +2 -6
- data/lib/cocoapods-core/specification/set/statistics.rb +12 -27
- data/lib/cocoapods-core/specification/yaml.rb +1 -25
- data/lib/cocoapods-core.rb +2 -9
- metadata +28 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 62b312896ca3d9a7d6e2ae1631acc1b6e1c9bbbb
|
4
|
+
data.tar.gz: 6e5c6481e6aebb081b04d84b9ec193c0587614fc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8996846f9dd57340fa2901478ab8671e06800cc04bc50813350ca3c9b3f2cd0563417a1b6b1ce047b89c0da81d0c90ffbfeaaa78b2f8564728356f6285c57efe
|
7
|
+
data.tar.gz: d2b27e00017dd8a9742c6f5b1565cf178716bbd8682b6f2232cdf0050a2e28f79603a1e5ea926403ed203b498ed5827a4e28e898639d56d1615bf32a47441783
|
@@ -0,0 +1,103 @@
|
|
1
|
+
module Pod
|
2
|
+
|
3
|
+
# Allows to access information about the GitHub repos.
|
4
|
+
#
|
5
|
+
# This class is stored in Core because it might be used by web services.
|
6
|
+
#
|
7
|
+
module GitHub
|
8
|
+
|
9
|
+
# Returns the information of a user.
|
10
|
+
#
|
11
|
+
# @param [String] login
|
12
|
+
# The name of the user.
|
13
|
+
#
|
14
|
+
# @return [Hash] The data of user.
|
15
|
+
#
|
16
|
+
def self.user(login)
|
17
|
+
peform_request("https://api.github.com/users/#{login}")
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns the information of a repo.
|
21
|
+
#
|
22
|
+
# @param [String] url
|
23
|
+
# The URL of the repo.
|
24
|
+
#
|
25
|
+
# @return [Hash] The hash containing the data as reported by GitHub.
|
26
|
+
#
|
27
|
+
def self.repo(url)
|
28
|
+
if repo_id = normalized_repo_id(url)
|
29
|
+
peform_request("https://api.github.com/repos/#{repo_id}")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns the tags of a repo.
|
34
|
+
#
|
35
|
+
# @param [String] url @see #repo
|
36
|
+
#
|
37
|
+
# @return [Array] The list of the tags.
|
38
|
+
#
|
39
|
+
def self.tags(url)
|
40
|
+
if repo_id = normalized_repo_id(url)
|
41
|
+
peform_request("https://api.github.com/repos/#{repo_id}/tags")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns the branches of a repo.
|
46
|
+
#
|
47
|
+
# @param [String] url @see #repo
|
48
|
+
#
|
49
|
+
# @return [Array] The list of the branches.
|
50
|
+
#
|
51
|
+
def self.branches(url)
|
52
|
+
if repo_id = normalized_repo_id(url)
|
53
|
+
peform_request("https://api.github.com/repos/#{repo_id}/branches")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
#-------------------------------------------------------------------------#
|
60
|
+
|
61
|
+
# @!group Private helpers
|
62
|
+
|
63
|
+
# Returns the repo ID as it is or converting a GitHub URL.
|
64
|
+
#
|
65
|
+
# @param [String] url_or_id
|
66
|
+
# A repo ID or the URL of the repo.
|
67
|
+
#
|
68
|
+
# @return [String] the repo ID.
|
69
|
+
#
|
70
|
+
def self.normalized_repo_id(url_or_id)
|
71
|
+
repo_id_from_url(url_or_id) || url_or_id
|
72
|
+
end
|
73
|
+
|
74
|
+
# Returns the repo ID given it's URL.
|
75
|
+
#
|
76
|
+
# @param [String] url
|
77
|
+
# The URL of the repo.
|
78
|
+
#
|
79
|
+
# @return [String] the repo ID.
|
80
|
+
# @return [Nil] if the given url is not a valid github repo url.
|
81
|
+
#
|
82
|
+
def self.repo_id_from_url(url)
|
83
|
+
url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1]
|
84
|
+
end
|
85
|
+
|
86
|
+
# Performs a get request with the given URL.
|
87
|
+
#
|
88
|
+
# @param [String] url
|
89
|
+
# The URL of the resource.
|
90
|
+
#
|
91
|
+
# @return [Array, Hash] The information of the resource as Ruby objects.
|
92
|
+
#
|
93
|
+
def self.peform_request(url)
|
94
|
+
require 'rest'
|
95
|
+
require 'json'
|
96
|
+
response = REST.get(url)
|
97
|
+
JSON.parse(response.body)
|
98
|
+
end
|
99
|
+
|
100
|
+
#-------------------------------------------------------------------------#
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
@@ -268,11 +268,7 @@ module Pod
|
|
268
268
|
#
|
269
269
|
def prepare_value(attr, value)
|
270
270
|
if attr.container == Array
|
271
|
-
|
272
|
-
value = [value]
|
273
|
-
else
|
274
|
-
value = [*value].compact
|
275
|
-
end
|
271
|
+
value = [*value].compact
|
276
272
|
end
|
277
273
|
|
278
274
|
hook_name = prepare_hook_name(attr)
|
@@ -219,10 +219,6 @@ module Pod
|
|
219
219
|
"#{to_s}. Allowed keys: `#{allowed_keys.inspect}`"
|
220
220
|
end
|
221
221
|
end
|
222
|
-
|
223
|
-
if defined?(Rake) && value.is_a?(Rake::FileList)
|
224
|
-
# UI.warn "Rake::FileList is deprecated, use `exclude_files` (#{attrb.name})."
|
225
|
-
end
|
226
222
|
end
|
227
223
|
|
228
224
|
# @return [Array] the flattened list of the allowed keys for the
|
@@ -276,12 +276,8 @@ module Pod
|
|
276
276
|
patterns = patterns.values.flatten(1)
|
277
277
|
end
|
278
278
|
patterns.each do |pattern|
|
279
|
-
if pattern.
|
280
|
-
|
281
|
-
else
|
282
|
-
if pattern.start_with?('/')
|
283
|
-
error "File patterns must be relative and cannot start with a slash (#{attrb.name})."
|
284
|
-
end
|
279
|
+
if pattern.start_with?('/')
|
280
|
+
error "File patterns must be relative and cannot start with a slash (#{attrb.name})."
|
285
281
|
end
|
286
282
|
end
|
287
283
|
end
|
@@ -54,19 +54,6 @@ module Pod
|
|
54
54
|
#
|
55
55
|
def initialize(cache_file = nil, cache_expiration = (60 * 60 * 24 * 3))
|
56
56
|
require 'yaml'
|
57
|
-
begin
|
58
|
-
# This is to make sure Faraday doesn't warn the user about the
|
59
|
-
# `system_timer` gem missing.
|
60
|
-
old_warn, $-w = $-w, nil
|
61
|
-
begin
|
62
|
-
require 'faraday'
|
63
|
-
ensure
|
64
|
-
$-w = old_warn
|
65
|
-
end
|
66
|
-
require 'octokit'
|
67
|
-
rescue LoadError
|
68
|
-
raise PlainInformative, 'The `octokit` gem is required in order to use the Statistics class.'
|
69
|
-
end
|
70
57
|
|
71
58
|
@cache_file = cache_file
|
72
59
|
@cache_expiration = cache_expiration
|
@@ -258,23 +245,21 @@ module Pod
|
|
258
245
|
update_date = get_value(set, :gh_date)
|
259
246
|
return if update_date && update_date > (Time.now - cache_expiration)
|
260
247
|
|
261
|
-
spec
|
262
|
-
url
|
263
|
-
|
264
|
-
return unless repo_id
|
248
|
+
spec = set.specification
|
249
|
+
url = spec.source[:git] || ''
|
250
|
+
repo = GitHub.repo(url)
|
265
251
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
252
|
+
if repo
|
253
|
+
set_value(set, :gh_watchers, repo['watchers'])
|
254
|
+
set_value(set, :gh_forks, repo['forks'])
|
255
|
+
set_value(set, :pushed_at, repo['pushed_at'])
|
256
|
+
set_value(set, :gh_date, Time.now)
|
257
|
+
save_cache
|
270
258
|
end
|
271
|
-
|
272
|
-
set_value(set, :gh_watchers, repo['watchers'])
|
273
|
-
set_value(set, :gh_forks, repo['forks'])
|
274
|
-
set_value(set, :pushed_at, repo['pushed_at'])
|
275
|
-
set_value(set, :gh_date, Time.now)
|
276
|
-
save_cache
|
277
259
|
end
|
260
|
+
|
261
|
+
#---------------------------------------------------------------------#
|
262
|
+
|
278
263
|
end
|
279
264
|
end
|
280
265
|
end
|
@@ -21,33 +21,9 @@ module Pod
|
|
21
21
|
# without loss of information.
|
22
22
|
#
|
23
23
|
def safe_to_hash?
|
24
|
-
|
24
|
+
pre_install_callback.nil? && post_install_callback.nil?
|
25
25
|
end
|
26
26
|
|
27
|
-
# @return [Bool] If any of the specs uses the FileList class.
|
28
|
-
#
|
29
|
-
def has_file_list(spec)
|
30
|
-
result = false
|
31
|
-
all_specs = [ spec, *spec.recursive_subspecs ]
|
32
|
-
all_specs.each do |current_spec|
|
33
|
-
current_spec.available_platforms.each do |platform|
|
34
|
-
consumer = Specification::Consumer.new(current_spec, platform)
|
35
|
-
attributes = DSL.attributes.values.select(&:file_patterns?)
|
36
|
-
attributes.each do |attrb|
|
37
|
-
patterns = consumer.send(attrb.name)
|
38
|
-
if patterns.is_a?(Hash)
|
39
|
-
patterns = patterns.values.flatten(1)
|
40
|
-
end
|
41
|
-
patterns.each do |pattern|
|
42
|
-
if pattern.is_a?(Rake::FileList)
|
43
|
-
result = true
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
result
|
50
|
-
end
|
51
27
|
end
|
52
28
|
|
53
29
|
# Configures a new specification from the given hash.
|
data/lib/cocoapods-core.rb
CHANGED
@@ -20,27 +20,20 @@ module Pod
|
|
20
20
|
autoload :Dependency, 'cocoapods-core/dependency'
|
21
21
|
|
22
22
|
autoload :CoreUI, 'cocoapods-core/core_ui'
|
23
|
+
autoload :DSLError, 'cocoapods-core/standard_error'
|
24
|
+
autoload :GitHub, 'cocoapods-core/github'
|
23
25
|
autoload :Lockfile, 'cocoapods-core/lockfile'
|
24
26
|
autoload :Platform, 'cocoapods-core/platform'
|
25
27
|
autoload :Podfile, 'cocoapods-core/podfile'
|
26
28
|
autoload :Source, 'cocoapods-core/source'
|
27
29
|
autoload :Specification, 'cocoapods-core/specification'
|
28
30
|
autoload :StandardError, 'cocoapods-core/standard_error'
|
29
|
-
autoload :DSLError, 'cocoapods-core/standard_error'
|
30
31
|
autoload :YAMLConverter, 'cocoapods-core/yaml_converter'
|
31
32
|
|
32
33
|
# TODO: Fix
|
33
34
|
#
|
34
35
|
Spec = Specification
|
35
36
|
|
36
|
-
# TODO: Temporary support for FileList
|
37
|
-
#
|
38
|
-
if RUBY_VERSION >= '1.9'
|
39
|
-
require 'rake/file_list'
|
40
|
-
else
|
41
|
-
require 'rake'
|
42
|
-
end
|
43
|
-
FileList = Rake::FileList
|
44
37
|
end
|
45
38
|
|
46
39
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.21.0.rc1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Eloy Duran
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activesupport
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,31 +21,41 @@ dependencies:
|
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: 3.2.13
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
29
|
+
name: nap
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ~>
|
37
33
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
34
|
+
version: 0.5.1
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
39
|
- - ~>
|
45
40
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
41
|
+
version: 0.5.1
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: json
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.8.0
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.8.0
|
47
56
|
- !ruby/object:Gem::Dependency
|
48
57
|
name: bacon
|
49
58
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
59
|
requirements:
|
52
60
|
- - ~>
|
53
61
|
- !ruby/object:Gem::Version
|
@@ -55,14 +63,14 @@ dependencies:
|
|
55
63
|
type: :development
|
56
64
|
prerelease: false
|
57
65
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
66
|
requirements:
|
60
67
|
- - ~>
|
61
68
|
- !ruby/object:Gem::Version
|
62
69
|
version: '1.1'
|
63
|
-
description:
|
64
|
-
CocoaPods
|
65
|
-
|
70
|
+
description: |-
|
71
|
+
The CocoaPods-Core gem provides support to work with the models of CocoaPods.
|
72
|
+
|
73
|
+
It is intended to be used in place of the CocoaPods when the the installation of the dependencies is not needed.
|
66
74
|
email:
|
67
75
|
- eloy.de.enige@gmail.com
|
68
76
|
- fabiopelosin@gmail.com
|
@@ -73,6 +81,7 @@ files:
|
|
73
81
|
- lib/cocoapods-core/core_ui.rb
|
74
82
|
- lib/cocoapods-core/dependency.rb
|
75
83
|
- lib/cocoapods-core/gem_version.rb
|
84
|
+
- lib/cocoapods-core/github.rb
|
76
85
|
- lib/cocoapods-core/lockfile.rb
|
77
86
|
- lib/cocoapods-core/platform.rb
|
78
87
|
- lib/cocoapods-core/podfile/dsl.rb
|
@@ -108,25 +117,24 @@ files:
|
|
108
117
|
homepage: https://github.com/CocoaPods/CocoaPods
|
109
118
|
licenses:
|
110
119
|
- MIT
|
120
|
+
metadata: {}
|
111
121
|
post_install_message:
|
112
122
|
rdoc_options: []
|
113
123
|
require_paths:
|
114
124
|
- lib
|
115
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
117
126
|
requirements:
|
118
|
-
- -
|
127
|
+
- - '>='
|
119
128
|
- !ruby/object:Gem::Version
|
120
129
|
version: '0'
|
121
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
131
|
requirements:
|
124
|
-
- -
|
132
|
+
- - '>='
|
125
133
|
- !ruby/object:Gem::Version
|
126
134
|
version: '0'
|
127
135
|
requirements: []
|
128
136
|
rubyforge_project:
|
129
|
-
rubygems_version:
|
137
|
+
rubygems_version: 2.0.3
|
130
138
|
signing_key:
|
131
139
|
specification_version: 3
|
132
140
|
summary: The models of CocoaPods
|