Created
March 27, 2022 14:27
-
-
Save takahashim/d7e908eb02fca9196da82d0a2eb632c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
Dir.glob("lib/**/*.rb") do |file| | |
rbs_file = file.sub('lib/', 'sig/').sub(/\.rb$/, '.rbs') | |
FileUtils.mkdir_p(File.dirname(rbs_file)) | |
puts "#{file} -> #{rbs_file}" | |
cmd = "rbs prototype rb #{file} > #{rbs_file}" | |
system(cmd) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment