Class: RbsGoose::IO::TargetGroup

Inherits:
Array
  • Object
show all
Defined in:
lib/rbs_goose/io/target_group.rb

Class Method Summary collapse

Class Method Details

.load_from(base_path, code_dir: 'lib', sig_dir: 'sig') ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rbs_goose/io/target_group.rb', line 7

def load_from(base_path, code_dir: 'lib', sig_dir: 'sig')
  new.tap do |group|
    Dir.glob('**/*.rb', base: ::File.join(base_path, code_dir)).each do |path|
      group << TypedRuby.from_path(
        ruby_path: ::File.join(code_dir, path),
        rbs_path: ::File.join(sig_dir, "#{path}s"),
        base_path:
      )
    end
  end
end