jsbundling-rails 1.2.0 → 1.2.1

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: d27f6cc62feb84d7b81b8eba5aa68fec1232775b88ca5d16b6b2a5d2efb0183d
4
- data.tar.gz: 1d5e167c6802db6fe99ce8df513313597f42d586bd19bed864645e3db4682728
3
+ metadata.gz: 1bf6310c232f781ceda13fc2e44c0196884afdfe50318f6136a6e95c403f2521
4
+ data.tar.gz: 296b8a667e1fe8295b7efe1f59185a4ca4a4aa7ccd18697e8e4a1e93c02d2257
5
5
  SHA512:
6
- metadata.gz: a1f15e3bfe2fbfdf113990d126cc1e54e494e2666acaedd4969ee590446c1e4f5aa7395dd4da537e4d8fef7ef0c3e52a27513dc184b9950d821f98d942458081
7
- data.tar.gz: 8789b31503404c6f88fea2cf98517e01e31126004d061373242730a1d9de3dcc24bb470577cb6586117115ff79da63f37e7e51dd0d751fa9b37479f4a4048113
6
+ metadata.gz: d851108dd46513415cc8645a11992fff06181d94580e9681615d12e0ec8ce1ef7b9ed542c807933c7ad66ac60f710e2037533e003a4d30a65026f4b687e9b8eb
7
+ data.tar.gz: efbffe3102d9cd3a746d76f55241413c0015d3bd8b7fe6120f6a4ac9b2e64c6d3a563d2a2182e44f33983977a75315c257230bf91a2da040e44482b10926f73d
@@ -1,3 +1,3 @@
1
1
  module Jsbundling
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  namespace :javascript do
2
2
  desc "Install JavaScript dependencies"
3
3
  task :install do
4
- command = install_command
4
+ command = Jsbundling::Tasks.install_command
5
5
  unless system(command)
6
6
  raise "jsbundling-rails: Command install failed, ensure #{command.split.first} is installed"
7
7
  end
@@ -9,7 +9,7 @@ namespace :javascript do
9
9
 
10
10
  desc "Build your JavaScript bundle"
11
11
  build_task = task :build do
12
- command = build_command
12
+ command = Jsbundling::Tasks.build_command
13
13
  unless system(command)
14
14
  raise "jsbundling-rails: Command build failed, ensure `#{command}` runs without errors"
15
15
  end
@@ -18,20 +18,26 @@ namespace :javascript do
18
18
  build_task.prereqs << :install unless ENV["SKIP_YARN_INSTALL"] || ENV["SKIP_BUN_INSTALL"]
19
19
  end
20
20
 
21
- def install_command
22
- return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
23
- return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
24
- raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
25
- end
21
+ module Jsbundling
22
+ module Tasks
23
+ extend self
26
24
 
27
- def build_command
28
- return "bun run build" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
29
- return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn')
30
- raise "jsbundling-rails: No suitable tool found for building JavaScript"
31
- end
25
+ def install_command
26
+ return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
27
+ return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
28
+ raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
29
+ end
32
30
 
33
- def tool_exists?(tool)
34
- system "command -v #{tool} > /dev/null"
31
+ def build_command
32
+ return "bun run build" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
33
+ return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn')
34
+ raise "jsbundling-rails: No suitable tool found for building JavaScript"
35
+ end
36
+
37
+ def tool_exists?(tool)
38
+ system "command -v #{tool} > /dev/null"
39
+ end
40
+ end
35
41
  end
36
42
 
37
43
  unless ENV["SKIP_JS_BUILD"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsbundling-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties