22 lines
466 B
Ruby
Raw Normal View History

2020-11-21 13:29:44 +01:00
# typed: strict
# frozen_string_literal: true
source = ARGV[5]
methods = if (single = source[/delegate\s+([^:]+):\s+/, 1])
[single]
else
multiple = source[/delegate\s+\[(.*?)\]\s+=>\s+/m, 1]
non_comments = multiple.gsub(/\#.*$/, "")
non_comments.scan(/:([^:,\s]+)/).flatten
end
methods.each do |method|
puts <<~RUBY
# typed: strict
2020-11-24 15:46:47 +01:00
sig {params(arg0: T.untyped, blk: T.untyped).returns(T.untyped)}
def #{method}(*arg0, &blk); end
2020-11-21 13:29:44 +01:00
RUBY
end