easol-canvas 2.2.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas/checks/valid_liquid_check.rb +1 -0
- data/lib/canvas/dartsass.rb +47 -0
- data/lib/canvas/validators/sass.rb +3 -3
- data/lib/canvas/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e63c9433580fb2f338b5b9ebdb7f86697e9ff5f9a9c57314463779330d81d8a0
|
4
|
+
data.tar.gz: 22b11a8f25bbf68a8c81431987008d34d1f6803eeef5737fb2dd014c742d4403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e7aaad1f6562f238917a9101629d89bc4f5da3bb5be9e006933bbeabb0315a75a652cc03d943460f8de4077895fa4deada5aa504a2068226d5e7a18ab6ed7d
|
7
|
+
data.tar.gz: bfc8b4002c79133a134f3a2ad073631f9d93595573e2b442d489f478e635c4519c267f0834c684eb7a6b05d4432d9337cb7c3ec3201f65694c29986f6d8a60c4
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "open3"
|
4
|
+
|
5
|
+
module Canvas
|
6
|
+
# This is a thin wrapper around the dartsass binary as provided by
|
7
|
+
# dartsass-rails.
|
8
|
+
#
|
9
|
+
# It is compatible with SassC::Engine as much as we were using it, but 100%
|
10
|
+
# compatability is not a goal.
|
11
|
+
class DartSass
|
12
|
+
Error = Class.new(StandardError)
|
13
|
+
|
14
|
+
def initialize(css, config)
|
15
|
+
@css = css
|
16
|
+
@config = config
|
17
|
+
end
|
18
|
+
|
19
|
+
def render
|
20
|
+
stdout, stderr, status = Open3.capture3(*command, stdin_data: @css)
|
21
|
+
|
22
|
+
if status == 0
|
23
|
+
stdout
|
24
|
+
else
|
25
|
+
raise Error.new(stderr)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def command
|
32
|
+
[dartsass, "--stdin", style, *load_paths].compact
|
33
|
+
end
|
34
|
+
|
35
|
+
def dartsass
|
36
|
+
Gem.bin_path("dartsass-rails", "dartsass").shellescape
|
37
|
+
end
|
38
|
+
|
39
|
+
def style
|
40
|
+
(s = @config[:style]) && "--style=#{s.to_s.shellescape}"
|
41
|
+
end
|
42
|
+
|
43
|
+
def load_paths
|
44
|
+
Array(@config[:load_paths]).map { "--load-path=#{_1.shellescape}" }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "canvas/dartsass"
|
4
4
|
|
5
5
|
module Canvas
|
6
6
|
module Validator
|
@@ -15,9 +15,9 @@ module Canvas
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def validate
|
18
|
-
|
18
|
+
DartSass.new(@file, style: :compressed).render
|
19
19
|
true
|
20
|
-
rescue
|
20
|
+
rescue DartSass::Error => e
|
21
21
|
@errors = [e.message]
|
22
22
|
false
|
23
23
|
end
|
data/lib/canvas/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easol-canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Byrne
|
8
8
|
- Ian Mooney
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -68,19 +68,19 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '5.3'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: dartsass-rails
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 0.4.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 0.4.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: json-schema
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- lib/canvas/checks/valid_sass_check.rb
|
122
122
|
- lib/canvas/cli.rb
|
123
123
|
- lib/canvas/constants.rb
|
124
|
+
- lib/canvas/dartsass.rb
|
124
125
|
- lib/canvas/lint.rb
|
125
126
|
- lib/canvas/offense.rb
|
126
127
|
- lib/canvas/services/expand_attributes.rb
|
@@ -155,7 +156,7 @@ homepage: https://rubygems.org/gems/easol-canvas
|
|
155
156
|
licenses:
|
156
157
|
- MIT
|
157
158
|
metadata: {}
|
158
|
-
post_install_message:
|
159
|
+
post_install_message:
|
159
160
|
rdoc_options: []
|
160
161
|
require_paths:
|
161
162
|
- lib
|
@@ -170,8 +171,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
171
|
- !ruby/object:Gem::Version
|
171
172
|
version: '0'
|
172
173
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
-
signing_key:
|
174
|
+
rubygems_version: 3.3.7
|
175
|
+
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: CLI to help with building themes for Easol
|
177
178
|
test_files: []
|