Skip to content

Commit 677d918

Browse files
authored
Merge pull request #766 from CocoaPods/1-15-stable
Merge 1-15-stable
2 parents 745dbe5 + 53b5af3 commit 677d918

File tree

5 files changed

+52
-23
lines changed

5 files changed

+52
-23
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
* None.
1212

1313

14+
## 1.15.1 (2024-02-06)
15+
16+
##### Enhancements
17+
18+
* None.
19+
20+
##### Bug Fixes
21+
22+
* Accept any casing for platform names in `Platform.new`.
23+
[Eric Amorde](https://github.com/amorde)
24+
[#765](https://github.com/CocoaPods/Core/pull/765)
25+
1426
## 1.15.0 (2024-01-28)
1527

1628
##### Enhancements

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cocoapods-core (1.15.0)
4+
cocoapods-core (1.15.1)
55
activesupport (>= 5.0, < 8)
66
addressable (~> 2.8)
77
algoliasearch (~> 1.0)
@@ -61,7 +61,7 @@ GEM
6161
rb-kqueue (>= 0.2)
6262
metaclass (0.0.4)
6363
method_source (1.0.0)
64-
minitest (5.21.2)
64+
minitest (5.22.0)
6565
mocha (1.4.0)
6666
metaclass (~> 0.0.1)
6767
mocha-on-bacon (0.2.3)

lib/cocoapods-core/gem_version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Pod
22
# The version of the cocoapods-core.
33
#
4-
CORE_VERSION = '1.15.0'.freeze unless defined? Pod::CORE_VERSION
4+
CORE_VERSION = '1.15.1'.freeze unless defined? Pod::CORE_VERSION
55
end

lib/cocoapods-core/platform.rb

+13-11
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,19 @@ def initialize(input, target = nil)
4545
@symbolic_name = input.name
4646
@deployment_target = input.deployment_target
4747
else
48-
# Allow `Platform.new('macos')` to be equivalent to `Platform.macos`
49-
if input == 'macos'
50-
input = 'osx'
51-
elsif input == 'xros'
52-
# To address the issue of the mismatch between the platform: xros in the XCFramework and the platform:
53-
# visionos in Cocoapods.
54-
#
55-
# This will ensure proper alignment between the platform information in the XCFramework and Cocoapods.
56-
input = 'visionos'
57-
end
58-
@symbolic_name = input.to_sym
48+
input = input.to_s.downcase
49+
50+
name = case input
51+
when 'macos'
52+
# Allow `Platform.new('macos')` to be equivalent to `Platform.macos`
53+
'osx'
54+
when 'xros'
55+
# Compatibility with older references to 'xrOS'
56+
'visionos'
57+
else
58+
input
59+
end
60+
@symbolic_name = name.to_sym
5961
target = target[:deployment_target] if target.is_a?(Hash)
6062
@deployment_target = Version.create(target)
6163
end

spec/platform_spec.rb

+24-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,30 @@ module Pod
3030
@platform.name.should == :ios
3131
end
3232

33-
it 'can be initialized with a string symbolic name' do
34-
platform = Platform.new('ios')
35-
platform.name.should == :ios
36-
end
33+
it 'can be initialized with a string' do
34+
Platform.new('MACOS').should == Platform.macos
35+
Platform.new('macOS').should == Platform.macos
36+
Platform.new('macos').should == Platform.macos
37+
38+
Platform.new('iOS').should == Platform.ios
39+
Platform.new('IOS').should == Platform.ios
40+
Platform.new('ios').should == Platform.ios
41+
42+
Platform.new('tvos').should == Platform.tvos
43+
Platform.new('tvOS').should == Platform.tvos
44+
Platform.new('TVOS').should == Platform.tvos
45+
46+
Platform.new('watchOS').should == Platform.watchos
47+
Platform.new('WATCHOS').should == Platform.watchos
48+
Platform.new('watchos').should == Platform.watchos
3749

38-
it 'can be initialized with a string representing macOS' do
39-
platform = Platform.new('macos')
40-
platform.name.should == :osx
41-
platform.string_name.should == 'macOS'
50+
Platform.new('visionos').should == Platform.visionos
51+
Platform.new('VISIONOS').should == Platform.visionos
52+
Platform.new('visionOS').should == Platform.visionos
53+
# Recognizes xrOS
54+
Platform.new('xros').should == Platform.visionos
55+
Platform.new('XROS').should == Platform.visionos
56+
Platform.new('xrOS').should == Platform.visionos
4257
end
4358

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

86-
it 'uses its name as its symbold version' do
101+
it 'uses its name as its symbol version' do
87102
@platform.to_sym.should == :ios
88103
end
89104

0 commit comments

Comments
 (0)