Sha256: 9a210eded23a8e3b0e400501ea2391ec1ef5e5e142b259d74e630a22f29a944f

Contents?: true

Size: 761 Bytes

Versions: 4

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

module Attachy
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    argument :format   , type: :string, default: :jpg
    argument :public_id, type: :string, default: :default
    argument :version  , type: :string, default: 1

    desc 'configure Attachy'

    def create_config
      template 'config/attachy.yml.erb', 'config/attachy.yml'
    end

    def create_cors
      template 'public/cloudinary_cors.html', 'public/cloudinary_cors.html'
    end

    def create_migration
      version = Time.zone.now.strftime('%Y%m%d%H%M%S')

      template 'db/migrate/create_attachy_files_table.rb', "db/migrate/#{version}_create_attachy_files_table.rb"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachy-0.4.1 lib/generators/attachy/install_generator.rb
attachy-0.4.0 lib/generators/attachy/install_generator.rb
attachy-0.3.0 lib/generators/attachy/install_generator.rb
attachy-0.2.0 lib/generators/attachy/install_generator.rb