nanoc-dart-sass 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +6 -0
- data/lib/nanoc/dart_sass/filter.rb +39 -7
- 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
@@ -54,10 +54,7 @@ module Nanoc
|
|
54
54
|
def find_item_for_url(url)
|
55
55
|
pat = url.sub(/\Ananoc:/, '')
|
56
56
|
|
57
|
-
|
58
|
-
if pat.match?(%r{(/|^)[^.]+$})
|
59
|
-
pat += '.*'
|
60
|
-
end
|
57
|
+
is_extension_given = !pat.match?(%r{(/|^)[^.]+$})
|
61
58
|
|
62
59
|
# Convert to absolute pattern
|
63
60
|
pat =
|
@@ -68,13 +65,48 @@ module Nanoc
|
|
68
65
|
File.expand_path(pat, dirname)
|
69
66
|
end
|
70
67
|
|
71
|
-
|
68
|
+
items = collect_items(pat, is_extension_given)
|
72
69
|
|
73
|
-
|
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
|
74
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.*')))
|
75
99
|
end
|
76
100
|
|
77
|
-
|
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
|
78
110
|
end
|
79
111
|
end
|
80
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
|