Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/rbs/environment_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ def load(env:)
# @type var loaded: Array[[AST::Declarations::t, Pathname, source]]
loaded = []

# For migrating stringio to stdlib
if @core_root && libs.none? { |lib| lib.name == 'stringio' }
add(library: 'stringio', version: nil)
end

each_signature do |source, path, buffer, decls, dirs|
decls.each do |decl|
loaded << [decl, path, source]
Expand Down
1 change: 1 addition & 0 deletions stdlib/cgi/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dependencies:
- name: tempfile
- name: stringio
1 change: 1 addition & 0 deletions stdlib/csv/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dependencies:
- name: forwardable
- name: stringio
1 change: 1 addition & 0 deletions stdlib/open-uri/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dependencies:
- name: tempfile
- name: uri
- name: stringio
File renamed without changes.
4 changes: 4 additions & 0 deletions test/rbs/collection/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ def test_generate_lock_from_stdlib
version: "0"
source:
type: stdlib
- name: stringio
version: "0"
source:
type: stdlib
YAML
end
end
Expand Down
5 changes: 3 additions & 2 deletions test/rbs/environment_loader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_loading_empty

env = Environment.new
loaded = loader.load(env: env)

_, _, lib = loaded.delete_if { |_, _, lib| lib.name == "stringio" }
assert lib
assert loaded.all? {|_, _, path_type| path_type == :core }
end

Expand Down Expand Up @@ -242,7 +243,7 @@ def test_loading_from_rbs_collection

def test_loading_from_rbs_collection__gem_version_mismatch
omit "Test gem `rbs-amber` is unavailable" unless has_gem?("rbs-amber")

mktmpdir do |path|
lockfile_path = path.join('rbs_collection.lock.yaml')
lockfile_path.write(<<~YAML)
Expand Down