How to keep an RBS signature up to date when code changes
Starting with some code I generate an RBS signature. I then make some changes to the code. How do I update the RBS signature to reflect the changes without having to start from scratch?
Original
file.rb
attr_accessor :name
def initialize(name:)
def say_hello
rbs prototype rb file.rb
attr_accessor name: untyped
def initialize: (name: untyped) -> void
def say_hello: () -> untyped
manually edited file.rbs
attr_accessor name: String
def initialize: (name: String)
def say_hello: () -> void
Updated
add this method to file.rb
def say_goodbye
rbs prototype rb file.rb
with the added method
attr_accessor name: untyped
def initialize: (name: untyped) -> void
def say_hello: () -> untyped
def say_goodbye: () -> untyped
Question
I just lost my manual edits to the rbs file.
Is there a toolkit to manage this?