Skip to content

Commit 7de9313

Browse files
committed
feat: rbs sig path config
1 parent 571649f commit 7de9313

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

lib/anchor/config.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class Config
1212
:infer_default_as_non_null,
1313
:ar_comment_to_string,
1414
:infer_ar_enums,
15-
:rbs
15+
:rbs,
16+
:rbs_sig_path
1617

1718
def initialize
1819
@ar_column_to_type = nil
@@ -28,6 +29,7 @@ def initialize
2829
@ar_comment_to_string = nil
2930
@infer_ar_enums = nil
3031
@rbs = "off"
32+
@rbs_sig_path = Rails.root.join("rbs")
3133
end
3234
end
3335
end

lib/anchor/types/inference/rbs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def env
5454

5555
def loader
5656
@loader ||= ::RBS::EnvironmentLoader.new.tap do |l|
57-
l.add(path: Rails.root.join("sig"))
57+
l.add(path: Anchor.config.rbs_sig_path)
5858
end
5959
end
6060

spec/example/config/initializers/anchor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module Anchor
2222
}
2323

2424
c.empty_relationship_type = -> { Anchor::Types::Object }
25+
c.rbs_sig_path = Rails.root.join("sig")
2526
end
2627
end
2728

0 commit comments

Comments
 (0)