ember-cli-rails 0.14.2 → 0.14.3

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
  SHA256:
3
- metadata.gz: 205edc4e10aa3f203c8cd2f372ba62a3ce75890712207924b4a845dbbfd610d2
4
- data.tar.gz: 20f5b025ff819827debf7c33d3ec396c206b1ccb2e61f26551c08638dbaa415c
3
+ metadata.gz: '079bc62bc3e35daf5eefbe6f36e1a220f05e8d8559ef5c54b650e88a4ee726fd'
4
+ data.tar.gz: 56d4b1cd987002f93bfcdbaf224577e9a22dda026c660dcea93dda3343f1943f
5
5
  SHA512:
6
- metadata.gz: 42a1be898ab5343abb64fbecdea9146cfb0b28ece2a21071ef82abece673ea19bb524b5f1f501cc83619cb9d1189846cd87ce2a52607c3b0296dfd201af3f0f7
7
- data.tar.gz: 894db060b527d318f5282cc81b72c447fb4452a0a94b23967a7b3fcb9a9ba31187ff2f82ae135245e5a50aa287af81898959339c7fe066cec7187ba7e134e47a
6
+ metadata.gz: 1211190b983441988945da00c600a61cc9b3404a89676e19eea0d4763a026f048b922dcf25bf6454103b306d73633c883b627f9066f76eb7b3d3274a5579ced8
7
+ data.tar.gz: 18fe7b423a12804bfd27c9562513df6295487029e80771a24e3e52dbe0d963a3c5ae36324a4d741f04292b93dda2a22ad145451d36f02222478ad1534ab69101
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ 0.14.3
2
+ ------
3
+
4
+ * Quote the paths of the executables `ember-cli-rails` runs (`ember`, `vite`,
5
+ `npm`, `yarn`, `pnpm`, `bower` and `bundler`) before handing their command
6
+ lines to the shell. An application, or an executable configured with an
7
+ option such as `npm_path`, under a directory whose name contained a space
8
+ or another character the shell treats specially failed to build or install
9
+ * Stop passing `format: :html` to the route `mount_ember_app` draws. Rails
10
+ ignored a Symbol `format:` until rails/rails#59418, which makes it a
11
+ format requirement with `html` as the default. With it, the route's glob
12
+ swallowed the extension of an asset path such as `/assets/app.js`, so the
13
+ request was treated as HTML and answered with the application's
14
+ `index.html` instead of reaching the mounted assets
15
+
1
16
  0.14.2
2
17
  ------
3
18
 
@@ -1,3 +1,4 @@
1
+ require "shellwords"
1
2
  require "terrapin"
2
3
 
3
4
  module EmberCli
@@ -8,7 +9,7 @@ module EmberCli
8
9
  end
9
10
 
10
11
  def test
11
- line = Terrapin::CommandLine.new(paths.ember, "test --environment test")
12
+ line = Terrapin::CommandLine.new(executable(paths.ember), "test --environment test")
12
13
 
13
14
  line.command
14
15
  end
@@ -25,7 +26,7 @@ module EmberCli
25
26
  # Vite-based blueprint (`ember-cli >= 6.8`). This is what the blueprint's
26
27
  # own `npm start` script runs.
27
28
  def dev_server(host:, port:)
28
- line = Terrapin::CommandLine.new(paths.vite, [
29
+ line = Terrapin::CommandLine.new(executable(paths.vite), [
29
30
  "--host :host",
30
31
  "--port :port",
31
32
  "--strictPort",
@@ -39,6 +40,13 @@ module EmberCli
39
40
 
40
41
  attr_reader :options, :paths
41
42
 
43
+ # Terrapin quotes the values it interpolates into a command line, but not
44
+ # the executable it starts with, so quote that before it reaches the
45
+ # shell.
46
+ def executable(path)
47
+ Shellwords.escape(path.to_s)
48
+ end
49
+
42
50
  def process_watcher
43
51
  options.fetch(:watcher) { EmberCli.configuration.watcher }
44
52
  end
@@ -67,7 +75,7 @@ module EmberCli
67
75
  # Ember application, where Vite leaves stale files in place unless asked
68
76
  # to clear them.
69
77
  def vite_build
70
- line = Terrapin::CommandLine.new(paths.vite, [
78
+ line = Terrapin::CommandLine.new(executable(paths.vite), [
71
79
  "build",
72
80
  "--mode :mode",
73
81
  "--outDir :output_path",
@@ -90,7 +98,7 @@ module EmberCli
90
98
  # `--watcher` names the backend that watches, so it rides along only
91
99
  # when the build watches.
92
100
  def ember_build(watch: false)
93
- line = Terrapin::CommandLine.new(paths.ember, [
101
+ line = Terrapin::CommandLine.new(executable(paths.ember), [
94
102
  "build",
95
103
  ("--watch" if watch),
96
104
  ("--watcher :watcher" if watch && process_watcher),
@@ -12,7 +12,6 @@ module ActionDispatch
12
12
  routing_options.reverse_merge!(
13
13
  controller: "ember_cli/ember",
14
14
  action: "index",
15
- format: :html,
16
15
  )
17
16
 
18
17
  scope constraints: ::EmberCli::EmberConstraint.new do
@@ -1,3 +1,5 @@
1
+ require "shellwords"
2
+
1
3
  require "ember_cli/command"
2
4
  require "ember_cli/runner"
3
5
 
@@ -62,7 +64,7 @@ module EmberCli
62
64
 
63
65
  def install
64
66
  if paths.gemfile.exist?
65
- run! "#{paths.bundler} install"
67
+ run! "#{executable(paths.bundler)} install"
66
68
  end
67
69
 
68
70
  if invalid_ember_dependencies?
@@ -71,15 +73,17 @@ module EmberCli
71
73
 
72
74
  case paths.package_manager
73
75
  when :yarn
74
- run! "#{paths.yarn} install"
76
+ run! "#{executable(paths.yarn)} install"
75
77
  when :pnpm
76
- run! "#{paths.pnpm} install"
78
+ run! "#{executable(paths.pnpm)} install"
77
79
  else
78
- run! "#{paths.npm} prune && #{paths.npm} install"
80
+ npm = executable(paths.npm)
81
+ run! "#{npm} prune && #{npm} install"
79
82
  end
80
83
 
81
84
  if paths.bower_json.exist?
82
- run! "#{paths.bower} prune && #{paths.bower} install"
85
+ bower = executable(paths.bower)
86
+ run! "#{bower} prune && #{bower} install"
83
87
  end
84
88
  end
85
89
 
@@ -94,8 +98,14 @@ module EmberCli
94
98
 
95
99
  delegate :run, :run!, to: :runner
96
100
 
101
+ # The executables come from configuration and the filesystem, so quote
102
+ # them before interpolating them into a command line for the shell.
103
+ def executable(path)
104
+ Shellwords.escape(path.to_s)
105
+ end
106
+
97
107
  def invalid_ember_dependencies?
98
- !run("#{paths.ember} version").success?
108
+ !run("#{executable(paths.ember)} version").success?
99
109
  rescue DependencyError
100
110
  false
101
111
  end
@@ -1,3 +1,3 @@
1
1
  module EmberCli
2
- VERSION = "0.14.2".freeze
2
+ VERSION = "0.14.3".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.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  - !ruby/object:Gem::Version
217
217
  version: '0'
218
218
  requirements: []
219
- rubygems_version: 4.0.16
219
+ rubygems_version: 4.0.20
220
220
  specification_version: 4
221
221
  summary: Integration between Ember CLI and Rails
222
222
  test_files: []