Sha256: 93c45fb2f346e374ec3ca28f1eb9749454c6495bbba85e69cc5f46513e0a90b9

Contents?: true

Size: 761 Bytes

Versions: 5

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

require "rails/generators"

module Tanshuku
  # A generator class for Tanshuku configuration files.
  #
  # @api private
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __dir__)

    # Generates a configuration file +config/initializers/tanshuku.rb+.
    #
    # @return [void]
    def copy_initializer_file
      copy_file "initializer.rb", "config/initializers/tanshuku.rb"
    end

    # Generates a migration file +db/migrate/20230220123456_create_tanshuku_urls.rb+.
    #
    # @return [void]
    def copy_migration_file
      filename = "20230220123456_create_tanshuku_urls.rb"
      copy_file "../../../db/migrate/#{filename}", "db/migrate/#{filename}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tanshuku-0.0.17 lib/generators/tanshuku/install_generator.rb
tanshuku-0.0.16 lib/generators/tanshuku/install_generator.rb
tanshuku-0.0.15 lib/generators/tanshuku/install_generator.rb
tanshuku-0.0.14 lib/generators/tanshuku/install_generator.rb
tanshuku-0.0.13 lib/generators/tanshuku/install_generator.rb