Sha256: 8463ff07aa54c766ba7b4e4dbdaed8fa1e1820b1859ce2b73a1059f24bf561c8

Contents?: true

Size: 887 Bytes

Versions: 14

Compression:

Stored size: 887 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'
module CloudhdrRails
  module Generators
        
    class SetupGenerator < 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.new.utc.strftime("%Y%m%d%H%M%S")
          else
            "%.3d" % (current_migration_number(dirname) + 1)
          end
        end
      
        def create_migration_file
          migration_template 'migration.rb', 'db/migrate/create_cloudhdr_jobs.rb'
        end
        
        def create_config_file
          template 'cloudhdr.yml', File.join('config','cloudhdr.yml')
        end
        
    end
    
  end
end 
  

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cloudhdr_rails-0.0.14 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.13 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.12 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.11 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.10 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.9 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.8 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.7 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.6 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.5 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.4 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.3 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.2 lib/generators/cloudhdr_rails/setup_generator.rb
cloudhdr_rails-0.0.1 lib/generators/cloudhdr_rails/setup_generator.rb