Sha256: 413c1e552ebb68eb6e91efd9d7e73a3e0e0b4730c2da818ca6ba002540af18f3

Contents?: true

Size: 1004 Bytes

Versions: 6

Compression:

Stored size: 1004 Bytes

Contents

class DaoGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)

  def copy_api_file
    copy_file("api.rb", "app/api.rb")

    copy_file("api_controller.rb", "app/controllers/api_controller.rb")

    copy_file("dao_helper.rb", "app/helpers/dao_helper.rb")

    copy_file("dao.js", "public/javascripts/dao.js")

    copy_file("dao.css", "public/stylesheets/dao.css")

    route("match 'api(/*path)' => 'api#index', :as => 'api'")

    gem("yajl-ruby")

    application(
      <<-__

        config.after_initialize do
          require 'app/api.rb'
          require 'yajl/json_gem'
        end

        config.autoload_paths += %w( app )

        ### config.action_view.javascript_expansions[:defaults] ||= []
        ### config.action_view.javascript_expansions[:defaults] += %( dao )

        ### config.action_view.stylesheet_expansions[:defaults] ||= []
        ### config.action_view.stylesheet_expansions[:defaults] += %( dao )

      __
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dao-3.3.0 lib/dao/rails/lib/generators/dao/dao_generator.rb
dao-3.2.0 lib/dao/rails/lib/generators/dao/dao_generator.rb
dao-3.1.2 lib/dao/rails/lib/generators/dao/dao_generator.rb
dao-3.1.1 lib/dao/rails/lib/generators/dao/dao_generator.rb
dao-3.1.0 lib/dao/rails/lib/generators/dao/dao_generator.rb
dao-2.2.3 lib/dao/rails/lib/generators/dao/dao_generator.rb