Skip to content

Commit 80dc741

Browse files
authored
Merge pull request #2896 from ksss/backport-pathname
[Backport] [3.10] Fix: pathname not written to lockfile.
2 parents ac64601 + f108490 commit 80dc741

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

lib/rbs/collection/config/lockfile_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def generate
184184
lockfile.gems[name] = { name: name, version: "0", source: source }
185185
end
186186
return
187-
when 'set', 'pathname'
188-
# set and pathname is migrated to core from stdlib.
187+
when 'set'
188+
# set is migrated to core from stdlib.
189189
RBS.logger.info {
190190
from = from_gem || "rbs_collection.yaml"
191191
"`#{name}` is a part of the Ruby core library. The dependency to the library can be safely deleted from #{from}."

test/rbs/cli_test.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ def test_collection_install__pathname_set
15771577
)
15781578

15791579
assert_nil lockfile.gems["set"]
1580-
assert_nil lockfile.gems["pathname"]
1580+
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["pathname"][:source]
15811581
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["cgi-escape"][:source]
15821582
assert_instance_of RBS::Collection::Sources::Git, lockfile.gems["ast"][:source]
15831583
end
@@ -1610,15 +1610,14 @@ def test_collection_install__set_pathname__manifest
16101610
_stdout, stderr = run_rbs_collection("install", bundler: true)
16111611

16121612
assert_include stderr, '`set` is a part of the Ruby core library.'
1613-
assert_include stderr, '`pathname` is a part of the Ruby core library.'
16141613

16151614
lockfile = RBS::Collection::Config::Lockfile.from_lockfile(
16161615
lockfile_path: dir + "rbs_collection.lock.yaml",
16171616
data: YAML.safe_load((dir + "rbs_collection.lock.yaml").read)
16181617
)
16191618

16201619
assert_nil lockfile.gems["set"]
1621-
assert_nil lockfile.gems["pathname"]
1620+
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["pathname"][:source]
16221621
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["cgi-escape"][:source]
16231622
assert_instance_of RBS::Collection::Sources::Local, lockfile.gems["true_string"][:source]
16241623
end

0 commit comments

Comments
 (0)