svelte-on-rails 2.0.2 → 2.0.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: '0595a01f21a83a1c3a7bf6642015c37b4c20da914c1ff120169748af5925671d'
4
- data.tar.gz: 2f07f7525487eff68c481ebb83f709f4731755ccd097df0d8f2e9f62cc33b888
3
+ metadata.gz: 433a24cebdd461077d7c4ebd071d0f8ccfaa37bf640c38988c1a3b2e6d41b3f1
4
+ data.tar.gz: 6746df6083f635e08dd27e3e94c3fa9e25dc5c26632ffabb9da65fc39364b259
5
5
  SHA512:
6
- metadata.gz: 0f27dfc80fe5d610e0c30dffec9113470472f8cde869da180fe15723f6f497dfab5afa97597b4b896f39845b667c283cbd45e45f9cc42b56808cf0fcf131a00b
7
- data.tar.gz: 05dfd0aeccf917ad9a40d7b846066fae6d017709df5bf67824ddd1a96f3e931007c4fdba01daeed35220d32141b230bebff800b8ed8ebecbca658d3758c3c07e
6
+ metadata.gz: 57ad22eb8057a368e49653eeb1b9f6abce0151b137c2d8f45c59ec702a14471a1da30b9e265bbac5d5f86a0658849fb18cf338515f05d9d9880f0d5897fbf57b
7
+ data.tar.gz: cdca6d74748f650862b5a815e3d7c90d1863b501582128d182578888092c003190b4a1a80893ffcd20e2acd27c6f0ac0b0b06e47efc80541b9e4eeb2cb25e68b
data/README.md CHANGED
@@ -81,7 +81,7 @@ If you have issues, please open one, and contributors are welcome!
81
81
  - npm on latest versions
82
82
  - node installed.
83
83
  - If node is not included on the PATH you can configure your node path by environment variable `SVELTE_ON_RAILS_NODE_BIN`
84
- - it checks for `nvm` and if installed, gets the node path from there.
84
+ - if `nvm` is installed it gets the path to the node-binary from there.
85
85
 
86
86
  ## Installation from cero ⚙️
87
87
 
@@ -108,11 +108,13 @@ module SvelteOnRails
108
108
  n = ENV['SVELTE_ON_RAILS_NODE_BIN'] || 'node'
109
109
 
110
110
  if n == 'node'
111
- # Check if NVM is installed
112
- nvm_check, status = Open3.capture2('command -v nvm')
113
- if status.success? && !nvm_check.strip.empty?
111
+
112
+ nvm_installed = false
113
+ nvm_dir = ENV['NVM_DIR'] || File.expand_path('~/.nvm')
114
+ nvm_installed ||= File.exist?("#{nvm_dir}/nvm.sh")
115
+
116
+ if nvm_installed
114
117
  # Use NVM_DIR if set, otherwise default to ~/.nvm
115
- nvm_dir = ENV['NVM_DIR'] || File.expand_path('~/.nvm')
116
118
  command = "[ -s \"#{nvm_dir}/nvm.sh\" ] && . \"#{nvm_dir}/nvm.sh\" && nvm which current"
117
119
  node_path, status = Open3.capture2("bash -lc '#{command}'")
118
120
 
@@ -128,7 +130,7 @@ module SvelteOnRails
128
130
 
129
131
  n
130
132
  rescue StandardError => e
131
- raise "Failed to detect Node.js binary: #{e.message}. Ensure Node.js is installed and accessible, or set SVELTE_ON_RAILS_NODE_BIN."
133
+ raise "Failed to detect Node.js binary: «#{e.message}». Ensure Node.js is installed and accessible, or set SVELTE_ON_RAILS_NODE_BIN."
132
134
  end
133
135
  end
134
136
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svelte-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair