Skip to content

Commit

Permalink
Merge pull request #766 from CocoaPods/1-15-stable
Browse files Browse the repository at this point in the history
Merge 1-15-stable
  • Loading branch information
amorde committed Feb 6, 2024
2 parents 745dbe5 + 53b5af3 commit 677d918
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 23 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
* None.


## 1.15.1 (2024-02-06)

##### Enhancements

* None.

##### Bug Fixes

* Accept any casing for platform names in `Platform.new`.
[Eric Amorde](https://github.com/amorde)
[#765](https://github.com/CocoaPods/Core/pull/765)

## 1.15.0 (2024-01-28)

##### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
cocoapods-core (1.15.0)
cocoapods-core (1.15.1)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand Down Expand Up @@ -61,7 +61,7 @@ GEM
rb-kqueue (>= 0.2)
metaclass (0.0.4)
method_source (1.0.0)
minitest (5.21.2)
minitest (5.22.0)
mocha (1.4.0)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.3)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-core/gem_version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Pod
# The version of the cocoapods-core.
#
CORE_VERSION = '1.15.0'.freeze unless defined? Pod::CORE_VERSION
CORE_VERSION = '1.15.1'.freeze unless defined? Pod::CORE_VERSION
end
24 changes: 13 additions & 11 deletions lib/cocoapods-core/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,19 @@ def initialize(input, target = nil)
@symbolic_name = input.name
@deployment_target = input.deployment_target
else
# Allow `Platform.new('macos')` to be equivalent to `Platform.macos`
if input == 'macos'
input = 'osx'
elsif input == 'xros'
# To address the issue of the mismatch between the platform: xros in the XCFramework and the platform:
# visionos in Cocoapods.
#
# This will ensure proper alignment between the platform information in the XCFramework and Cocoapods.
input = 'visionos'
end
@symbolic_name = input.to_sym
input = input.to_s.downcase

name = case input
when 'macos'
# Allow `Platform.new('macos')` to be equivalent to `Platform.macos`
'osx'
when 'xros'
# Compatibility with older references to 'xrOS'
'visionos'
else
input
end
@symbolic_name = name.to_sym
target = target[:deployment_target] if target.is_a?(Hash)
@deployment_target = Version.create(target)
end
Expand Down
33 changes: 24 additions & 9 deletions spec/platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,30 @@ module Pod
@platform.name.should == :ios
end

it 'can be initialized with a string symbolic name' do
platform = Platform.new('ios')
platform.name.should == :ios
end
it 'can be initialized with a string' do
Platform.new('MACOS').should == Platform.macos
Platform.new('macOS').should == Platform.macos
Platform.new('macos').should == Platform.macos

Platform.new('iOS').should == Platform.ios
Platform.new('IOS').should == Platform.ios
Platform.new('ios').should == Platform.ios

Platform.new('tvos').should == Platform.tvos
Platform.new('tvOS').should == Platform.tvos
Platform.new('TVOS').should == Platform.tvos

Platform.new('watchOS').should == Platform.watchos
Platform.new('WATCHOS').should == Platform.watchos
Platform.new('watchos').should == Platform.watchos

it 'can be initialized with a string representing macOS' do
platform = Platform.new('macos')
platform.name.should == :osx
platform.string_name.should == 'macOS'
Platform.new('visionos').should == Platform.visionos
Platform.new('VISIONOS').should == Platform.visionos
Platform.new('visionOS').should == Platform.visionos
# Recognizes xrOS
Platform.new('xros').should == Platform.visionos
Platform.new('XROS').should == Platform.visionos
Platform.new('xrOS').should == Platform.visionos
end

it 'exposes its name as string' do
Expand Down Expand Up @@ -83,7 +98,7 @@ module Pod
Platform.new(:tvos, '9.0').to_s.should == 'tvOS 9.0'
end

it 'uses its name as its symbold version' do
it 'uses its name as its symbol version' do
@platform.to_sym.should == :ios
end

Expand Down

0 comments on commit 677d918

Please sign in to comment.