Sha256: 5ae99b0ade74996c8ab3169f5c035ae6d41475d424950aad56b12a9359e41890

Contents?: true

Size: 927 Bytes

Versions: 47

Compression:

Stored size: 927 Bytes

Contents

module BootstrapLeather
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)
    require File.expand_path('../../utils', __FILE__)
    include Generators::Utils
    include Rails::Generators::Migration

    # all public methods in here will be run in order

    def add_initializer
      output "You'll be wanting an initializer.  This is where you put your configuration options.", :magenta
      template "initializer.rb", "config/initializers/bootstrap_leather.rb"
    end
    
    def self.next_migration_number(dirname)
      if ActiveRecord::Base.timestamped_migrations
        unless @prev_migration_nr
          @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
        else
          @prev_migration_nr += 1
        end
        @prev_migration_nr.to_s
      else
        "%.3d" % (current_migration_number(dirname) + 1)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
bootstrap_leather-0.9.4 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.9.3 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.9.2 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.9.1 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.9.0 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.8 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.7 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.6 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.5 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.4 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.3 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.2 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.1 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.8.0 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.7.4 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.7.3 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.7.1 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.7.0 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.6.3 lib/generators/bootstrap_leather/install/install_generator.rb
bootstrap_leather-0.6.2 lib/generators/bootstrap_leather/install/install_generator.rb