Skip to content

Commit d7a1b65

Browse files
authored
Merge pull request #1046 from CocoaPods/amorde/ruby-3.4-compat
Fix Ruby 3.4 compatibility
2 parents fe999c5 + ae0f490 commit d7a1b65

5 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/Specs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
17+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
1818
os: [ubuntu-24.04]
1919
include:
2020
- os: macos-14

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
##### Bug Fixes
1010

11-
* None.
11+
* Fix `cannot load such file -- kconv`, `cannot load such file -- base64` crash when running on Ruby 3.4.
12+
[Eric Amorde](https://github.com/amorde)
13+
[#1046](https://github.com/CocoaPods/Xcodeproj/pull/1046)
1214

1315

1416
## 1.28.0 (2026-07-06)

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ PATH
1717
xcodeproj (1.28.0)
1818
CFPropertyList (>= 2.3.3, < 4.0)
1919
atomos (~> 0.1.3)
20+
base64
2021
claide (>= 1.0.2, < 2.0)
2122
colored2 (~> 3.1)
2223
nanaimo (~> 0.4.0)
24+
nkf
2325
rexml (>= 3.3.6, < 4.0)
2426

2527
GEM
@@ -31,6 +33,7 @@ GEM
3133
ast (2.4.3)
3234
atomos (0.1.3)
3335
bacon (1.2.0)
36+
base64 (0.3.0)
3437
claide-plugins (0.9.2)
3538
cork
3639
nap
@@ -75,6 +78,7 @@ GEM
7578
multipart-post (2.1.1)
7679
nanaimo (0.4.0)
7780
nap (1.1.0)
81+
nkf (0.3.0)
7882
notify (0.5.2)
7983
octokit (4.21.0)
8084
faraday (>= 0.9)

spec/project/object_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,18 @@ module ProjectSpecs
158158
end
159159

160160
it 'warns if it encounters an unknown attribute in a plist' do
161-
UI.expects(:warn).with "[!] Xcodeproj doesn't know about the following " \
161+
if Gem::Requirement.new('>= 3.4.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
162+
UI.expects(:warn).with "[!] Xcodeproj doesn't know about the following " \
163+
"attributes {\"unknown_attribute\" => \"might be a reference\"} for the 'PBXFileReference' isa." \
164+
"\nIf this attribute was generated by Xcode please file " \
165+
'an issue: https://github.com/CocoaPods/Xcodeproj/issues/new'
166+
else
167+
UI.expects(:warn).with "[!] Xcodeproj doesn't know about the following " \
162168
"attributes {\"unknown_attribute\"=>\"might be a reference\"} for the 'PBXFileReference' isa." \
163169
"\nIf this attribute was generated by Xcode please file " \
164170
'an issue: https://github.com/CocoaPods/Xcodeproj/issues/new'
171+
end
172+
165173
@objects_by_uuid_plist[@object.uuid]['unknown_attribute'] = 'might be a reference'
166174
@object.configure_with_plist(@objects_by_uuid_plist)
167175
end

xcodeproj.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Gem::Specification.new do |s|
2727
s.add_runtime_dependency 'colored2', '~> 3.1'
2828
s.add_runtime_dependency 'nanaimo', '~> 0.4.0'
2929
s.add_runtime_dependency 'rexml', '>= 3.3.6', '< 4.0'
30+
s.add_runtime_dependency 'nkf' # required for older CFPropertyList versions on Ruby 3.4
31+
s.add_runtime_dependency 'base64' # required for older CFPropertyList versions on Ruby 3.4
3032

3133
## Make sure you can build the gem on older versions of RubyGems too:
3234
s.rubygems_version = '1.6.2'

0 commit comments

Comments
 (0)