ember-cli-rails 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2050418a47d41c4dadef58815563fc33f790182
4
- data.tar.gz: 389762dcb79129cb6d0f774c5be0d2cb430c51af
3
+ metadata.gz: 44d5a3c86b6680cecf15d70e4643542914adc36a
4
+ data.tar.gz: 0e6619f82c10ed512ffcd2187b5b989cf5067e28
5
5
  SHA512:
6
- metadata.gz: ca28ef57e18cbad4df443df774a3c089f3859073ee076567c99213ae1b302fda2b89659162793ae44f33c5e53adc0dade4c1473c15b29df3b8853d8eea8d3a8a
7
- data.tar.gz: ee03a4aae56dc0db75380856cd77dc58d579763b87115df771ca84d66f4b7d735449e5a1836a6318bf97d4b7bfe59d33f91ea26bf96ceb6f1681bc8673ab5895
6
+ metadata.gz: 868393d23c9e08899531fa8355d441d9ad486a2155eedd33b93e4699b3eecc1ee756f6e6e768254d69110a9494c616886e87482dbbb4eae20662c85aa981f454
7
+ data.tar.gz: 6149a0cc4790d3882651c18e161d7a8c7ab2c0a5898de0946693d308412dc1c8c17b8393137c325c088215d6261ec04600054eb8a376bfc1e2317996f616eb47
@@ -1,6 +1,12 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.4.2
5
+ -----
6
+
7
+ * use the `EmberCli` module in implementation. Ensure backward compatibility by
8
+ aliasing the `EmberCli` to `EmberCLI`.
9
+
4
10
  0.4.1
5
11
  -----
6
12
 
data/README.md CHANGED
@@ -354,6 +354,39 @@ The reason build/deploy times were slow is because ember uglified the JS and
354
354
  then added the files to the asset pipeline. Rails would then try and uglify
355
355
  the JS again, and this would be considerably slower than normal.
356
356
 
357
+ See also the note on [Javascript minification](#javascript-minification)
358
+
359
+ ## JavaScript minification
360
+
361
+ When pre-compiling assets in production, you will want to
362
+ ensure that you are not minifying your JavaScript twice: once with EmberCLI's
363
+ build tools and once with the Asset Pipeline. Repeated minification is wasteful
364
+ and can increase deployment times exponentially.
365
+
366
+ You can either disable minification in your EmberCLI application's
367
+ `ember-cli-build.js`:
368
+
369
+ ```javascript
370
+ /* global require, module */
371
+ var EmberApp = require('ember-cli/lib/broccoli/ember-app');
372
+
373
+ module.exports = function(defaults) {
374
+ var app = new EmberApp({
375
+ minifyJS: false,
376
+ });
377
+
378
+ // ...
379
+ };
380
+ ```
381
+
382
+ or in your Rails application's `config/environments/production.rb`:
383
+
384
+ ```ruby
385
+ Rails.application.configure do
386
+ config.assets.js_compressor = nil
387
+ end
388
+ ```
389
+
357
390
  ## Additional Information
358
391
 
359
392
  When running in the development environment, Ember CLI Rails runs `ember build`
@@ -18,7 +18,7 @@ class EmberTestsController < ActionController::Base
18
18
  end
19
19
 
20
20
  def app
21
- EmberCLI[app_name]
21
+ EmberCli[app_name]
22
22
  end
23
23
 
24
24
  def app_name
@@ -2,11 +2,11 @@ require "ember-cli/capture"
2
2
 
3
3
  module EmberRailsHelper
4
4
  def include_ember_index_html(name, &block)
5
- markup_capturer = EmberCLI::Capture.new(sprockets: self, &block)
5
+ markup_capturer = EmberCli::Capture.new(sprockets: self, &block)
6
6
 
7
7
  head, body = markup_capturer.capture
8
8
 
9
- html = EmberCLI[name].index_html(
9
+ html = EmberCli[name].index_html(
10
10
  sprockets: self,
11
11
  head: head,
12
12
  body: body,
@@ -16,10 +16,10 @@ module EmberRailsHelper
16
16
  end
17
17
 
18
18
  def include_ember_script_tags(name, **options)
19
- javascript_include_tag(*EmberCLI[name].exposed_js_assets, options)
19
+ javascript_include_tag(*EmberCli[name].exposed_js_assets, options)
20
20
  end
21
21
 
22
22
  def include_ember_stylesheet_tags(name, **options)
23
- stylesheet_link_tag(*EmberCLI[name].exposed_css_assets, options)
23
+ stylesheet_link_tag(*EmberCli[name].exposed_css_assets, options)
24
24
  end
25
25
  end
@@ -1,3 +1,3 @@
1
- EmberCLI::Engine.routes.draw do
1
+ EmberCli::Engine.routes.draw do
2
2
  get ":app_name", to: "ember_tests#index", format: false
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "ember-cli/engine" if defined?(Rails)
2
2
 
3
- module EmberCLI
3
+ module EmberCli
4
4
  extend self
5
5
 
6
6
  autoload :App, "ember-cli/app"
@@ -90,3 +90,5 @@ module EmberCLI
90
90
  Rails.configuration.middleware.use Middleware
91
91
  end
92
92
  end
93
+
94
+ EmberCLI = EmberCli
@@ -2,7 +2,7 @@ require "timeout"
2
2
  require "ember-cli/html_page"
3
3
  require "ember-cli/asset_resolver"
4
4
 
5
- module EmberCLI
5
+ module EmberCli
6
6
  class App
7
7
  ADDON_VERSION = "0.0.13"
8
8
  EMBER_CLI_VERSIONS = [ "~> 0.1.5", "~> 0.2.0", "~> 1.13" ]
@@ -37,7 +37,7 @@ module EmberCLI
37
37
 
38
38
  if bower_path.nil?
39
39
  fail <<-FAIL
40
- Bower is required by EmberCLI.
40
+ Bower is required by EmberCLI
41
41
 
42
42
  Install it with:
43
43
 
@@ -154,7 +154,7 @@ module EmberCLI
154
154
  end
155
155
 
156
156
  def silence_build(&block)
157
- if ENV.fetch("EMBER_CLI_RAILS_VERBOSE"){ EmberCLI.env.production? }
157
+ if ENV.fetch("EMBER_CLI_RAILS_VERBOSE") { EmberCli.env.production? }
158
158
  yield
159
159
  else
160
160
  silence_stream STDOUT, &block
@@ -162,11 +162,11 @@ module EmberCLI
162
162
  end
163
163
 
164
164
  def build_timeout
165
- options.fetch(:build_timeout){ EmberCLI.configuration.build_timeout }
165
+ options.fetch(:build_timeout) { EmberCli.configuration.build_timeout }
166
166
  end
167
167
 
168
168
  def watcher
169
- options.fetch(:watcher){ EmberCLI.configuration.watcher }
169
+ options.fetch(:watcher) { EmberCli.configuration.watcher }
170
170
  end
171
171
 
172
172
  def check_for_build_error!
@@ -294,7 +294,7 @@ module EmberCLI
294
294
  end
295
295
 
296
296
  def environment
297
- EmberCLI.env.production?? "production" : "development"
297
+ EmberCli.env.production? ? "production" : "development"
298
298
  end
299
299
 
300
300
  def package_json
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class AssetResolver
3
3
  def initialize(app:, sprockets:)
4
4
  @app = app
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  SKIP_CAPTURE = ["", ""].freeze
3
3
 
4
4
  class Capture
@@ -1,6 +1,6 @@
1
1
  require "singleton"
2
2
 
3
- module EmberCLI
3
+ module EmberCli
4
4
  class Configuration
5
5
  include Singleton
6
6
 
@@ -1,13 +1,7 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class Engine < Rails::Engine
3
- initializer "ember-cli-rails.inflector" do
4
- ActiveSupport::Inflector.inflections do |inflect|
5
- inflect.acronym "CLI" if inflect.respond_to?(:acronym)
6
- end
7
- end
8
-
9
3
  initializer "ember-cli-rails.enable" do
10
- EmberCLI.enable! unless EmberCLI.skip?
4
+ EmberCli.enable! unless EmberCli.skip?
11
5
  end
12
6
 
13
7
  initializer "ember-cli-rails.helpers" do
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  module Helpers
3
3
  extend self
4
4
 
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class HtmlPage
3
3
  def initialize(content:, asset_resolver:, head: "", body: "")
4
4
  @content = content
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class Middleware
3
3
  def initialize(app)
4
4
  @app = app
@@ -10,7 +10,7 @@ module EmberCLI
10
10
  if path == "/testem.js"
11
11
  [ 200, { "Content-Type" => "text/javascript" }, [""] ]
12
12
  else
13
- EmberCLI.process_path path
13
+ EmberCli.process_path path
14
14
  @app.call(env)
15
15
  end
16
16
  end
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class PathSet
3
3
  def self.define_path(name, &definition)
4
4
  define_method name do
@@ -30,11 +30,11 @@ module EmberCLI
30
30
  end
31
31
 
32
32
  define_path :dist do
33
- EmberCLI.root.join("apps", app_name).tap(&:mkpath)
33
+ EmberCli.root.join("apps", app_name).tap(&:mkpath)
34
34
  end
35
35
 
36
36
  define_path :assets do
37
- EmberCLI.root.join("assets").tap(&:mkpath)
37
+ EmberCli.root.join("assets").tap(&:mkpath)
38
38
  end
39
39
 
40
40
  define_path :applications do
@@ -99,7 +99,7 @@ module EmberCLI
99
99
  attr_reader :app
100
100
 
101
101
  delegate :name, :options, to: :app, prefix: true
102
- delegate :configuration, to: EmberCLI
102
+ delegate :configuration, to: EmberCli
103
103
 
104
104
  def default_root
105
105
  Rails.root.join(app_name)
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class Runner
3
3
  TRUE_PROC = ->(*){ true }
4
4
 
@@ -11,7 +11,7 @@ module EmberCLI
11
11
  def process
12
12
  return if skip?
13
13
 
14
- if EmberCLI.env.development?
14
+ if EmberCli.env.development?
15
15
  start_or_restart!
16
16
  else
17
17
  compile!
@@ -1,3 +1,3 @@
1
- module EmberCLI
2
- VERSION = "0.4.1".freeze
1
+ module EmberCli
2
+ VERSION = "0.4.2".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class HerokuGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path("../templates", __FILE__)
4
4
 
@@ -18,7 +18,7 @@ module EmberCLI
18
18
  end
19
19
 
20
20
  def app_paths
21
- EmberCLI.apps.values.map do |app|
21
+ EmberCli.apps.values.map do |app|
22
22
  app.root.relative_path_from(Rails.root)
23
23
  end
24
24
  end
@@ -1,4 +1,4 @@
1
- module EmberCLI
1
+ module EmberCli
2
2
  class InitGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path("../templates", __FILE__)
4
4
 
@@ -1,3 +1,3 @@
1
- EmberCLI.configure do |c|
1
+ EmberCli.configure do |c|
2
2
  c.app :frontend
3
3
  end
@@ -1,21 +1,21 @@
1
1
  namespace :ember do
2
2
  desc "Runs `ember build` for each App"
3
3
  task compile: :install do
4
- EmberCLI.compile!
4
+ EmberCli.compile!
5
5
  end
6
6
 
7
7
  desc "Runs `ember test` for each App"
8
8
  task test: :environment do
9
- EmberCLI.run_tests!
9
+ EmberCli.run_tests!
10
10
  end
11
11
 
12
12
  desc "Installs each EmberCLI app's dependencies"
13
13
  task install: :environment do
14
- EmberCLI.install_dependencies!
14
+ EmberCli.install_dependencies!
15
15
  end
16
16
  end
17
17
 
18
- unless EmberCLI.skip?
18
+ unless EmberCli.skip?
19
19
  # Hook into assets:precompile:all for Rails 3.1+
20
20
  if Rails::VERSION::MAJOR < 4
21
21
  task "assets:precompile:all" => "ember:compile"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-cli-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-31 00:00:00.000000000 Z
13
+ date: 2015-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.5.1
104
+ rubygems_version: 2.5.0
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Integration between Ember CLI and Rails