Sha256: 11c8426d9b0ee6e4f2525b8080e56f0c1a5118bde49d1dcbb410e10a832b580b
Contents?: true
Size: 728 Bytes
Versions: 52
Compression:
Stored size: 728 Bytes
Contents
module SOULs class DB < Thor desc "model_rbs [CLASS_NAME]", "Generate GraphQL Model RBS from schema.rb" def model_rbs(class_name) file_path = "" Dir.chdir(SOULs.get_mother_path.to_s) do file_dir = "./sig/api/app/models/" FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir) singularized_class_name = class_name.underscore.singularize file_path = "#{file_dir}#{singularized_class_name}.rbs" File.open(file_path, "w") do |f| f.write(<<~TEXT) class #{singularized_class_name.camelize} < ActiveRecord::Base end TEXT end SOULs::Painter.create_file(file_path.to_s) end file_path end end end
Version data entries
52 entries across 52 versions & 1 rubygems