cocoapods-trunk 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +1 -1
- data/lib/cocoapods_trunk.rb +1 -1
- data/lib/pod/command/trunk.rb +5 -6
- data/lib/pod/command/trunk/push.rb +3 -0
- data/lib/pod/command/trunk/register.rb +1 -1
- data/spec/command/trunk/push_spec.rb +48 -0
- data/spec/fixtures/BananaLib.podspec +25 -0
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd8fe859e2920ddba3c449b56c120e294b14cde
|
4
|
+
data.tar.gz: c9c5c3d1ed0c5e1eea9f82e3b00a03ed87dde6ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec5e95ef99c5864f7147346bd4316764ad6f08b5f8564557f7917feb924bc448b7179362361bb0a891f6cbc96fef07920e30963473f94eab2e5a7e8fa097aad4
|
7
|
+
data.tar.gz: f79b2506de975e6c535dedab7d337bb47866eee5452562a83d497600e347db372672c36b1ca29012a9cdb3b01174c0c804293095e2de83141df382f8b604900a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## 0.5.1
|
2
|
+
|
3
|
+
##### Enhancements
|
4
|
+
|
5
|
+
* Lint as a framework automatically. If needed, the `--use-libraries`
|
6
|
+
option allows linting as a static library.
|
7
|
+
[Boris Bügling](https://github.com/neonichu)
|
8
|
+
[#2912](https://github.com/CocoaPods/CocoaPods/issues/2912)
|
9
|
+
|
10
|
+
##### Bug Fixes
|
11
|
+
|
12
|
+
* Fix the detection of spec validation errors, and present the proper error
|
13
|
+
(and messages) to the user.
|
14
|
+
[Orta Therox](https://github.com/orta)
|
15
|
+
[#39](https://github.com/CocoaPods/cocoapods-trunk/issues/39)
|
16
|
+
|
17
|
+
|
1
18
|
## 0.5.0
|
2
19
|
|
3
20
|
##### Enhancements
|
data/Gemfile.lock
CHANGED
data/lib/cocoapods_trunk.rb
CHANGED
data/lib/pod/command/trunk.rb
CHANGED
@@ -50,20 +50,19 @@ module Pod
|
|
50
50
|
rescue JSON::ParserError
|
51
51
|
json = {}
|
52
52
|
end
|
53
|
+
error = json['error'] || "An unexpected error ocurred: #{body}"
|
53
54
|
|
54
|
-
case
|
55
|
+
case data = json['data']
|
55
56
|
when Hash
|
56
|
-
lines =
|
57
|
+
lines = data.sort_by(&:first).map do |attr, messages|
|
57
58
|
attr = attr[0, 1].upcase << attr[1..-1]
|
58
59
|
messages.sort.map do |message|
|
59
|
-
"- #{attr} #{message}
|
60
|
+
"- #{attr}: #{message}"
|
60
61
|
end
|
61
62
|
end.flatten
|
62
63
|
count = lines.size
|
63
64
|
lines.unshift "The following #{'validation'.pluralize(count)} failed:"
|
64
|
-
error
|
65
|
-
when nil
|
66
|
-
error = "An unexpected error ocurred: #{body}"
|
65
|
+
error += "\n" << lines.join("\n")
|
67
66
|
end
|
68
67
|
|
69
68
|
raise Informative, error
|
@@ -28,11 +28,13 @@ module Pod
|
|
28
28
|
def self.options
|
29
29
|
[
|
30
30
|
['--allow-warnings', 'Allows push even if there are lint warnings'],
|
31
|
+
['--use-libraries', 'Linter uses static libraries to install the spec'],
|
31
32
|
].concat(super)
|
32
33
|
end
|
33
34
|
|
34
35
|
def initialize(argv)
|
35
36
|
@allow_warnings = argv.flag?('allow-warnings')
|
37
|
+
@use_frameworks = !argv.flag?('use-libraries')
|
36
38
|
@path = argv.shift_argument || '.'
|
37
39
|
find_podspec_file if File.directory?(@path)
|
38
40
|
super
|
@@ -103,6 +105,7 @@ module Pod
|
|
103
105
|
|
104
106
|
validator = Validator.new(spec, %w(https://github.com/CocoaPods/Specs.git))
|
105
107
|
validator.allow_warnings = @allow_warnings
|
108
|
+
validator.use_frameworks = @use_frameworks
|
106
109
|
validator.validate
|
107
110
|
unless validator.validated?
|
108
111
|
raise Informative, 'The podspec does not validate.'
|
@@ -7,7 +7,7 @@ module Pod
|
|
7
7
|
Register a new account, or create a new session.
|
8
8
|
|
9
9
|
If this is your first registration, both an `EMAIL` address and your
|
10
|
-
`NAME` are required. If you
|
10
|
+
`NAME` are required. If you’ve already registered with trunk, you may
|
11
11
|
omit the `NAME` (unless you would like to change it).
|
12
12
|
|
13
13
|
It is recommended that you provide a description of the session, so
|
@@ -16,6 +16,25 @@ module Pod
|
|
16
16
|
exception.message.should.include 'register a session'
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'should error when the trunk service returns an error' do
|
20
|
+
url = 'https://trunk.cocoapods.org/api/v1/pods'
|
21
|
+
WebMock::API.stub_request(:post, url).to_return(:status => 422, :body => {
|
22
|
+
'error' => 'The Pod Specification did not pass validation.',
|
23
|
+
'data' => {
|
24
|
+
'warnings' => [
|
25
|
+
'A value for `requires_arc` should be specified until the migration to a `true` default.',
|
26
|
+
],
|
27
|
+
},
|
28
|
+
}.to_json)
|
29
|
+
command = Command.parse(%w(trunk push))
|
30
|
+
command.stubs(:validate_podspec)
|
31
|
+
command.stubs(:spec).returns(Pod::Specification.new)
|
32
|
+
exception = lambda { command.run }.should.raise Informative
|
33
|
+
exception.message.should.include 'following validation failed'
|
34
|
+
exception.message.should.include 'should be specified'
|
35
|
+
exception.message.should.include 'The Pod Specification did not pass validation'
|
36
|
+
end
|
37
|
+
|
19
38
|
describe 'PATH' do
|
20
39
|
before do
|
21
40
|
UI.output = ''
|
@@ -63,5 +82,34 @@ module Pod
|
|
63
82
|
UI.output.should.match /Multiple podspec files in directory/
|
64
83
|
end
|
65
84
|
end
|
85
|
+
|
86
|
+
describe 'validation' do
|
87
|
+
before do
|
88
|
+
Installer.any_instance.stubs(:aggregate_targets).returns([])
|
89
|
+
Installer.any_instance.stubs(:install!)
|
90
|
+
|
91
|
+
Validator.any_instance.stubs(:check_file_patterns)
|
92
|
+
Validator.any_instance.stubs(:validated?).returns(true)
|
93
|
+
Validator.any_instance.stubs(:validate_url)
|
94
|
+
Validator.any_instance.stubs(:validate_screenshots)
|
95
|
+
Validator.any_instance.stubs(:xcodebuild).returns('')
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'validates specs as frameworks by default' do
|
99
|
+
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, true).once
|
100
|
+
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, true).once
|
101
|
+
|
102
|
+
cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec))
|
103
|
+
cmd.send(:validate_podspec)
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'validates specs as libraries if requested' do
|
107
|
+
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, false).once
|
108
|
+
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false).once
|
109
|
+
|
110
|
+
cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec --use-libraries))
|
111
|
+
cmd.send(:validate_podspec)
|
112
|
+
end
|
113
|
+
end
|
66
114
|
end
|
67
115
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'BananaLib'
|
3
|
+
s.version = '1.0'
|
4
|
+
s.authors = 'Banana Corp', { 'Monkey Boy' => 'monkey@banana-corp.local' }
|
5
|
+
s.homepage = 'http://banana-corp.local/banana-lib.html'
|
6
|
+
s.summary = 'Chunky bananas!'
|
7
|
+
s.description = 'Full of chunky bananas.'
|
8
|
+
s.source = { :git => 'http://banana-corp.local/banana-lib.git', :tag => 'v1.0' }
|
9
|
+
s.license = {
|
10
|
+
:type => 'MIT',
|
11
|
+
:file => 'LICENSE',
|
12
|
+
:text => 'Permission is hereby granted ...'
|
13
|
+
}
|
14
|
+
s.source_files = 'Classes/*.{h,m,d}', 'Vendor'
|
15
|
+
s.resources = "Resources/*"
|
16
|
+
s.vendored_framework = 'Bananalib.framework'
|
17
|
+
s.vendored_library = 'libBananalib.a'
|
18
|
+
s.preserve_paths = 'preserve_me.txt'
|
19
|
+
s.public_header_files = 'Classes/Banana.h'
|
20
|
+
|
21
|
+
s.prefix_header_file = 'Classes/BananaLib.pch'
|
22
|
+
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework SystemConfiguration' }
|
23
|
+
s.dependency 'monkey', '~> 1.0.1', '< 1.0.9'
|
24
|
+
|
25
|
+
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-trunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Durán
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nap
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -42,28 +42,28 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description:
|
@@ -73,12 +73,12 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .kick
|
78
|
-
- .rubocop.yml
|
79
|
-
- .rubocop_cocoapods.yml
|
80
|
-
- .rubocop_todo.yml
|
81
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".kick"
|
78
|
+
- ".rubocop.yml"
|
79
|
+
- ".rubocop_cocoapods.yml"
|
80
|
+
- ".rubocop_todo.yml"
|
81
|
+
- ".travis.yml"
|
82
82
|
- CHANGELOG.md
|
83
83
|
- Gemfile
|
84
84
|
- Gemfile.lock
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- spec/command/trunk/register_spec.rb
|
103
103
|
- spec/command/trunk/remove_owner_spec.rb
|
104
104
|
- spec/command/trunk_spec.rb
|
105
|
+
- spec/fixtures/BananaLib.podspec
|
105
106
|
- spec/spec_helper.rb
|
106
107
|
homepage: ''
|
107
108
|
licenses:
|
@@ -113,17 +114,17 @@ require_paths:
|
|
113
114
|
- lib
|
114
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
|
-
- -
|
117
|
+
- - ">="
|
117
118
|
- !ruby/object:Gem::Version
|
118
119
|
version: 2.0.0
|
119
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
121
|
requirements:
|
121
|
-
- -
|
122
|
+
- - ">="
|
122
123
|
- !ruby/object:Gem::Version
|
123
124
|
version: '0'
|
124
125
|
requirements: []
|
125
126
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.4.5
|
127
128
|
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: Interact with trunk.cocoapods.org
|
@@ -135,4 +136,5 @@ test_files:
|
|
135
136
|
- spec/command/trunk/register_spec.rb
|
136
137
|
- spec/command/trunk/remove_owner_spec.rb
|
137
138
|
- spec/command/trunk_spec.rb
|
139
|
+
- spec/fixtures/BananaLib.podspec
|
138
140
|
- spec/spec_helper.rb
|