Class: Orthoses::TypeProf
- Inherits:
-
Object
- Object
- Orthoses::TypeProf
- Defined in:
- lib/orthoses/typeprof.rb,
lib/orthoses/typeprof/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(loader, config:) ⇒ TypeProf
constructor
use Orthoses::TypeProf, config: ::TypeProf::ConfigData.new( rb_files: rb_files, collection_path: ::RBS::Collection::Config::PATH, options: options, ).
Constructor Details
#initialize(loader, config:) ⇒ TypeProf
use Orthoses::TypeProf,
config: ::TypeProf::ConfigData.new(
rb_files: rb_files,
collection_path: ::RBS::Collection::Config::PATH,
options: options,
)
15 16 17 18 |
# File 'lib/orthoses/typeprof.rb', line 15 def initialize(loader, config:) @loader = loader @config = config end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/orthoses/typeprof.rb', line 20 def call @loader.call.tap do |store| @config.rbs_files = store.map { |name, content| [name, content.to_rbs] } @config.output = StringIO.new ::TypeProf.analyze(@config) content_env = Orthoses::Content::Environment.new buffer = ::RBS::Buffer.new( name: "orthoses/typeprof.rb", content: @config.output.string ) parse(buffer) do |decl| content_env << decl end content_env.write_to(store: store) end end |