jekyll_plugin_support 3.1.0 → 3.1.1
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/CHANGELOG.md +6 -0
- data/README.md +18 -0
- data/lib/helper/jekyll_plugin_helper_class.rb +23 -3
- data/lib/jekyll_plugin_support/version.rb +1 -1
- data/spec/status_persistence.txt +7 -4
- 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: 89c80e46269ce8e9476f0758550b2d0acb48bd9462ffe0e6d957c436d1c98d2d
|
4
|
+
data.tar.gz: 920e92f0c86d0884193650af1039790df087edc158b529537d37c1fa1d04e680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d0045d9f09b3b76c8306073d50c06b1f93fd4c7914a08ce24a826d75ffa033c84660710d8822ea25f18e5585cb94232e7634d68f7b4822aee311865768fc028
|
7
|
+
data.tar.gz: 779da912b97c957c69f8829265c7ad2ad213c6ccf286acae65d87e13a03c24d23e32eea85d22edd9c93aa4084f07732178325f9e7cb7bbb5484859b8e2f8ca79
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 3.1.1 / 2025-09-13
|
4
|
+
|
5
|
+
* Now looks up Windows environment variables (surrounded by `%` characters).
|
6
|
+
An error is generated for undefined variables.
|
7
|
+
|
8
|
+
|
3
9
|
## 3.1.0 / 2025-06-10
|
4
10
|
|
5
11
|
* Added attribute `order` and method `field` to support `jekyll_outline`.
|
data/README.md
CHANGED
@@ -71,6 +71,24 @@ Jekyll plugin tags created from `jekyll_plugin_support` framework automatically
|
|
71
71
|
|
72
72
|
## Installation
|
73
73
|
|
74
|
+
### If You Need Windows Environment Variable Expansion
|
75
|
+
|
76
|
+
This only works if Jekyll is running on a Windows / WSL machine.
|
77
|
+
If you have a Mac, ignore the rest of this section, however be sure
|
78
|
+
not to try to include a file whose name contains two percent characters.
|
79
|
+
|
80
|
+
If a %WindowsStyleEnvironmentVariable% is detected in the `url` parameter,
|
81
|
+
`wslvar` is called.
|
82
|
+
If your WSL installation is old it might not have the `wslvar` command
|
83
|
+
|
84
|
+
The wslvar utility is part of the wslu package, a collection of useful utilities that come with WSL.
|
85
|
+
The most straightforward fix is to reinstall it.
|
86
|
+
|
87
|
+
```shell
|
88
|
+
$ sudo apt update
|
89
|
+
$ sudo apt install wslu
|
90
|
+
```
|
91
|
+
|
74
92
|
### For A Jekyll Website
|
75
93
|
|
76
94
|
`Jekyll_plugin_support` is packaged as a Ruby gem.
|
@@ -5,10 +5,10 @@ require 'yaml'
|
|
5
5
|
module JekyllSupport
|
6
6
|
# Class methods for JekyllPluginHelper
|
7
7
|
class JekyllPluginHelper
|
8
|
-
# Expand an environment variable reference
|
8
|
+
# Expand an environment variable reference; first expand bash environment variables, then expand windows environment vars
|
9
9
|
def self.expand_env(str, logger = nil, die_if_undefined: false)
|
10
|
-
str&.gsub(/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}/) do
|
11
|
-
envar = Regexp.last_match
|
10
|
+
x = str&.gsub(/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}/) do
|
11
|
+
envar = Regexp.last_match 1
|
12
12
|
unless ENV.key? envar
|
13
13
|
msg = "jekyll_plugin_support error: environment variable #{envar} is undefined"
|
14
14
|
raise JekyllPluginSupportError, msg.red, [] if die_if_undefined
|
@@ -21,6 +21,26 @@ module JekyllSupport
|
|
21
21
|
end
|
22
22
|
ENV.fetch(envar, nil)
|
23
23
|
end
|
24
|
+
# Only expand %VAR% if x is not nil and contains a %
|
25
|
+
if x&.include?('%')
|
26
|
+
x.gsub(/%([a-zA-Z_][a-zA-Z0-9_]*)%|{\g<1>}/) do
|
27
|
+
envar = Regexp.last_match 1
|
28
|
+
value = `wslvar #{envar} &2> /dev/null`.chomp
|
29
|
+
unless value
|
30
|
+
msg = "jekyll_plugin_support error: Windows environment variable %#{envar}% is undefined"
|
31
|
+
raise JekyllPluginSupportError, msg.red, [] if die_if_undefined
|
32
|
+
|
33
|
+
if logger
|
34
|
+
logger.warn msg
|
35
|
+
else
|
36
|
+
puts msg.red
|
37
|
+
end
|
38
|
+
end
|
39
|
+
value
|
40
|
+
end
|
41
|
+
else
|
42
|
+
x
|
43
|
+
end
|
24
44
|
end
|
25
45
|
|
26
46
|
def self.generate_message(klass, tag_name, version)
|
data/spec/status_persistence.txt
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------------------ | ------ | --------------- |
|
3
|
-
./spec/
|
4
|
-
./spec/
|
5
|
-
./spec/jekyll_plugin_helper_options_spec.rb[1:
|
6
|
-
./spec/jekyll_plugin_helper_options_spec.rb[1:
|
3
|
+
./spec/custom_error_spec.rb[1:1] | failed | 0.00772 seconds |
|
4
|
+
./spec/custom_error_spec.rb[2:1] | passed | 0.0011 seconds |
|
5
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:1] | failed | 0.00005 seconds |
|
6
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:2] | failed | 0.00003 seconds |
|
7
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:3] | failed | 0.00003 seconds |
|
8
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:4] | failed | 0.00003 seconds |
|
9
|
+
./spec/liquid_variable_parsing_spec.rb[1:1] | failed | 0.00003 seconds |
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_plugin_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.7.2
|
185
185
|
specification_version: 4
|
186
186
|
summary: Provides a framework for writing and testing Jekyll plugins
|
187
187
|
test_files:
|