Sha256: 0af38050784c6572d9800b7c9045d4aab2afa1e617e1b3ab733b3081ad284d41

Contents?: true

Size: 699 Bytes

Versions: 3

Compression:

Stored size: 699 Bytes

Contents

module Souls
  class Delete < Thor
    desc "job_rbs [CLASS_NAME]", "Delete SOULs Job Mutation RBS Template"
    def job_rbs(class_name)
      file_path = ""
      worker_name = FileUtils.pwd.split("/").last
      Dir.chdir(Souls.get_mother_path.to_s) do
        singularized_class_name = class_name.underscore.singularize
        file_dir = "./sig/#{worker_name}/app/graphql/mutations/"
        FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
        file_path = "#{file_dir}#{singularized_class_name}.rbs"
        FileUtils.rm(file_path)
        puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
      end
      file_path
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
souls-1.8.6 lib/souls/cli/delete/job_rbs.rb
souls-1.8.5 lib/souls/cli/delete/job_rbs.rb
souls-1.8.4 lib/souls/cli/delete/job_rbs.rb