Sha256: 4b616945221c81e1a8afa0b94ab191a65d80ebde645070ed263e2aeedfac8ec0
Contents?: true
Size: 1.97 KB
Versions: 3
Compression:
Stored size: 1.97 KB
Contents
require 'rails' require 'ember/rails/version' require 'ember/rails/engine' require 'ember/source' require 'ember/data/source' require 'handlebars/source' module Ember module Rails class Railtie < ::Rails::Railtie config.ember = ActiveSupport::OrderedOptions.new generators do |app| app ||= ::Rails.application # Rails 3.0.x does not yield `app` app.config.generators.assets = false ::Rails::Generators.configure!(app.config.generators) ::Rails::Generators.hidden_namespaces.uniq! require "generators/ember/resource_override" end initializer "ember_rails.setup_vendor", :after => "ember_rails.setup", :group => :all do |app| variant = app.config.ember.variant || (::Rails.env.production? ? :production : :development) # Copy over the desired ember, ember-data, and handlebars bundled in # ember-source, ember-data-source, and handlebars-source to a tmp folder. tmp_path = app.root.join("tmp/ember-rails") ext = variant == :production ? ".prod.js" : ".js" FileUtils.mkdir_p(tmp_path) FileUtils.cp(::Ember::Source.bundled_path_for("ember#{ext}"), tmp_path.join("ember.js")) FileUtils.cp(::Ember::Data::Source.bundled_path_for("ember-data#{ext}"), tmp_path.join("ember-data.js")) app.assets.append_path(tmp_path) # Make the handlebars.js and handlebars.runtime.js bundled # in handlebars-source available. app.assets.append_path(File.expand_path('../', ::Handlebars::Source.bundled_path)) # Allow a local variant override ember_path = app.root.join("vendor/assets/ember/#{variant}") app.assets.prepend_path(ember_path.to_s) if ember_path.exist? end initializer "ember_rails.es5_default", :group => :all do |app| if defined?(Closure::Compiler) && app.config.assets.js_compressor == :closure Closure::Compiler::DEFAULT_OPTIONS[:language_in] = 'ECMASCRIPT5' end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ember-rails-0.15.0 | lib/ember_rails.rb |
ember-rails-0.14.1 | lib/ember_rails.rb |
ember-rails-0.14.0 | lib/ember_rails.rb |