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
4 changes: 4 additions & 0 deletions gem/lib/rbi-central.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ module RBICentral
"description": "(Optional) Source where this gem can be installed from",
"type": "string",
},
"skip_exported_rbis": {
"description": "(Optional) Skip importing gem's exported RBIs during testing with tapioca",
"type": "boolean",
},
},
"additionalProperties": false,
},
Expand Down
6 changes: 5 additions & 1 deletion gem/lib/rbi-central/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Error < RBICentral::Error; end
const :source, T.nilable(String), default: nil
const :dependencies, T::Array[String], default: []
const :requires, T::Array[String], default: []
const :skip_exported_rbis, T::Boolean, default: false

class << self
extend T::Sig
Expand All @@ -23,6 +24,7 @@ def from_object(name, object = {})
source: object["source"],
dependencies: object["dependencies"] || [],
requires: object["requires"] || [],
skip_exported_rbis: object["skip_exported_rbis"] || false,
)
end
end
Expand All @@ -34,6 +36,7 @@ def to_object(*_args)
object["source"] = source if source
object["dependencies"] = dependencies if dependencies.any?
object["requires"] = requires if requires.any?
object["skip_exported_rbis"] = skip_exported_rbis if skip_exported_rbis
object
end

Expand All @@ -51,7 +54,8 @@ def ==(other)
name == other.name &&
source == other.source &&
dependencies == other.dependencies &&
requires == other.requires
requires == other.requires &&
skip_exported_rbis == other.skip_exported_rbis
end

sig { returns(String) }
Expand Down
5 changes: 4 additions & 1 deletion gem/lib/rbi-central/static/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def run!
# Write the filtered annotation to the context folder
write!(@annotations_file, filtered_rbi)

res = bundle_exec("tapioca gem --no-doc --post requires.rb")
flags = "--no-doc --post requires.rb"
flags += " --no-exported-gem-rbis" if @gem.skip_exported_rbis

res = bundle_exec("tapioca gem #{flags}")
unless res.status
errors << Error.new(T.must(res.err).lstrip)
return errors
Expand Down
4 changes: 3 additions & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@
},
"sidekiq-scheduler": {},
"state_machines": {},
"stripe": {},
"stripe": {
"skip_exported_rbis": true
},
"webmock": {
"dependencies": [
"minitest"
Expand Down