easol-canvas 2.2.0 → 3.1.0

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: 988493985d369b518ca9bb2b802c8d2bc639e7a632090434b9c558e3fc5d6256
4
- data.tar.gz: 3d9d3df30a6d5a6db096e570d3cba97fc9e4d26284d7b4596b535bf57080991f
3
+ metadata.gz: e63c9433580fb2f338b5b9ebdb7f86697e9ff5f9a9c57314463779330d81d8a0
4
+ data.tar.gz: 22b11a8f25bbf68a8c81431987008d34d1f6803eeef5737fb2dd014c742d4403
5
5
  SHA512:
6
- metadata.gz: de8eb335498a0fd7dea007d77ac4cd25503ee85da121dfd9fa9c0eec96932294f532194abecbc57a40e1411449f14baecfda8006f3ce4a09aff6c52bc2afb03d
7
- data.tar.gz: 55c0d63a5758238e008f9a88642c8e77df735192b67c0fa32d35f7e6562001d19dbd082fdada888f7fb679286f864275bc7c50aeb129bbc65ca16ae0e24e7f8d
6
+ metadata.gz: 31e7aaad1f6562f238917a9101629d89bc4f5da3bb5be9e006933bbeabb0315a75a652cc03d943460f8de4077895fa4deada5aa504a2068226d5e7a18ab6ed7d
7
+ data.tar.gz: bfc8b4002c79133a134f3a2ad073631f9d93595573e2b442d489f478e635c4519c267f0834c684eb7a6b05d4432d9337cb7c3ec3201f65694c29986f6d8a60c4
@@ -38,6 +38,7 @@ module Canvas
38
38
  register_tag("easol_badge", ::Liquid::Tag)
39
39
  register_tag("accommodation_availability", ::Liquid::Block)
40
40
  register_tag("cache", ::Liquid::Block)
41
+ register_tag("currency_switcher", ::Liquid::Tag)
41
42
  end
42
43
  end
43
44
  end
@@ -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 "sassc"
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
- SassC::Engine.new(@file, style: :compressed).render
18
+ DartSass.new(@file, style: :compressed).render
19
19
  true
20
- rescue SassC::SyntaxError => e
20
+ rescue DartSass::Error => e
21
21
  @errors = [e.message]
22
22
  false
23
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canvas
4
- VERSION = "2.2.0"
4
+ VERSION = "3.1.0"
5
5
  end
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: 2.2.0
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-08-17 00:00:00.000000000 Z
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: sassc
71
+ name: dartsass-rails
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '2.4'
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: '2.4'
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.0.3.1
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: []