ember-cli-rails 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edce710d889ed900929e5b4f2d38d586258e8a48
4
- data.tar.gz: 5806b65215cae0a61d60627a18399aecb6019acf
3
+ metadata.gz: f920d670a1774fce16c0bc61111b17292caa879f
4
+ data.tar.gz: 10eb258cc10eb4b3acef3ad64d67a2a5d39e7b2d
5
5
  SHA512:
6
- metadata.gz: 3028691cbb5ced53772813f9e302588bdb2f005b1d3831d14a5316e2489e7673ea20e458de9d4ff8aad4a8d63780c626d4eacf7d370ab9587367edd27022c3a2
7
- data.tar.gz: b389dce752aca330ba2bde20591022a23002e1c61d9b0450f11d72a408f98ba6de8c718878a431a437c249c640afcd91875a6772fa86353acd89e05c006611e0
6
+ metadata.gz: c96486c1419c1a671b7eafc2358e63b463a0ec9d29b278810605dde305febd032b502a0e369b0ef7cdd8b916328dd5b6686257bdee9ec4ed5847b048397bfcb7
7
+ data.tar.gz: 7ab0834bb58959a1b50a46e4f16bf6b05ab4171117b0c249b32bdc74bf71636248aa7272f27f86dcbb0d26516d3e72f526d3898e84da9482328b39d6582f09bf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.1.7
2
+ -----
3
+
4
+ * Serve EmberCLI tests as mountable engine [#90](https://github.com/rwz/ember-cli-rails/pull/90) [@seanpdoyle](https://github.com/seanpdoyle)
5
+
1
6
  0.1.6
2
7
  -----
3
8
 
data/README.md CHANGED
@@ -113,6 +113,26 @@ could render your app at the `/` route with the following view:
113
113
 
114
114
  Your Ember application will now be served at the `/` route.
115
115
 
116
+ ## Ember Test Suite
117
+
118
+ To run an Ember app's tests in a browser, mount the `EmberCLI::Engine`:
119
+
120
+ ```ruby
121
+ # config/routes.rb
122
+
123
+ Rails.application.routes.draw do
124
+ mount EmberCLI::Engine => "ember-tests" if Rails.env.development?
125
+
126
+ root "application#index"
127
+ end
128
+ ```
129
+
130
+ Ember tests are served based on the route you mount the Engine on (in this
131
+ example, `/ember-tests`) and the name of the Ember app.
132
+
133
+ For example, to view tests of the `frontend` app, visit
134
+ `http://localhost:3000/ember-tests/frontend`.
135
+
116
136
  ## Enabling LiveReload
117
137
 
118
138
  In order to get LiveReload up and running with EmberCLI Rails, you can install
@@ -1,4 +1,4 @@
1
- require "ember-cli/railtie" if defined?(Rails)
1
+ require "ember-cli/engine" if defined?(Rails)
2
2
 
3
3
  module EmberCLI
4
4
  extend self
@@ -17,6 +17,10 @@ module EmberCLI
17
17
  Configuration.instance
18
18
  end
19
19
 
20
+ def get_app(name)
21
+ configuration.apps[name]
22
+ end
23
+
20
24
  def prepare!
21
25
  @prepared ||= begin
22
26
  Rails.configuration.assets.paths << root.join("assets").to_s
data/lib/ember-cli/app.rb CHANGED
@@ -13,6 +13,10 @@ module EmberCLI
13
13
  @name, @options = name.to_s, options
14
14
  end
15
15
 
16
+ def tests_path
17
+ dist_path.join("tests")
18
+ end
19
+
16
20
  def compile
17
21
  prepare
18
22
  silence_build { exec command }
@@ -107,7 +111,7 @@ module EmberCLI
107
111
  Please see, https://github.com/rwz/ember-cli-rails/issues/66 for more
108
112
  detailed information.
109
113
 
110
- It is now reccomended to place your EmberCLI application into the Rails
114
+ It is now recommended to place your EmberCLI application into the Rails
111
115
  root path.
112
116
  MSG
113
117
 
@@ -165,7 +169,7 @@ module EmberCLI
165
169
  end
166
170
 
167
171
  def check_ember_cli_version!
168
- version = dev_dependencies.fetch("ember-cli").split("-").first
172
+ version = dev_dependencies.fetch("ember-cli").split(?-).first
169
173
 
170
174
  unless match_version?(version, EMBER_CLI_VERSION)
171
175
  fail <<-MSG.strip_heredoc
@@ -221,16 +225,12 @@ module EmberCLI
221
225
  @app_path ||= begin
222
226
  path = options.fetch(:path){ default_app_path }
223
227
  pathname = Pathname.new(path)
224
- app_path = pathname.absolute?? pathname : Rails.root.join(path)
228
+ pathname.absolute?? pathname : Rails.root.join(path)
225
229
  end
226
230
  end
227
231
 
228
232
  def tmp_path
229
- @tmp_path ||= begin
230
- path = app_path.join("tmp")
231
- path.mkdir unless path.exist?
232
- path
233
- end
233
+ @tmp_path ||= app_path.join("tmp").tap(&:mkpath)
234
234
  end
235
235
 
236
236
  def log_path
@@ -263,7 +263,7 @@ module EmberCLI
263
263
  end
264
264
 
265
265
  def excluded_ember_deps
266
- Array.wrap(options[:exclude_ember_deps]).join(",")
266
+ Array.wrap(options[:exclude_ember_deps]).join(?,)
267
267
  end
268
268
 
269
269
  def env_hash
@@ -1,5 +1,5 @@
1
1
  module EmberCLI
2
- class Railtie < Rails::Railtie
2
+ class Engine < Rails::Engine
3
3
  initializer "ember-cli-rails.view_helpers" do
4
4
  ActionView::Base.send :include, ViewHelpers
5
5
  end
@@ -8,7 +8,11 @@ module EmberCLI
8
8
  enable_ember_cli
9
9
  EmberCLI.wait!
10
10
 
11
- @app.call(env)
11
+ if env["PATH_INFO"] == "/testem.js"
12
+ [ 200, { "Content-Type" => "text/javascript" }, [""] ]
13
+ else
14
+ @app.call(env)
15
+ end
12
16
  end
13
17
 
14
18
  private
@@ -1,3 +1,3 @@
1
1
  module EmberCLI
2
- VERSION = "0.1.6".freeze
2
+ VERSION = "0.1.7".freeze
3
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-13 00:00:00.000000000 Z
12
+ date: 2015-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -53,9 +53,9 @@ files:
53
53
  - lib/ember-cli-rails.rb
54
54
  - lib/ember-cli/app.rb
55
55
  - lib/ember-cli/configuration.rb
56
+ - lib/ember-cli/engine.rb
56
57
  - lib/ember-cli/helpers.rb
57
58
  - lib/ember-cli/middleware.rb
58
- - lib/ember-cli/railtie.rb
59
59
  - lib/ember-cli/version.rb
60
60
  - lib/ember-cli/view_helpers.rb
61
61
  - lib/generators/ember-cli/init/USAGE