Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'tmpdir'
require 'pathname'
Dir.mktmpdir('steep-playground-') do |dir|
dir = Pathname(dir)
dir.join('Steepfile').write(<<~END)
target :test do
signature "."
check "test.rb"
end
END
dir.join('test.rb').write(<<~END)
user = User.new(name: "John", age: 20)
user.test(user.name)
user.test(user.age)
END
dir.join('test.rbs').write(<<~END)
class User
def initialize: (name: String, age: Integer) -> void
attr_reader name: String
attr_reader age: Integer
def test: (String s) -> void
end
END
system('vim', '-O', 'test.rb', 'test.rbs', '-c', 'terminal', chdir: dir.to_s)
end
@pocke
Copy link
Author

pocke commented Jun 2, 2022

Screen.Recording.2022-06-02.at.16.42.48.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment