ember-cli-rails 0.5.1 → 0.5.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: 76353b506d35c0822340fbe4811403afd3078b42
4
- data.tar.gz: c70a6346f869e47826c2a56b27cb5fe01a6d506c
3
+ metadata.gz: ddb6dc3742597e8044ab777f9497be13fa30bd10
4
+ data.tar.gz: 65afcdf3aedec901b2fd606624f5117c1cee659a
5
5
  SHA512:
6
- metadata.gz: a8c2bf094b44381b615e9077a7d4e0951e5d55c07d240a229ab18f21a70905d057da6f9b83961a1c574d126d5aa9c6a10c238a643a4898f9a532198e11bcac7e
7
- data.tar.gz: 00447aca1034efe20b110828bcc0d363077192c2dfe58e90a604afddf3d14e3dd56b4a644cedcf770c7a00d9be118b8bf78d7ef4862cf81b6f8a35a0bedfe883
6
+ metadata.gz: aabc433601664fa93b54d67612517f57771841f090829f2b0f5c84e61d2a0333f9c61d417794c586302073940fcafed7a63648cab4d733b67d098356568efc1e
7
+ data.tar.gz: e4e4652c381c9182e8cc95bd486e078a2e2ffe4a2c12abc7fa24861a8bc0f928b89680199299371d74345717c73afc475a680ba12bc1c0de1e86531df30fc6dc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.5.2
5
+ -----
6
+
7
+ * Register EmberCLI app with Sprockets on application initialization
8
+ * Rename `ember-cli` to `ember_cli` in Ruby.
9
+
4
10
  0.5.1
5
11
  -----
6
12
 
@@ -1,4 +1,4 @@
1
- require "ember-cli/capture"
1
+ require "ember_cli/capture"
2
2
 
3
3
  module EmberRailsHelper
4
4
  def include_ember_index_html(name, &block)
@@ -1,13 +1,13 @@
1
- require "ember-cli/engine" if defined?(Rails)
2
- require "ember-cli/errors"
1
+ require "ember_cli/engine" if defined?(Rails)
2
+ require "ember_cli/errors"
3
3
 
4
4
  module EmberCli
5
5
  extend self
6
6
 
7
- autoload :App, "ember-cli/app"
8
- autoload :Configuration, "ember-cli/configuration"
9
- autoload :Helpers, "ember-cli/helpers"
10
- autoload :PathSet, "ember-cli/path_set"
7
+ autoload :App, "ember_cli/app"
8
+ autoload :Configuration, "ember_cli/configuration"
9
+ autoload :Helpers, "ember_cli/helpers"
10
+ autoload :PathSet, "ember_cli/path_set"
11
11
 
12
12
  def configure
13
13
  yield configuration
@@ -1,6 +1,6 @@
1
- require "ember-cli/shell"
2
- require "ember-cli/sprockets"
3
- require "ember-cli/build_monitor"
1
+ require "ember_cli/shell"
2
+ require "ember_cli/sprockets"
3
+ require "ember_cli/build_monitor"
4
4
 
5
5
  module EmberCli
6
6
  class App
@@ -84,7 +84,6 @@ module EmberCli
84
84
  @prepared ||= begin
85
85
  @build.reset
86
86
  symlink_to_assets_root
87
- sprockets.register!
88
87
  true
89
88
  end
90
89
  end
File without changes
File without changes
File without changes
@@ -13,7 +13,9 @@ module EmberCli
13
13
  deprecate_enable
14
14
  end
15
15
 
16
- apps.store name, App.new(name, options)
16
+ app = App.new(name, options)
17
+ app.sprockets.register!
18
+ apps.store(name, app)
17
19
  end
18
20
 
19
21
  def apps
File without changes
@@ -1,8 +1,8 @@
1
1
  module EmberCli
2
2
  class Engine < Rails::Engine
3
3
  initializer "ember-cli-rails.rendering" do
4
- require "ember-cli/ember_controller"
5
- require "ember-cli/route_helpers"
4
+ require "ember_cli/ember_controller"
5
+ require "ember_cli/route_helpers"
6
6
  end
7
7
 
8
8
  initializer "ember-cli-rails.enable" do
@@ -15,7 +15,7 @@ module EmberCli
15
15
 
16
16
  config.after_initialize do
17
17
  if defined?(ApplicationController)
18
- require "ember-cli/controller_extension"
18
+ require "ember_cli/controller_extension"
19
19
 
20
20
  ApplicationController.include(EmberCli::ControllerExtension)
