# typed: false # frozen_string_literal: true require_relative "base" module Hephaestus class CoreGenerator < Generators::Base def controllers remove_file("app/controllers/application_controller.rb") copy_file("app/controllers/application_controller.rb", "app/controllers/application_controller.rb") copy_file("app/controllers/root_controller.rb", "app/controllers/root_controller.rb") copy_file("app/controllers/settings_controller.rb", "app/controllers/settings_controller.rb") copy_file("app/controllers/staff_controller.rb", "app/controllers/staff_controller.rb") copy_file("app/controllers/yetto_controller.rb", "app/controllers/yetto_controller.rb") copy_file("app/controllers/concerns/authable.rb", "app/controllers/concerns/authable.rb") end def jobs copy_file("app/jobs/application_job.rb", "app/jobs/application_job.rb") copy_file("app/jobs/update_yetto_job.rb", "app/jobs/update_yetto_job.rb") end def libs bare_app_name = app_name.split("-").last copy_file("app/lib/body_parameter/yetto_parameters.rb", "app/lib/body_parameter/yetto_parameters.rb") copy_file("app/lib/constants/app.rb", "app/lib/constants/#{bare_app_name}.rb") copy_file("app/lib/headers/yetto.rb", "app/lib/headers/yetto.rb") copy_file("app/lib/path_parameter/yetto_parameters.rb", "app/lib/path_parameter/yetto_parameters.rb") directory("app/lib/plug_app", "app/lib/#{app_name.underscore}") copy_file("app/lib/body_parameter.rb", "app/lib/body_parameter.rb") copy_file("app/lib/headers.rb", "app/lib/headers.rb") copy_file("app/lib/path_parameter.rb", "app/lib/path_parameter.rb") end def serializers copy_file("app/serializers/error_serializer.rb", "app/serializers/error_serializer.rb") end def services copy_file("app/services/yetto_service.rb", "app/services/yetto_service.rb") end def views copy_file("app/views/settings/index.json.jbuilder", "app/views/settings/index.json.jbuilder") end end end