44 lines
783 B
Ruby
44 lines
783 B
Ruby
# typed: strict
|
|
# frozen_string_literal: true
|
|
|
|
source = ARGV[5]
|
|
|
|
case source[/\Ausing\s+(.*)\Z/, 1]
|
|
when "Magic"
|
|
puts <<-RUBY
|
|
# typed: strict
|
|
|
|
class ::Pathname
|
|
sig { returns(String) }
|
|
def magic_number; end
|
|
|
|
sig { returns(String) }
|
|
def file_type; end
|
|
|
|
sig { returns(T::Array[String]) }
|
|
def zipinfo; end
|
|
end
|
|
RUBY
|
|
when "HashValidator"
|
|
puts <<-RUBY
|
|
# typed: strict
|
|
|
|
class ::Hash
|
|
sig { params(valid_keys: T.untyped).void }
|
|
def assert_valid_keys!(*valid_keys); end
|
|
end
|
|
RUBY
|
|
when "TimeRemaining"
|
|
puts <<-RUBY
|
|
# typed: strict
|
|
|
|
class ::Time
|
|
sig { returns(T.any(Integer, Float)) }
|
|
def remaining; end
|
|
|
|
sig { returns(T.any(Integer, Float)) }
|
|
def remaining!; end
|
|
end
|
|
RUBY
|
|
end
|