lib/generators/ember/generator_helpers.rb in ember-appkit-rails-0.1.2 vs lib/generators/ember/generator_helpers.rb in ember-appkit-rails-0.2.0
- old
+ new
@@ -2,22 +2,26 @@
module Ember
module Generators
module GeneratorHelpers
- def ember_path
- if options[:ember_path]
- options[:ember_path]
- elsif configuration.ember_path
- configuration.ember_path
- elsif rails_engine?
- "app/assets/javascripts/#{engine_name}"
+ def app_path
+ if options[:app_path]
+ options[:app_path]
else
- "app/assets/javascripts"
+ configuration.paths.app
end
end
+ def config_path
+ if options[:config_path]
+ options[:config_path]
+ else
+ configuration.paths.config
+ end
+ end
+
def rails_engine?
defined?(ENGINE_PATH)
end
def engine_name
@@ -30,11 +34,11 @@
elsif configuration.app_name
configuration.app_name
elsif rails_engine?
engine_name
else
- "App"
+ 'App'
end
end
def class_name
(class_path + [file_name]).map!{ |m| m.camelize }.join()
@@ -42,11 +46,15 @@
def handlebars_template_path
File.join(class_path, file_name).gsub(/^\//, '')
end
+ def javascript_assets_path
+ File.join(::Rails.root, 'app/assets/javascripts')
+ end
+
def configuration
- ::Rails.configuration.ember
+ ::Rails.configuration.ember.appkit
end
end
end
end