Sha256: 22fe11ec25f42fbe9d9799c41c2e7a7981ab0c74c3e8d379333d51825a1092df

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require 'rails/generators/active_record/migration'

module UcbRails
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      extend ActiveRecord::Generators::Migration
      source_root File.join(File.dirname(__FILE__), "templates")

      def self.initializer_path; 'config/initializers/local_vendor/ucb_rails.rb';end
      
      desc <<DESC
Description:
    # Copies stylesheet    to 'app/assets/stylesheets/user_announcements.css'
    Copies configuration
    # Copies db migration  to 'db/migrate/<timestamp>/create_user_announcement_tables.rb'
    
DESC
  
      def preamble
        puts "\n============================================================"
        puts "Installing UCB Rails Essentials\n"
      end
      
      def install
        # copy_file "template.css", 'app/assets/stylesheets/user_announcements.css'
        copy_file "initializer.rb", 'config/initializers/local_vendor/ucb_rails.rb'
        # migration_template "migration.rb", "db/migrate/create_user_announcement_tables.rb"
      end

      def postscript
        puts %(
Installation complete:
  * review settings in the intializer
)
        puts "============================================================\n\n"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ucb_rails-0.0.1 lib/generators/ucb_rails/install_generator.rb