21
21
  end
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- require "ember-cli/constraint"
1
+ require "ember_cli/constraint"
2
2
 
3
3
  module ActionDispatch
4
4
  module Routing
@@ -1,4 +1,4 @@
1
- require "ember-cli/command"
1
+ require "ember_cli/command"
2
2
 
3
3
  module EmberCli
4
4
  class Shell
@@ -1,17 +1,17 @@
1
+ require "ember_cli/errors"
1
2
  require "non-stupid-digest-assets"
2
- require "ember-cli/html_page"
3
+ require "ember_cli/html_page"
3
4
 
4
5
  module EmberCli
5
6
  class Sprockets
7
+ class AssetPipelineError < BuildError; end
6
8
  def initialize(app)
7
9
  @app = app
8
10
  end
9
11
 
10
12
  def register!
11
- assets = %r{\A#{app.name}/}
12
-
13
- Rails.configuration.assets.precompile << assets
14
- NonStupidDigestAssets.whitelist << assets
13
+ register_or_raise!(Rails.configuration.assets.precompile)
14
+ register_or_raise!(NonStupidDigestAssets.whitelist)
15
15
  end
16
16
 
17
17
  def index_html(head:, body:)
@@ -40,5 +40,19 @@ module EmberCli
40
40
  @package_json ||=
41
41
  JSON.parse(app.paths.package_json_file.read).with_indifferent_access
42
42
  end
43
+
44
+ def asset_matcher
45
+ %r{\A#{app.name}/}
46
+ end
47
+
48
+ def register_or_raise!(precompiled_assets)
49
+ if precompiled_assets.include?(asset_matcher)
50
+ raise AssetPipelineError.new <<-MSG.strip_heredoc
51
+ EmberCLI application #{app.name.inspect} already registered!
52
+ MSG
53
+ else
54
+ precompiled_assets << asset_matcher
55
+ end
56
+ end
43
57
  end
44
58
  end
@@ -0,0 +1,3 @@
1
+ module EmberCli
2
+ VERSION = "0.5.2".freeze
3
+ end
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -72,26 +72,26 @@ files:
72
72
  - CHANGELOG.md
73
73
  - LICENSE.txt
74
74
  - README.md
75
- - app/controller/ember-cli/ember_controller.rb
75
+ - app/controller/ember_cli/ember_controller.rb
76
76
  - app/helpers/ember_rails_helper.rb
77
77
  - app/views/ember_cli/ember/index.html.erb
78
78
  - lib/ember-cli-rails.rb
79
- - lib/ember-cli/app.rb
80
- - lib/ember-cli/build_monitor.rb
81
- - lib/ember-cli/capture.rb
82
- - lib/ember-cli/command.rb
83
- - lib/ember-cli/configuration.rb
84
- - lib/ember-cli/constraint.rb
85
- - lib/ember-cli/controller_extension.rb
86
- - lib/ember-cli/engine.rb
87
- - lib/ember-cli/errors.rb
88
- - lib/ember-cli/helpers.rb
89
- - lib/ember-cli/html_page.rb
90
- - lib/ember-cli/path_set.rb
91
- - lib/ember-cli/route_helpers.rb
92
- - lib/ember-cli/shell.rb
93
- - lib/ember-cli/sprockets.rb
94
- - lib/ember-cli/version.rb
79
+ - lib/ember_cli/app.rb
80
+ - lib/ember_cli/build_monitor.rb
81
+ - lib/ember_cli/capture.rb
82
+ - lib/ember_cli/command.rb
83
+ - lib/ember_cli/configuration.rb
84
+ - lib/ember_cli/constraint.rb
85
+ - lib/ember_cli/controller_extension.rb
86
+ - lib/ember_cli/engine.rb
87
+ - lib/ember_cli/errors.rb
88
+ - lib/ember_cli/helpers.rb
89
+ - lib/ember_cli/html_page.rb
90
+ - lib/ember_cli/path_set.rb
91
+ - lib/ember_cli/route_helpers.rb
92
+ - lib/ember_cli/shell.rb
93
+ - lib/ember_cli/sprockets.rb
94
+ - lib/ember_cli/version.rb
95
95
  - lib/generators/ember-cli/heroku/USAGE
96
96
  - lib/generators/ember-cli/heroku/heroku_generator.rb
97
97
  - lib/generators/ember-cli/heroku/templates/bin_heroku_install.erb
@@ -1,3 +0,0 @@
1
- module EmberCli
2
- VERSION = "0.5.1".freeze
3
- end