cocoapods-trunk 1.3.1 → 1.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1143752d39161f0c8e0e906b3e48988ae27c70734c63b1974c647c5db664a18
4
- data.tar.gz: 6f2619d9525eecaf3d2dcb94b297d66c5c2e35f3da7031f7f2b3c14c23448e86
3
+ metadata.gz: 4b3bc8b97075a3ccef4bf732006d05ee7a3c17fa6f4b8ed5c7b3cf585091caac
4
+ data.tar.gz: 2265b69fcca3c4868631be9cdaae6259aaade1ff184c54bb39fb96de0b5453c2
5
5
  SHA512:
6
- metadata.gz: 167649106ee8e3cb984964fc44f938c4f68e981e8775d6a95ca6e0c4a0ccb49f8833f91553e75314ffdae5d99af4b613d16c8d7f15c0ee37932d8877d0490a9a
7
- data.tar.gz: 57d2aa6efecf2a631df0d58735d58ee54dd21ae9188d4ea1a276f607c34e5057cb54fc2399d8c88dc6ecac9e87048ca418f675c154d83ce7d75a4349aba9df17
6
+ metadata.gz: a35ddecad29e7e99c6efd3f6171471d16824fdbcf3b2fe81faa99fd0f3266271a2cb57223d0e49c67db1367992576cc7ea5ca7d7ef3f3c95a4c5f551c6d0a2b2
7
+ data.tar.gz: 349a6a173998300f3141c6c2024c5dbe618d992e94c2558f0f8e719bd16a9c64e4e69d3e22c854e69a07ab3855917c8633bef50a8d3a89988b502f0363ba5a33
@@ -0,0 +1,64 @@
1
+ name: Specs
2
+
3
+ jobs:
4
+ specs:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ task: [SPECS]
9
+ ruby: [2.6, 2.7]
10
+ os: [ubuntu-16.04]
11
+ include:
12
+ - task: SPECS
13
+ os: macos-10.15
14
+ ruby: system
15
+
16
+ name: ${{ matrix.task }} / ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
17
+ runs-on: ${{ matrix.os }}
18
+
19
+ steps:
20
+ - name: Set build image var
21
+ run: echo "ImageVersion=$ImageVersion" >> $GITHUB_ENV
22
+
23
+ - name: Checkout git
24
+ uses: actions/checkout@v1
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ if: ${{ matrix.ruby != 'system' }}
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+
32
+ - name: Update git submodules
33
+ run: git submodule update --init
34
+
35
+ - uses: actions/cache@v2
36
+ with:
37
+ path: vendor/bundle
38
+ key: gems@v1-${{ matrix.os }}-${{ env.ImageVersion }}-Ruby${{ matrix.ruby }}-${{ hashFiles('Gemfile.lock') }}
39
+ restore-keys: |
40
+ gems@v1-${{ matrix.os }}-${{ env.ImageVersion }}-Ruby${{ matrix.ruby }}-
41
+ - name: Run bundle install
42
+ run: |
43
+ gem install bundler -v "~> 1.17"
44
+ bundle config path vendor/bundle
45
+ bundle install --jobs 4 --retry 3 --without debugging documentation
46
+ - name: Set up git identity
47
+ run: |
48
+ git config --global user.email "tests@cocoapods.org"
49
+ git config --global user.name "CocoaPods Tests"
50
+
51
+ - name: Run Tests
52
+ run: bundle exec rake spec
53
+ env:
54
+ COCOAPODS_CI_TASKS: ${{ matrix.task }}
55
+
56
+ on:
57
+ push:
58
+ branches:
59
+ - "master"
60
+ - "*-stable"
61
+ pull_request:
62
+ branches:
63
+ - master
64
+ - "*-stable"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,55 @@
1
+ ## 1.6.0 (2021-09-01)
2
+
3
+ ##### Enhancements
4
+
5
+ * None.
6
+
7
+ ##### Bug Fixes
8
+
9
+ * None.
10
+
11
+
12
+ ## 1.5.0 (2020-05-01)
13
+
14
+ ##### Enhancements
15
+
16
+ * Add --synchronous option to `pod trunk push`.
17
+ [Paul Beusterien](https://github.com/paulb777)
18
+ [#147](https://github.com/CocoaPods/cocoapods-trunk/pull/147)
19
+ [CocoaPods#9497](https://github.com/CocoaPods/CocoaPods/issues/9497)
20
+
21
+ ##### Bug Fixes
22
+
23
+ * None.
24
+
25
+
26
+ ## 1.4.1 (2019-09-26)
27
+
28
+ ##### Enhancements
29
+
30
+ * None.
31
+
32
+ ##### Bug Fixes
33
+
34
+ * Use a more robust `Trunk` init when pushing.
35
+ [Igor Makarov](https://github.com/igor-makarov)
36
+ [#135](https://github.com/CocoaPods/cocoapods-trunk/pull/135)
37
+
38
+
39
+ ## 1.4.0 (2019-08-21)
40
+
41
+ ##### Enhancements
42
+
43
+ * None.
44
+
45
+ ##### Bug Fixes
46
+
47
+ * Update to get the master spec repo from `Source::Manager` for validation - effectively
48
+ use the new CDN `TrunkSource` for podspec validation and not a hard-coded URL
49
+ [Igor Makarov](https://github.com/igor-makarov)
50
+ [#132](https://github.com/CocoaPods/cocoapods-trunk/pull/132)
51
+ [CocoaPods#9112](https://github.com/CocoaPods/CocoaPods/issues/9112)
52
+
1
53
  ## 1.3.1 (2018-08-16)
2
54
 
3
55
  ##### Enhancements
data/Gemfile.lock CHANGED
@@ -1,44 +1,49 @@
1
1
  GIT
2
2
  remote: https://github.com/CocoaPods/CLAide.git
3
- revision: 7f26d3d016efeea728ed0e608357e910d4c6e8f9
3
+ revision: a5d1a29b08ca88f90f47104805bc4fad2efc93c9
4
4
  branch: master
5
5
  specs:
6
- claide (1.0.2)
6
+ claide (1.0.3)
7
7
 
8
8
  GIT
9
9
  remote: https://github.com/CocoaPods/CocoaPods.git
10
- revision: a75a2e85e262c3c38d1a2fa9e0f5de01cc6a3368
10
+ revision: 035518e56945778e9916d8118ea5e61ecb96beb0
11
11
  branch: master
12
12
  specs:
13
- cocoapods (1.3.1)
14
- activesupport (>= 4.0.2, < 5)
13
+ cocoapods (1.11.0)
14
+ addressable (~> 2.8)
15
15
  claide (>= 1.0.2, < 2.0)
16
- cocoapods-core (= 1.3.1)
17
- cocoapods-deintegrate (>= 1.0.1, < 2.0)
18
- cocoapods-downloader (>= 1.1.3, < 2.0)
16
+ cocoapods-core (= 1.11.0)
17
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
18
+ cocoapods-downloader (>= 1.4.0, < 2.0)
19
19
  cocoapods-plugins (>= 1.0.0, < 2.0)
20
20
  cocoapods-search (>= 1.0.0, < 2.0)
21
- cocoapods-stats (>= 1.0.0, < 2.0)
22
- cocoapods-trunk (= 1.3.1)
21
+ cocoapods-trunk (= 1.6.0)
23
22
  cocoapods-try (>= 1.1.0, < 2.0)
24
23
  colored2 (~> 3.1)
25
24
  escape (~> 0.0.4)
26
- fourflusher (~> 2.0.1)
25
+ fourflusher (>= 2.3.0, < 3.0)
27
26
  gh_inspector (~> 1.0)
28
- molinillo (~> 0.6.1)
27
+ molinillo (~> 0.8.0)
29
28
  nap (~> 1.0)
30
- ruby-macho (~> 1.1)
31
- xcodeproj (>= 1.5.1, < 2.0)
29
+ ruby-macho (>= 1.0, < 3.0)
30
+ xcodeproj (>= 1.21.0, < 2.0)
32
31
 
33
32
  GIT
34
33
  remote: https://github.com/CocoaPods/Core.git
35
- revision: 77f5b2081bf347db73e5978737633e1943dc5f29
34
+ revision: a8e38de9907968d6e627b1465f053c55fc778118
36
35
  branch: master
37
36
  specs:
38
- cocoapods-core (1.3.1)
39
- activesupport (>= 4.0.2, < 6)
37
+ cocoapods-core (1.11.0)
38
+ activesupport (>= 5.0, < 7)
39
+ addressable (~> 2.8)
40
+ algoliasearch (~> 1.0)
41
+ concurrent-ruby (~> 1.1)
40
42
  fuzzy_match (~> 2.0.4)
41
43
  nap (~> 1.0)
44
+ netrc (~> 0.11)
45
+ public_suffix (~> 4.0)
46
+ typhoeus (~> 1.0)
42
47
 
43
48
  GIT
44
49
  remote: https://github.com/segiddins/json.git
@@ -50,43 +55,52 @@ GIT
50
55
  PATH
51
56
  remote: .
52
57
  specs:
53
- cocoapods-trunk (1.3.1)
58
+ cocoapods-trunk (1.6.0)
54
59
  nap (>= 0.8, < 2.0)
55
60
  netrc (~> 0.11)
56
61
 
57
62
  GEM
58
63
  remote: https://rubygems.org/
59
64
  specs:
60
- CFPropertyList (2.3.5)
61
- activesupport (4.2.9)
62
- i18n (~> 0.7)
63
- minitest (~> 5.1)
64
- thread_safe (~> 0.3, >= 0.3.4)
65
- tzinfo (~> 1.1)
66
- addressable (2.5.1)
67
- public_suffix (~> 2.0, >= 2.0.2)
65
+ CFPropertyList (3.0.3)
66
+ activesupport (6.1.4.1)
67
+ concurrent-ruby (~> 1.0, >= 1.0.2)
68
+ i18n (>= 1.6, < 2)
69
+ minitest (>= 5.1)
70
+ tzinfo (~> 2.0)
71
+ zeitwerk (~> 2.3)
72
+ addressable (2.8.0)
73
+ public_suffix (>= 2.0.2, < 5.0)
74
+ algoliasearch (1.27.5)
75
+ httpclient (~> 2.8, >= 2.8.3)
76
+ json (>= 1.5.1)
68
77
  ast (2.2.0)
78
+ atomos (0.1.3)
69
79
  bacon (1.2.0)
70
- cocoapods-deintegrate (1.0.1)
71
- cocoapods-downloader (1.1.3)
80
+ cocoapods-deintegrate (1.0.5)
81
+ cocoapods-downloader (1.5.0)
72
82
  cocoapods-plugins (1.0.0)
73
83
  nap
74
- cocoapods-search (1.0.0)
75
- cocoapods-stats (1.0.0)
76
- cocoapods-try (1.1.0)
84
+ cocoapods-search (1.0.1)
85
+ cocoapods-try (1.2.0)
77
86
  codeclimate-test-reporter (0.4.7)
78
87
  simplecov (>= 0.7.1, < 1.0.0)
79
88
  colored2 (3.1.2)
89
+ concurrent-ruby (1.1.9)
80
90
  crack (0.4.3)
81
91
  safe_yaml (~> 1.0.0)
82
92
  docile (1.1.5)
83
93
  escape (0.0.4)
84
- ffi (1.9.10)
85
- fourflusher (2.0.1)
94
+ ethon (0.14.0)
95
+ ffi (>= 1.15.0)
96
+ ffi (1.15.3)
97
+ fourflusher (2.3.1)
86
98
  fuzzy_match (2.0.4)
87
- gh_inspector (1.0.3)
99
+ gh_inspector (1.1.3)
88
100
  hashdiff (0.3.4)
89
- i18n (0.8.6)
101
+ httpclient (2.8.3)
102
+ i18n (1.8.10)
103
+ concurrent-ruby (~> 1.0)
90
104
  kicker (3.0.0)
91
105
  listen (~> 1.3.0)
92
106
  notify (~> 0.5.2)
@@ -95,14 +109,14 @@ GEM
95
109
  rb-inotify (>= 0.9)
96
110
  rb-kqueue (>= 0.2)
97
111
  metaclass (0.0.4)
98
- minitest (5.10.3)
112
+ minitest (5.14.4)
99
113
  mocha (1.1.0)
100
114
  metaclass (~> 0.0.1)
101
115
  mocha-on-bacon (0.2.2)
102
116
  mocha (>= 0.13.0)
103
- molinillo (0.6.3)
117
+ molinillo (0.8.0)
104
118
  multi_json (1.11.2)
105
- nanaimo (0.2.3)
119
+ nanaimo (0.3.0)
106
120
  nap (1.1.0)
107
121
  netrc (0.11.0)
108
122
  notify (0.5.2)
@@ -111,7 +125,7 @@ GEM
111
125
  powerpack (0.1.1)
112
126
  prettybacon (0.0.2)
113
127
  bacon (~> 1.2)
114
- public_suffix (2.0.5)
128
+ public_suffix (4.0.6)
115
129
  rainbow (2.1.0)
116
130
  rake (10.4.2)
117
131
  rb-fsevent (0.9.5)
@@ -119,13 +133,14 @@ GEM
119
133
  ffi (>= 0.5.0)
120
134
  rb-kqueue (0.2.4)
121
135
  ffi (>= 0.5.0)
136
+ rexml (3.2.5)
122
137
  rubocop (0.39.0)
123
138
  parser (>= 2.3.0.7, < 3.0)
124
139
  powerpack (~> 0.1)
125
140
  rainbow (>= 1.99.1, < 3.0)
126
141
  ruby-progressbar (~> 1.7)
127
142
  unicode-display_width (~> 1.0, >= 1.0.1)
128
- ruby-macho (1.1.0)
143
+ ruby-macho (2.5.1)
129
144
  ruby-progressbar (1.7.5)
130
145
  safe_yaml (1.0.4)
131
146
  simplecov (0.9.2)
@@ -133,19 +148,23 @@ GEM
133
148
  multi_json (~> 1.0)
134
149
  simplecov-html (~> 0.9.0)
135
150
  simplecov-html (0.9.0)
136
- thread_safe (0.3.6)
137
- tzinfo (1.2.3)
138
- thread_safe (~> 0.1)
151
+ typhoeus (1.4.0)
152
+ ethon (>= 0.9.0)
153
+ tzinfo (2.0.4)
154
+ concurrent-ruby (~> 1.0)
139
155
  unicode-display_width (1.0.3)
140
- webmock (3.0.1)
156
+ webmock (3.5.1)
141
157
  addressable (>= 2.3.6)
142
158
  crack (>= 0.3.2)
143
159
  hashdiff
144
- xcodeproj (1.5.1)
145
- CFPropertyList (~> 2.3.3)
160
+ xcodeproj (1.21.0)
161
+ CFPropertyList (>= 2.3.3, < 4.0)
162
+ atomos (~> 0.1.3)
146
163
  claide (>= 1.0.2, < 2.0)
147
164
  colored2 (~> 3.1)
148
- nanaimo (~> 0.2.3)
165
+ nanaimo (~> 0.3.0)
166
+ rexml (~> 3.2.4)
167
+ zeitwerk (2.4.2)
149
168
 
150
169
  PLATFORMS
151
170
  ruby
@@ -168,4 +187,4 @@ DEPENDENCIES
168
187
  webmock
169
188
 
170
189
  BUNDLED WITH
171
- 1.16.3
190
+ 1.17.3
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # CocoaPods::Trunk
2
2
 
3
- [![Build Status](https://img.shields.io/travis/CocoaPods/cocoapods-trunk/master.svg?style=flat)](https://travis-ci.org/CocoaPods/cocoapods-trunk)
4
- [![Coverage](https://img.shields.io/codeclimate/coverage/github/CocoaPods/cocoapods-trunk.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-trunk)
5
- [![Code Climate](https://img.shields.io/codeclimate/github/CocoaPods/cocoapods-trunk.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-trunk)
3
+ [![Build Status](https://img.shields.io/github/workflow/status/CocoaPods/cocoapods-trunk/Specs)](https://github.com/CocoaPods/cocoapods-trunk/actions)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/157b8b7f7b73976f3edf/maintainability)](https://codeclimate.com/github/CocoaPods/cocoapods-trunk/maintainability)
6
5
 
7
6
  CocoaPods plugin for trunk.
8
7
 
@@ -1,3 +1,3 @@
1
1
  module CocoaPodsTrunk
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
@@ -7,7 +7,7 @@ module Pod
7
7
  self.summary = 'Publish a podspec'
8
8
  self.description = <<-DESC
9
9
  Publish the podspec at `PATH` to make it available to all users of
10
- the ‘master’ spec-repo. If `PATH` is not provided, defaults to the
10
+ the ‘trunk’ spec-repo. If `PATH` is not provided, defaults to the
11
11
  current directory.
12
12
 
13
13
  Before pushing the podspec to cocoapods.org, this will perform a local
@@ -36,6 +36,7 @@ module Pod
36
36
  'This takes precedence over a .swift-version file.'],
37
37
  ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
38
38
  ['--skip-tests', 'Lint skips building and running tests during validation'],
39
+ ['--synchronous', 'If validation depends on other recently pushed pods, synchronize'],
39
40
  ].concat(super)
40
41
  end
41
42
 
@@ -47,6 +48,7 @@ module Pod
47
48
  @skip_import_validation = argv.flag?('skip-import-validation', false)
48
49
  @skip_tests = argv.flag?('skip-tests', false)
49
50
  @path = argv.shift_argument || '.'
51
+ @synchronous = argv.flag?('synchronous', false)
50
52
  find_podspec_file if File.directory?(@path)
51
53
  super
52
54
  end
@@ -54,7 +56,7 @@ module Pod
54
56
  def validate!
55
57
  super
56
58
  unless token
57
- help! 'You need to register a session first.'
59
+ help! 'You need to run `pod trunk register` to register a session first.'
58
60
  end
59
61
  unless @path
60
62
  help! 'Please specify the path to the podspec file.'
@@ -80,6 +82,8 @@ module Pod
80
82
 
81
83
  private
82
84
 
85
+ MASTER_GIT_REPO_URL = 'https://github.com/CocoaPods/Specs.git'.freeze
86
+
83
87
  def push_to_trunk
84
88
  spec.attributes_hash[:pushed_with_swift_version] = @swift_version if @swift_version
85
89
  response = request_path(:post, "pods?allow_warnings=#{@allow_warnings}",
@@ -118,7 +122,7 @@ module Pod
118
122
  def validate_podspec
119
123
  UI.puts 'Validating podspec'.yellow
120
124
 
121
- validator = Validator.new(spec, %w(https://github.com/CocoaPods/Specs.git))
125
+ validator = Validator.new(spec, [repo_url])
122
126
  validator.allow_warnings = @allow_warnings
123
127
  validator.use_frameworks = @use_frameworks
124
128
  if validator.respond_to?(:use_modular_headers=)
@@ -139,16 +143,24 @@ module Pod
139
143
  @swift_version = validator.respond_to?(:used_swift_version) && validator.used_swift_version
140
144
  end
141
145
 
146
+ def repo_url
147
+ @synchronous ? MASTER_GIT_REPO_URL : Pod::TrunkSource::TRUNK_REPO_URL
148
+ end
149
+
142
150
  def update_master_repo
143
- sources_manager = if defined?(Pod::SourcesManager)
144
- Pod::SourcesManager
145
- else
146
- config.sources_manager
147
- end
148
- if sources_manager.master_repo_functional?
149
- sources_manager.update('master')
151
+ # more robust Trunk setup logic:
152
+ # - if Trunk exists, updates it
153
+ # - if Trunk doesn't exist, add it and update it
154
+ #
155
+ repo = sources_manager.find_or_create_source_with_url(repo_url)
156
+ sources_manager.update(repo.name)
157
+ end
158
+
159
+ def sources_manager
160
+ if defined?(Pod::SourcesManager)
161
+ Pod::SourcesManager
150
162
  else
151
- Setup.invoke
163
+ config.sources_manager
152
164
  end
153
165
  end
154
166
  end
@@ -20,20 +20,21 @@ module Pod
20
20
  end
21
21
 
22
22
  it 'confirms deletion' do
23
+ Colored2.disable!
23
24
  UI.inputs += %w(garbage true false)
24
25
  command = Command.parse(%w( trunk delete Stencil 1.0.0 ))
25
26
  command.send(:confirm_deletion?).should.be.true
26
27
  command.send(:confirm_deletion?).should.be.false
27
28
 
28
29
  UI.output.should == <<-OUTPUT.gsub(/^>$/, '> ')
29
- \e[33mWARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
30
- Please consider using the `deprecate` command instead.\e[0m
30
+ WARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
31
+ Please consider using the `deprecate` command instead.
31
32
  Are you sure you want to delete this Pod version?
32
33
  >
33
34
  Are you sure you want to delete this Pod version?
34
35
  >
35
- \e[33mWARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
36
- Please consider using the `deprecate` command instead.\e[0m
36
+ WARNING: It is generally considered bad behavior to remove versions of a Pod that others are depending on!
37
+ Please consider using the `deprecate` command instead.
37
38
  Are you sure you want to delete this Pod version?
38
39
  >
39
40
  OUTPUT
@@ -104,6 +104,7 @@ module Pod
104
104
  describe 'validation' do
105
105
  before do
106
106
  Installer.any_instance.stubs(:aggregate_targets).returns([])
107
+ Installer.any_instance.stubs(:pod_targets).returns([])
107
108
 
108
109
  Validator.any_instance.stubs(:check_file_patterns)
109
110
  Validator.any_instance.stubs(:validate_url)
@@ -113,9 +114,11 @@ module Pod
113
114
  Validator.any_instance.stubs(:build_pod)
114
115
  Validator.any_instance.stubs(:add_app_project_import)
115
116
  Validator.any_instance.stubs(:used_swift_version).returns(nil)
116
- %i(prepare resolve_dependencies download_dependencies).each do |m|
117
+ %i(prepare resolve_dependencies download_dependencies write_lockfiles).each do |m|
117
118
  Installer.any_instance.stubs(m)
118
119
  end
120
+ Command::Trunk::Push.any_instance.stubs(:master_repo_url).
121
+ returns(Pod::TrunkSource::TRUNK_REPO_URL)
119
122
  end
120
123
 
121
124
  it 'passes the SWIFT_VERSION to the Validator' do
@@ -136,13 +139,13 @@ module Pod
136
139
 
137
140
  it 'validates specs as frameworks by default' do
138
141
  Validator.any_instance.expects(:podfile_from_spec).
139
- with(:ios, '8.0', true, []).once.returns(Podfile.new)
142
+ with(:ios, '8.0', true, [], nil, nil).once.returns(Podfile.new)
140
143
  Validator.any_instance.expects(:podfile_from_spec).
141
- with(:osx, nil, true, []).once.returns(Podfile.new)
144
+ with(:osx, nil, true, [], nil, nil).once.returns(Podfile.new)
142
145
  Validator.any_instance.expects(:podfile_from_spec).
143
- with(:tvos, nil, true, []).once.returns(Podfile.new)
146
+ with(:tvos, nil, true, [], nil, nil).once.returns(Podfile.new)
144
147
  Validator.any_instance.expects(:podfile_from_spec).
145
- with(:watchos, nil, true, []).once.returns(Podfile.new)
148
+ with(:watchos, nil, true, [], nil, nil).once.returns(Podfile.new)
146
149
 
147
150
  cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec))
148
151
  cmd.send(:validate_podspec)
@@ -150,13 +153,13 @@ module Pod
150
153
 
151
154
  it 'validates specs as libraries if requested' do
152
155
  Validator.any_instance.expects(:podfile_from_spec).
153
- with(:ios, nil, false, []).once.returns(Podfile.new)
156
+ with(:ios, nil, false, [], nil, nil).once.returns(Podfile.new)
154
157
  Validator.any_instance.expects(:podfile_from_spec).
155
- with(:osx, nil, false, []).once.returns(Podfile.new)
158
+ with(:osx, nil, false, [], nil, nil).once.returns(Podfile.new)
156
159
  Validator.any_instance.expects(:podfile_from_spec).
157
- with(:tvos, nil, false, []).once.returns(Podfile.new)
160
+ with(:tvos, nil, false, [], nil, nil).once.returns(Podfile.new)
158
161
  Validator.any_instance.expects(:podfile_from_spec).
159
- with(:watchos, nil, false, []).once.returns(Podfile.new)
162
+ with(:watchos, nil, false, [], nil, nil).once.returns(Podfile.new)
160
163
 
161
164
  cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec --use-libraries))
162
165
  cmd.send(:validate_podspec)
@@ -231,19 +234,62 @@ module Pod
231
234
  @cmd.stubs(:validate_podspec)
232
235
  @cmd.stubs(:push_to_trunk).returns([200, success_json])
233
236
  Command::Trunk::Push.any_instance.unstub(:update_master_repo)
237
+ Command::Trunk::Push.any_instance.stubs(:master_repo_name).
238
+ returns(Pod::TrunkSource::TRUNK_REPO_NAME)
234
239
  end
235
240
 
236
241
  it 'updates the master repo when it exists' do
237
- Config.instance.sources_manager.stubs(:master_repo_functional?).returns(true)
238
- Config.instance.sources_manager.expects(:update).with('master').twice
242
+ Config.instance.sources_manager.stubs(:source_with_url).
243
+ at_most(2).
244
+ returns(Pod::TrunkSource.new(Pod::TrunkSource::TRUNK_REPO_NAME))
245
+
246
+ Config.instance.sources_manager.expects(:update).with(Pod::TrunkSource::TRUNK_REPO_NAME).twice
247
+ Command::Repo::AddCDN.any_instance.expects(:run).never
239
248
 
240
249
  @cmd.run
241
250
  end
242
251
 
243
252
  it 'sets up the master repo when it does not exist' do
244
- Config.instance.sources_manager.stubs(:master_repo_functional?).returns(false)
245
- Config.instance.sources_manager.expects(:update).never
246
- Command::Setup.any_instance.expects(:run).twice
253
+ Config.instance.sources_manager.stubs(:source_with_url).
254
+ at_most(3).
255
+ returns(nil).
256
+ returns(Pod::TrunkSource.new(Pod::TrunkSource::TRUNK_REPO_NAME))
257
+ Config.instance.sources_manager.expects(:update).with(Pod::TrunkSource::TRUNK_REPO_NAME).twice
258
+ Command::Repo::AddCDN.any_instance.expects(:run)
259
+
260
+ @cmd.run
261
+ end
262
+ end
263
+
264
+ describe 'synchronous updating the git repo' do
265
+ before do
266
+ @cmd = Command.parse(%w(trunk push spec/fixtures/BananaLib.podspec --synchronous))
267
+ @cmd.stubs(:validate_podspec)
268
+ @cmd.stubs(:push_to_trunk).returns([200, success_json])
269
+ Command::Trunk::Push.any_instance.unstub(:update_master_repo)
270
+ Command::Trunk::Push.any_instance.stubs(:master_repo_name).returns('master')
271
+ end
272
+
273
+ it 'updates the git repo when it exists' do
274
+ Config.instance.sources_manager.stubs(:source_with_url).
275
+ at_most(2).
276
+ returns(Pod::TrunkSource.new('master'))
277
+
278
+ Config.instance.sources_manager.expects(:update).with('master').twice
279
+ Command::Repo::AddCDN.any_instance.expects(:run).never
280
+
281
+ @cmd.run
282
+ end
283
+
284
+ it 'sets up the git repo when it does not exist' do
285
+ Config.instance.sources_manager.stubs(:source_with_url).
286
+ at_most(3).
287
+ returns(nil).
288
+ returns(Pod::TrunkSource.new('master'))
289
+ Config.instance.sources_manager.stubs(:cdn_url?).returns(false)
290
+ Config.instance.sources_manager.stubs(:create_source_with_url).once.
291
+ returns(Pod::TrunkSource.new('master'))
292
+ Config.instance.sources_manager.expects(:update).with('master').twice
247
293
 
248
294
  @cmd.run
249
295
  end
data/spec/spec_helper.rb CHANGED
@@ -25,7 +25,7 @@ require 'webmock'
25
25
 
26
26
  include WebMock::API
27
27
  WebMock.enable!
28
- WebMock.disable_net_connect!(:allow => 'codeclimate.com')
28
+ WebMock.disable_net_connect!(:allow => ['codeclimate.com', 'cdn.cocoapods.org'])
29
29
 
30
30
  require 'cocoapods'
31
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-trunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Durán
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-16 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nap
@@ -72,19 +72,19 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '10.0'
75
- description:
75
+ description:
76
76
  email:
77
77
  - eloy.de.enige@gmail.com
78
78
  executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
+ - ".github/workflows/ci.yml"
82
83
  - ".gitignore"
83
84
  - ".kick"
84
85
  - ".rubocop.yml"
85
86
  - ".rubocop_cocoapods.yml"
86
87
  - ".rubocop_todo.yml"
87
- - ".travis.yml"
88
88
  - CHANGELOG.md
89
89
  - Gemfile
90
90
  - Gemfile.lock
@@ -118,7 +118,7 @@ homepage: https://github.com/CocoaPods/cocoapods-trunk
118
118
  licenses:
119
119
  - MIT
120
120
  metadata: {}
121
- post_install_message:
121
+ post_install_message:
122
122
  rdoc_options: []
123
123
  require_paths:
124
124
  - lib
@@ -133,9 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.7.7
138
- signing_key:
136
+ rubygems_version: 3.1.6
137
+ signing_key:
139
138
  specification_version: 4
140
139
  summary: Interact with trunk.cocoapods.org
141
140
  test_files:
data/.travis.yml DELETED
@@ -1,24 +0,0 @@
1
- dist: trusty
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.0.0-p647
6
- - 2.3.4
7
- - 2.4.1
8
- addons:
9
- code_climate:
10
- repo_token: 937468c2cbb0d7c0546b62d0fcbcba8a2a8b82714a64a52ffd0b951e71df626d
11
-
12
- before_install:
13
- - export GEM_HOME=$HOME/.gem
14
- - export PATH=$GEM_HOME/bin:$PATH
15
- # There is a bug in travis. When using system ruby, bundler is not
16
- # installed and causes the default install action to fail.
17
- - if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem install "bundler:~> 1.13"; else gem install "bundler:~> 1.13"; fi
18
- # RubyGems 2.0.14 isn't a fun time on 2.0.0p451
19
- - if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem update --system; fi
20
-
21
- install:
22
- - bundle install --without=documentation
23
-
24
- script: bundle exec rake spec