Sha256: 71e103a2431cd9076663a5cb2e3083db7db4cb78ef1ae5c1a9139adcbe6f4d78

Contents?: true

Size: 924 Bytes

Versions: 10

Compression:

Stored size: 924 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'

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

      def self.source_root
        File.join(File.dirname(__FILE__), 'templates')
      end
       
      def self.next_migration_number(dirname) #:nodoc:
        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
        migration_template 'migration.rb', 'db/migrate/create_e9_polls.rb'
      end

      def copy_over_files
        copy_file 'initializer.rb', 'config/initializers/e9_polls.rb'
        copy_file 'javascript.js',  'public/javascripts/e9_polls.js'
        copy_file 'stylesheet.css', 'public/stylesheets/e9_polls.css'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
e9_polls-1.0.10 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.9 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.8 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.7 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.6 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.5 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.4 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.3 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.2 lib/generators/e9_polls/install_generator.rb
e9_polls-1.0.1 lib/generators/e9_polls/install_generator.rb