Sha256: 4b8c109e46ce2b4137f4ac92ec0936a2bae95d233920c4ae53c515de2d5b67e9

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

require 'generators/ember/generator_helpers'

module Ember
  module Generators
    class ResourceGenerator < ::Rails::Generators::NamedBase
      include Ember::Generators::GeneratorHelpers

      source_root File.expand_path("../../templates", __FILE__)

      desc "Creates a new Ember.js router, controller, view and template"

      class_option :javascript_engine, :desc => "Engine for JavaScripts"
      class_option :skip_route, :type => :boolean, :default => false, :desc => "Don't create route"
      class_option :array, :type => :boolean, :default => false, :desc => "Create an Ember.ArrayController to represent multiple objects"
      class_option :object, :type => :boolean, :default => false, :desc => "Create an Ember.ObjectController to represent a single object"
      class_option :app_name, :type => :string, :aliases => "-n", :default => false, :desc => "Custom ember app name"


      def create_resource_files

        invoke('ember:route', [ name ], options) unless options[:skip_route]
        invoke('ember:controller', [ name ], options)
        invoke('ember:view', [ name ], options)
        invoke('ember:template', [ name ], options) 
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
ember-rails-0.18.1 lib/generators/ember/resource_generator.rb
ember-rails-lite-0.18.0 lib/generators/ember/resource_generator.rb
ember-rails-0.18.0 lib/generators/ember/resource_generator.rb
ember-rails-0.17.0 lib/generators/ember/resource_generator.rb
ember-rails-0.16.4 lib/generators/ember/resource_generator.rb
ember-rails-0.16.3 lib/generators/ember/resource_generator.rb
ember-rails-0.16.2 lib/generators/ember/resource_generator.rb
ember-rails-0.16.1 lib/generators/ember/resource_generator.rb
ember-rails-0.16.0 lib/generators/ember/resource_generator.rb
ember-rails-0.15.1 lib/generators/ember/resource_generator.rb
ember-rails-0.15.0 lib/generators/ember/resource_generator.rb
ember-rails-0.14.1 lib/generators/ember/resource_generator.rb
ember-rails-0.14.0 lib/generators/ember/resource_generator.rb
ember-rails-0.13.0 lib/generators/ember/resource_generator.rb