Sha256: e73b96885ba613fd337b0cde0c56b24a038d0bc1569317b9c317174d3506e287

Contents?: true

Size: 837 Bytes

Versions: 17

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

require "rails/generators/base"
require "rails/generators/migration"

module Passkit
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration

      source_root File.expand_path("../../templates", __FILE__)

      # Implement the required interface for Rails::Generators::Migration.
      def self.next_migration_number(dirname)
        next_migration_number = current_migration_number(dirname) + 1
        ActiveRecord::Migration.next_migration_number(next_migration_number)
      end

      desc "Copy all files to your application."
      def generate_files
        migration_template "create_passkit_tables.rb", "db/migrate/create_passkit_tables.rb"
        copy_file "passkit.rb", "config/initializers/passkit.rb"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
passkit-0.7.0 lib/generators/passkit/install_generator.rb
passkit-0.6.1 lib/generators/passkit/install_generator.rb
passkit-0.6.0 lib/generators/passkit/install_generator.rb
passkit-0.5.4 lib/generators/passkit/install_generator.rb
passkit-0.5.3 lib/generators/passkit/install_generator.rb
passkit-0.5.2 lib/generators/passkit/install_generator.rb
passkit-0.5.1 lib/generators/passkit/install_generator.rb
passkit-0.5.0 lib/generators/passkit/install_generator.rb
passkit-0.4.3 lib/generators/passkit/install_generator.rb
passkit-0.4.2 lib/generators/passkit/install_generator.rb
passkit-0.4.1 lib/generators/passkit/install_generator.rb
passkit-0.4.0 lib/generators/passkit/install_generator.rb
passkit-0.3.3 lib/generators/passkit/install_generator.rb
passkit-0.3.2 lib/generators/passkit/install_generator.rb
passkit-0.3.1 lib/generators/passkit/install_generator.rb
passkit-0.3.0 lib/generators/passkit/install_generator.rb
passkit-0.2.0 lib/generators/passkit/install_generator.rb