Sha256: 41b3a68df2a6b164505fc488d7f071a7ba7107d2c33c60b60899bc3a981c9c20

Contents?: true

Size: 885 Bytes

Versions: 4

Compression:

Stored size: 885 Bytes

Contents

require 'rails/generators'
require 'rails/generators/rails/app/app_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'
    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

4 entries across 4 versions & 1 rubygems

Version Path
noodall-0.2.0 lib/noodall/generator.rb
noodall-0.2.0.pre.2 lib/noodall/generator.rb
noodall-0.2.0.pre.1 lib/noodall/generator.rb
noodall-0.1.0 lib/noodall/generator.rb