cssbundling-rails 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cssbundling/version.rb +1 -1
- data/lib/tasks/cssbundling/build.rake +20 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0e0270ce3ff8d039ffc7b9d7a3853d7d67b7c4b2571d640078b4392a08dd601
|
4
|
+
data.tar.gz: 7973f04cf1ef54513b9e36ff0571024e087e0515986ced9a2cf8e9e5468cb00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcba15c277b4a46a8699ac641e9904b925c4a39c402a0c69ac5b7fb7856f13a5d8ab2ece33b389533e1b5e9013bca180a52dd139842fcb6fff79d2db0f268361
|
7
|
+
data.tar.gz: 29e8e279c1811baefff15f8baa4a1b4926701ed6a3c2e8d4b4a744c57aa50ffc48c68824b4dc96dd9d313a6bc3f0e3e16b6da4b8975366c86b1965f689ee127b
|
data/lib/cssbundling/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :css do
|
2
2
|
desc "Install JavaScript dependencies"
|
3
3
|
task :install do
|
4
|
-
command = install_command
|
4
|
+
command = Cssbundling::Tasks.install_command
|
5
5
|
unless system(command)
|
6
6
|
raise "cssbundling-rails: Command install failed, ensure #{command.split.first} is installed"
|
7
7
|
end
|
@@ -9,7 +9,7 @@ namespace :css do
|
|
9
9
|
|
10
10
|
desc "Build your CSS bundle"
|
11
11
|
build_task = task :build do
|
12
|
-
command = build_command
|
12
|
+
command = Cssbundling::Tasks.build_command
|
13
13
|
unless system(command)
|
14
14
|
raise "cssbundling-rails: Command build failed, ensure `#{command}` runs without errors"
|
15
15
|
end
|
@@ -17,20 +17,26 @@ namespace :css do
|
|
17
17
|
build_task.prereqs << :install unless ENV["SKIP_YARN_INSTALL"] || ENV["SKIP_BUN_INSTALL"]
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
raise "cssbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
24
|
-
end
|
20
|
+
module Cssbundling
|
21
|
+
module Tasks
|
22
|
+
extend self
|
25
23
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
24
|
+
def install_command
|
25
|
+
return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
26
|
+
return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
27
|
+
raise "cssbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
28
|
+
end
|
31
29
|
|
32
|
-
def
|
33
|
-
|
30
|
+
def build_command
|
31
|
+
return "bun run build:css" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
32
|
+
return "yarn build:css" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
33
|
+
raise "cssbundling-rails: No suitable tool found for building CSS"
|
34
|
+
end
|
35
|
+
|
36
|
+
def tool_exists?(tool)
|
37
|
+
system "command -v #{tool} > /dev/null"
|
38
|
+
end
|
39
|
+
end
|
34
40
|
end
|
35
41
|
|
36
42
|
unless ENV["SKIP_CSS_BUILD"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cssbundling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-09-
|
12
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|