Sha256: 131bb70d774d0e0966910f6047d67a4117a52ebec0f1f7cd59756f68b14abde7
Contents?: true
Size: 901 Bytes
Versions: 28
Compression:
Stored size: 901 Bytes
Contents
module Souls class Delete < Thor desc "migration [migration_NAME]", "Delete Migration files Template" def migration(class_name) singularized_class_name = class_name.underscore.singularize pluralized_class_name = class_name.underscore.pluralize Dir.chdir(Souls.get_mother_path.to_s) do file_paths = { model_file_path: "./apps/api/app/models/#{singularized_class_name}.rb", rspec_file_path: "./apps/api/spec/models/#{singularized_class_name}_spec.rb", rbs_file_path: "./sig/api/app/models/#{singularized_class_name}.rbs", migration_file_path: Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first } file_paths.each do |_k, v| FileUtils.rm_f(v) Souls::Painter.delete_file(v) rescue StandardError => e puts(e) end file_paths end end end end
Version data entries
28 entries across 28 versions & 1 rubygems