ember-cli-rails 0.7.4 → 0.8.0

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: 0428e24dab02b22384c818ae31d5e862bfb0927a
4
- data.tar.gz: 9b827a565cee652b9a757bf98445fcbfa14ecfd7
3
+ metadata.gz: 7da213bce2e711701b48dbfa52fdac73ae86520f
4
+ data.tar.gz: bfdb3787798a02a1bfe7ce3563532ac354718605
5
5
  SHA512:
6
- metadata.gz: 511a4adc88ce2a166f85962e52701ffc4d69598c0e0c2a50721fc0f82e1182d94b1f04e794d871172beb537a3f20c20b1e004dc85185f18d3d11ed4509ca65ee
7
- data.tar.gz: 210e20c73c81deab80a60b5532afd58bd9a01088ac19270213f322810dceb5c84a95e95ab4cf15352f5a793ffc0d2805e12b55daa279ea8986724298e5303977
6
+ metadata.gz: d497a65f5083432417e4267bb2c89aad7e7487513598bf78636862082a6fde99e24feef45b99adbb927fbb2a144a9e7055205396a60ad738e530670cd8bce46b
7
+ data.tar.gz: 6b76aab9d8f823906413783547c4cee3f919f54d699d6c634c9ff3fe26f677a4d324d3d83e7d7dce20100c41eb1f7ca3fa67d578b1cc93fbae5ce72fc572beab
@@ -1,6 +1,14 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.8.0
5
+ -----
6
+
7
+ * `EmberCli::EmberController` now inherits from `ActionController::Base` instead
8
+ of `ApplicationController`. [#400]
9
+ * Remove support for Ruby 2.1.x. [#400]
10
+ * Don't route requests to `/rails/info` through the mounted Ember application.
11
+
4
12
  0.7.4
5
13
  -----
6
14
 
@@ -31,6 +39,7 @@ master
31
39
  * `EmberCli::Deploy::File` serves assets with Rails' `static_cache_control`
32
40
  value. [#403]
33
41
 
42
+ [#400]: https://github.com/thoughtbot/ember-cli-rails/pull/400
34
43
  [#396]: https://github.com/thoughtbot/ember-cli-rails/pull/396
35
44
  [#403]: https://github.com/thoughtbot/ember-cli-rails/pull/403
36
45
 
data/README.md CHANGED
@@ -303,6 +303,13 @@ you're not using `nvm`, make sure the string you prepend to the `$PATH` variable
303
303
  contains the directory or directories that contain the `bower` and `npm`
304
304
  executables.
305
305
 
306
+ #### For faster deployments
307
+ Place the following in your deploy/<environment>.rb
308
+ ```ruby
309
+ set :linked_dirs, %w{<ember-app-name>/node_modules <ember-app-name>/bower_components}
310
+ ```
311
+ to avoid rebuilding all the node modules and bower components with every deploy. Replace `<ember-app-name>` with the name of your ember app (default is `frontend`).
312
+
306
313
  ## Override
307
314
 
308
315
  By default, routes defined by `ember_app` will be rendered with the internal
@@ -623,7 +630,7 @@ This project supports:
623
630
 
624
631
  This project supports:
625
632
 
626
- * Ruby versions `>= 2.1.0`
633
+ * Ruby versions `>= 2.2.0`
627
634
  * Rails versions `>=4.1.x`.
628
635
 
629
636
  To learn more about supported versions and upgrades, read the [upgrading guide].
@@ -3,10 +3,5 @@ module EmberCli
3
3
  def index
4
4
  render layout: false
5
5
  end
6
-
7
- def ember_app
8
- params[:ember_app]
9
- end
10
- helper_method :ember_app
11
6
  end
12
7
  end
@@ -8,6 +8,6 @@ module EmberRailsHelper
8
8
 
9
9
  head, body = markup_capturer.capture
10
10
 
11
- render inline: EmberCli[name].index_html(head: head, body: body)
11
+ render text: EmberCli[name].index_html(head: head, body: body).html_safe
12
12
  end
13
13
  end
@@ -1,4 +1,4 @@
1
- <%= render_ember_app ember_app do |head| %>
1
+ <%= render_ember_app params[:ember_app] do |head| %>
2
2
  <% head.append do %>
3
3
  <%= csrf_meta_tags %>
4
4
  <% end %>
@@ -6,7 +6,7 @@ module EmberCli
6
6
  end
7
7
 
8
8
  def check!
9
- if build_error?
9
+ if has_build_errors?
10
10
  raise_build_error!
11
11
  end
12
12
 
@@ -14,7 +14,7 @@ module EmberCli
14
14
  end
15
15
 
16
16
  def reset
17
- if build_error?
17
+ if error_file_exists?
18
18
  error_file.delete
19
19
  end
20
20
  end
@@ -35,17 +35,43 @@ module EmberCli
35
35
  !paths.lockfile.exist?
36
36
  end
37
37
 
38
- def build_error?
38
+ def error_file_exists?
39
39
  error_file.exist? && error_file.size?
40
40
  end
41
41
 
42
+ def build_errors
43
+ error_lines.
44
+ reject { |line| is_blank_or_backtrace?(line) }.
45
+ reject { |line| is_deprecation_warning?(line) }
46
+ end
47
+
48
+ def has_build_errors?
49
+ build_errors.any?
50
+ end
51
+
52
+ def is_blank_or_backtrace?(line)
53
+ line =~ /(^\s*$|^\s{4}at .+$)/
54
+ end
55
+
56
+ def is_deprecation_warning?(line)
57
+ line =~ /^(\e[^\s]+)?DEPRECATION:/
58
+ end
59
+
60
+ def error_lines
61
+ if error_file_exists?
62
+ error_file.readlines
63
+ else
64
+ [""]
65
+ end
66
+ end
67
+
42
68
  def error_file
43
69
  paths.build_error_file
44
70
  end
45
71
 
46
72
  def raise_build_error!
47
- backtrace = error_file.readlines.reject(&:blank?)
48
- message = "#{name.inspect} has failed to build: #{backtrace.first}"
73
+ backtrace = build_errors.first
74
+ message = "#{name.inspect} has failed to build: #{backtrace}"
49
75
 
50
76
  error = BuildError.new(message)
51
77
  error.set_backtrace(backtrace)
@@ -0,0 +1,19 @@
1
+ module EmberCli
2
+ class EmberConstraint
3
+ def matches?(request)
4
+ html_request?(request) && !rails_info_request?(request)
5
+ end
6
+
7
+ private
8
+
9
+ def rails_info_request?(request)
10
+ request.fullpath.start_with?("/rails/info")
11
+ end
12
+
13
+ def html_request?(request)
14
+ index = request.format.to_s =~ /html/ || -1
15
+
16
+ index > -1
17
+ end
18
+ end
19
+ end
@@ -1,4 +1,4 @@
1
- require "ember_cli/html_constraint"
1
+ require "ember_cli/ember_constraint"
2
2
 
3
3
  module ActionDispatch
4
4
  module Routing
@@ -14,7 +14,7 @@ module ActionDispatch
14
14
  format: :html,
15
15
  )
16
16
 
17
- scope constraints: ::EmberCli::HtmlConstraint.new do
17
+ scope constraints: ::EmberCli::EmberConstraint.new do
18
18
  get("#{to}(*rest)", routing_options)
19
19
  end
20
20
 
@@ -1,3 +1,3 @@
1
1
  module EmberCli
2
- VERSION = "0.7.4".freeze
2
+ VERSION = "0.8.0".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.7.4
4
+ version: 0.8.0
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: 2016-05-26 00:00:00.000000000 Z
13
+ date: 2016-08-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ember-cli-rails-assets
@@ -33,9 +33,6 @@ dependencies:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '3.2'
36
- - - "<"
37
- - !ruby/object:Gem::Version
38
- version: '5'
39
36
  type: :runtime
40
37
  prerelease: false
41
38
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,9 +40,6 @@ dependencies:
43
40
  - - ">="
44
41
  - !ruby/object:Gem::Version
45
42
  version: '3.2'
46
- - - "<"
47
- - !ruby/object:Gem::Version
48
- version: '5'
49
43
  - !ruby/object:Gem::Dependency
50
44
  name: cocaine
51
45
  requirement: !ruby/object:Gem::Requirement
@@ -95,10 +89,10 @@ files:
95
89
  - lib/ember_cli/command.rb
96
90
  - lib/ember_cli/configuration.rb
97
91
  - lib/ember_cli/deploy/file.rb
92
+ - lib/ember_cli/ember_constraint.rb
98
93
  - lib/ember_cli/engine.rb
99
94
  - lib/ember_cli/errors.rb
100
95
  - lib/ember_cli/helpers.rb
101
- - lib/ember_cli/html_constraint.rb
102
96
  - lib/ember_cli/path_set.rb
103
97
  - lib/ember_cli/route_helpers.rb
104
98
  - lib/ember_cli/runner.rb
@@ -124,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
118
  requirements:
125
119
  - - ">="
126
120
  - !ruby/object:Gem::Version
127
- version: 2.1.0
121
+ version: 2.2.0
128
122
  required_rubygems_version: !ruby/object:Gem::Requirement
129
123
  requirements:
130
124
  - - ">="
@@ -1,9 +0,0 @@
1
- module EmberCli
2
- class HtmlConstraint
3
- def matches?(request)
4
- matches = request.format.to_s =~ /html/ || -1
5
-
6
- matches > -1
7
- end
8
- end
9
- end