Sha256: e0cb282efe3a5af5273e93608c3132ce2384fbeeb27c2f904694156f84c7bbfc

Contents?: true

Size: 883 Bytes

Versions: 14

Compression:

Stored size: 883 Bytes

Contents

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

      desc 'Creates an EffectiveClassifieds 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_classifieds.rb', 'config/initializers/effective_classifieds.rb'
      end

      def create_migration_file
        migration_template ('../' * 3) + 'db/migrate/101_create_effective_classifieds.rb', 'db/migrate/create_effective_classifieds.rb'
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
effective_classifieds-0.8.4 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.8.3 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.8.2 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.8.1 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.8.0 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.7.0 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.7 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.6 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.5 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.4 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.3 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.2 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.1 lib/generators/effective_classifieds/install_generator.rb
effective_classifieds-0.6.0 lib/generators/effective_classifieds/install_generator.rb