Sha256: 7bc7dbc6e8cb64529ddbe0e2f08395efa13efd67a605336c9d83c45ecf68819a

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
require 'generators/rspec/install/install_generator'
require 'generators/devise/install_generator'
require 'generators/cucumber/install/install_generator'

module Noodall

  class AppBuilder < Rails::AppBuilder

    def database_yml
      template "config/database.yml", "config/database.yml"
    end

    def javascripts
      copy_file "public/javascripts/application.js"
    end

    def test
      directory 'features'
      directory 'spec'
      copy_file "config/cucumber.yml"
    end

    def lib
      super
      copy_file "lib/tasks/populate.rake"
    end

    def config
      super
      copy_file "config/sitemap.yml"
    end

  end

  class AppGenerator < Rails::Generators::AppGenerator

    def self.source_root
      @_source_root ||= File.expand_path('../templates', __FILE__)
    end

    def builder
      @builder ||= begin
        builder_class = AppBuilder
        builder_class.send(:include, Rails::ActionMethods)
        builder_class.new(self)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
noodall-0.0.5 lib/noodall/generator.rb