Skip to content

Commit

Permalink
Merge pull request #136 from CocoaPods/merge141_into_master
Browse files Browse the repository at this point in the history
Merge `1-4-stable` (1.4.1) into `master`
  • Loading branch information
dnkoutso authored Sep 26, 2019
2 parents 1063214 + be4ac48 commit 6795930
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
* None.


## 1.4.1 (2019-09-26)

##### Enhancements

* None.

##### Bug Fixes

* Use a more robust `Trunk` init when pushing.
[Igor Makarov](https://github.com/igor-makarov)
[#135](https://github.com/CocoaPods/cocoapods-trunk/pull/135)


## 1.4.0 (2019-08-21)

##### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GIT
PATH
remote: .
specs:
cocoapods-trunk (1.4.0)
cocoapods-trunk (1.4.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)

Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods_trunk.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module CocoaPodsTrunk
VERSION = '1.4.0'.freeze
VERSION = '1.4.1'.freeze
end
11 changes: 6 additions & 5 deletions lib/pod/command/trunk/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ def validate_podspec
end

def update_master_repo
if sources_manager.master_repo_functional?
sources_manager.update(master_repo_name)
else
Setup.invoke
end
# more robust Trunk setup logic:
# - if Trunk exists, updates it
# - if Trunk doesn't exist, add it and update it
#
trunk = sources_manager.find_or_create_source_with_url(Pod::TrunkSource::TRUNK_REPO_URL)
sources_manager.update(trunk.name)
end

def master_repo_name
Expand Down
16 changes: 12 additions & 4 deletions spec/command/trunk/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,24 @@ def found_podspec_among_files(files)
end

it 'updates the master repo when it exists' do
Config.instance.sources_manager.stubs(:master_repo_functional?).returns(true)
Config.instance.sources_manager.stubs(:source_with_url).
at_most(2).
returns(Pod::TrunkSource.new(Pod::TrunkSource::TRUNK_REPO_NAME)).
returns(Pod::TrunkSource.new(Pod::TrunkSource::TRUNK_REPO_NAME))

Config.instance.sources_manager.expects(:update).with(Pod::TrunkSource::TRUNK_REPO_NAME).twice
Command::Repo::AddCDN.any_instance.expects(:run).never

@cmd.run
end

it 'sets up the master repo when it does not exist' do
Config.instance.sources_manager.stubs(:master_repo_functional?).returns(false)
Config.instance.sources_manager.expects(:update).never
Command::Setup.any_instance.expects(:run).twice
Config.instance.sources_manager.stubs(:source_with_url).
at_most(3).
returns(nil).
returns(Pod::TrunkSource.new(Pod::TrunkSource::TRUNK_REPO_NAME))
Config.instance.sources_manager.expects(:update).with(Pod::TrunkSource::TRUNK_REPO_NAME).twice
Command::Repo::AddCDN.any_instance.expects(:run)

@cmd.run
end
Expand Down

0 comments on commit 6795930

Please sign in to comment.