Sha256: 58a98ca0d1b4fe91a944ff585f8f936e530f212e93f6160a9b80efc2c3fd5e54

Contents?: true

Size: 661 Bytes

Versions: 24

Compression:

Stored size: 661 Bytes

Contents

require 'rails/generators'
module ConfigurableEngine
class InstallGenerator < Rails::Generators::Base
  include Rails::Generators::Migration


   def self.source_root
      @source_root ||= File.join(File.dirname(__FILE__), 'templates')
   end
 
   def self.next_migration_number(dirname)
      if ActiveRecord::Base.timestamped_migrations
        Time.now.utc.strftime("%Y%m%d%H%M%S")
      else
        "%.3d" % (current_migration_number(dirname) + 1)
      end
    end
 
    def create_migration_file
      copy_file 'configurable.yml', 'config/configurable.yml'
      migration_template 'migration.rb', 'db/migrate/create_configurables.rb'
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
configurable_engine-1.0.0 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.5.0 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.4.8 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.4.7 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.4.6 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.4.5 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.4.4 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.3.3 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.3.2 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.3.1 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.3.0 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.10 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.9 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.8 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.7 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.6 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.5 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.4 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.3 lib/generators/configurable_engine/install_generator.rb
configurable_engine-0.2.2 lib/generators/configurable_engine/install_generator.rb