nanoc-dart-sass 1.0.1 → 1.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 +4 -4
- data/NEWS.md +10 -0
- data/lib/nanoc/dart_sass/filter.rb +40 -11
- data/lib/nanoc/dart_sass/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b3ec8688e0eacf5312456127b9f9137d7ee17fdc3b2788c8eb44d2a18a48d39
|
4
|
+
data.tar.gz: dfc61b8856486c27210a20b79fa70da2852a88f4eeb5a5e804b2b3411e8d7653
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054bdb5a6ba1c907c2c8fc06f56efde60a173df8b0aa328b3654df7b7a8e42017b0cc123bcf09317aa6e93ef1754ef65a83e659122ea1794950f8d63c87ef9f8
|
7
|
+
data.tar.gz: ba2afccd8953791279521d4444053df10e94ad69e9b16f787519b621e69fdf9e5f9b71bb72a861cb57165ccb9b8e4bf918724bef1805362fd3be2c1c6c2c32dc
|
data/NEWS.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# nanoc-dart-sass news
|
2
2
|
|
3
|
+
## 1.0.3 (2024-04-19)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
- Added support for importing partials and directories (#1690, #1699)
|
8
|
+
|
9
|
+
## 1.0.2 (2023-09-30)
|
10
|
+
|
11
|
+
- Fix dart-sass compatibility (#1664)
|
12
|
+
|
3
13
|
## 1.0.1 (2023-06-15)
|
4
14
|
|
5
15
|
- Added support for importing relative paths (#1646, #1653)
|
@@ -23,9 +23,6 @@ module Nanoc
|
|
23
23
|
syntax: syntax,
|
24
24
|
)
|
25
25
|
result.css
|
26
|
-
rescue StandardError => e # rubocop:disable Lint/UselessRescue
|
27
|
-
# TODO: use full_message for syntax errors
|
28
|
-
raise e
|
29
26
|
end
|
30
27
|
|
31
28
|
class NanocImporter
|
@@ -34,7 +31,7 @@ module Nanoc
|
|
34
31
|
@source_item = source_item
|
35
32
|
end
|
36
33
|
|
37
|
-
def canonicalize(url, **)
|
34
|
+
def canonicalize(url, *, **)
|
38
35
|
# Construct proper URL with `nanoc:` prefix if needed
|
39
36
|
if url.start_with?('nanoc:')
|
40
37
|
url
|
@@ -57,10 +54,7 @@ module Nanoc
|
|
57
54
|
def find_item_for_url(url)
|
58
55
|
pat = url.sub(/\Ananoc:/, '')
|
59
56
|
|
60
|
-
|
61
|
-
if pat.match?(%r{(/|^)[^.]+$})
|
62
|
-
pat += '.*'
|
63
|
-
end
|
57
|
+
is_extension_given = !pat.match?(%r{(/|^)[^.]+$})
|
64
58
|
|
65
59
|
# Convert to absolute pattern
|
66
60
|
pat =
|
@@ -71,13 +65,48 @@ module Nanoc
|
|
71
65
|
File.expand_path(pat, dirname)
|
72
66
|
end
|
73
67
|
|
74
|
-
|
68
|
+
items = collect_items(pat, is_extension_given)
|
75
69
|
|
76
|
-
|
70
|
+
# Get the single matching item, or error if there isn’t exactly one
|
71
|
+
items = items.compact
|
72
|
+
case items.size
|
73
|
+
when 0
|
77
74
|
raise "Could not find an item matching pattern `#{pat}`"
|
75
|
+
when 1
|
76
|
+
items.first
|
77
|
+
else
|
78
|
+
raise "It is not clear which item to import. Multiple items match `#{pat}`: #{items.map { _1.identifier.to_s }.sort.join(', ')}"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Given a pattern, return a collection of items that match this pattern.
|
83
|
+
# This goes beyond what Nanoc patterns typically support by e.g.
|
84
|
+
# supporting partials and index imports.
|
85
|
+
def collect_items(pat, is_extension_given)
|
86
|
+
items = []
|
87
|
+
|
88
|
+
# Try as a regular path
|
89
|
+
items.concat(try_pat(pat, is_extension_given))
|
90
|
+
|
91
|
+
# Try as a partial
|
92
|
+
partial_pat = File.join(File.dirname(pat), "_#{File.basename(pat)}")
|
93
|
+
items.concat(try_pat(partial_pat, is_extension_given))
|
94
|
+
|
95
|
+
# Try as index
|
96
|
+
unless is_extension_given
|
97
|
+
items.concat(@items.find_all(File.join(pat, '/index.*')))
|
98
|
+
items.concat(@items.find_all(File.join(pat, '/_index.*')))
|
78
99
|
end
|
79
100
|
|
80
|
-
|
101
|
+
items
|
102
|
+
end
|
103
|
+
|
104
|
+
def try_pat(pat, is_extension_given)
|
105
|
+
if is_extension_given
|
106
|
+
@items.find_all(pat)
|
107
|
+
else
|
108
|
+
@items.find_all("#{pat}.*")
|
109
|
+
end
|
81
110
|
end
|
82
111
|
end
|
83
112
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-dart-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nanoc-core
|
@@ -51,11 +51,12 @@ files:
|
|
51
51
|
- lib/nanoc/dart_sass.rb
|
52
52
|
- lib/nanoc/dart_sass/filter.rb
|
53
53
|
- lib/nanoc/dart_sass/version.rb
|
54
|
-
homepage: https://nanoc.
|
54
|
+
homepage: https://nanoc.app/
|
55
55
|
licenses:
|
56
56
|
- MIT
|
57
57
|
metadata:
|
58
58
|
rubygems_mfa_required: 'true'
|
59
|
+
source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-dart-sass-v1.0.3/nanoc-dart-sass
|
59
60
|
post_install_message:
|
60
61
|
rdoc_options: []
|
61
62
|
require_paths:
|
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
- !ruby/object:Gem::Version
|
72
73
|
version: '0'
|
73
74
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.5.9
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
78
|
summary: Dart Sass filter for Nanoc
|