Sha256: 0c0b7471ac53e1e64d50e1a10458e6d2b3ace17a983cd249b8a3e670d3ee95d2

Contents?: true

Size: 933 Bytes

Versions: 86

Compression:

Stored size: 933 Bytes

Contents

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

      desc 'Creates an EffectiveLogging initializer in your application.'

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

      def self.next_migration_number(dirname)
        if not ActiveRecord::Base.timestamped_migrations
          Time.new.utc.strftime("%Y%m%d%H%M%S")
        else
          "%.3d" % (current_migration_number(dirname) + 1)
        end
      end

      def copy_initializer
        template ('../' * 3) + 'config/effective_logging.rb', 'config/initializers/effective_logging.rb'
      end

      def create_migration_file
        @logs_table_name = ':' + EffectiveLogging.logs_table_name.to_s

        migration_template ('../' * 3) + 'db/migrate/01_create_effective_logging.rb.erb', 'db/migrate/create_effective_logging.rb'
      end
    end
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
effective_logging-4.0.0 lib/generators/effective_logging/install_generator.rb
effective_logging-3.5.4 lib/generators/effective_logging/install_generator.rb
effective_logging-3.5.3 lib/generators/effective_logging/install_generator.rb
effective_logging-3.5.2 lib/generators/effective_logging/install_generator.rb
effective_logging-3.5.1 lib/generators/effective_logging/install_generator.rb
effective_logging-3.5.0 lib/generators/effective_logging/install_generator.rb
effective_logging-3.4.1 lib/generators/effective_logging/install_generator.rb
effective_logging-3.4.0 lib/generators/effective_logging/install_generator.rb
effective_logging-3.3.0 lib/generators/effective_logging/install_generator.rb
effective_logging-3.2.3 lib/generators/effective_logging/install_generator.rb
effective_logging-3.2.2 lib/generators/effective_logging/install_generator.rb
effective_logging-3.2.1 lib/generators/effective_logging/install_generator.rb
effective_logging-3.2.0 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.15 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.14 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.13 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.12 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.11 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.10 lib/generators/effective_logging/install_generator.rb
effective_logging-3.1.9 lib/generators/effective_logging/install_generator.rb