trmnl_preview 0.32.1 → 0.32.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/CHANGELOG.md +8 -0
- data/lib/trmnlp/outbound_request.rb +19 -0
- data/lib/trmnlp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55b67180ccff89b08d78384020c460edfdcafe59515cb23253e227cdc8f279cc
|
|
4
|
+
data.tar.gz: f95ebeec6e33edc5398bae038860acbe18dc4846d93676b98c7bb73a33800f24
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8a5d6c769d20a3e7bef9b5c74f4d29ccad61f642210a0f7a4c2203393db36b950d34f56050b1b7e9b93d2293160d03a2f658b7be45951a63197eb400145d9af
|
|
7
|
+
data.tar.gz: 4e0b560990974bb719c0a99f441f6e85e8904e75e2172c3cf8ac230f4020260023ea481507f68946e1f876ada648fe76963360a877a611a3456ae454d27ce808
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
# Changelog
|
|
3
3
|
|
|
4
|
+
## 0.32.3
|
|
5
|
+
|
|
6
|
+
- The poller refuses a polling URL line that TRMNL refuses, before it sends a request, and gives TRMNL's reason. A line that is not a complete http(s) URL, such as `h` or `//example.com`, has no host because a field it needs is empty, still has a `{{` or `{%`, or has a space or a non-ASCII host. Before, such a line could wait 10 seconds or fail with a connection error that did not say what was wrong.
|
|
7
|
+
|
|
8
|
+
## 0.32.2
|
|
9
|
+
|
|
10
|
+
- The Docker image starts again. The 0.32.1 image kept the X display lock from its build in `/tmp`, so the display never started and every command, such as `trmnlp serve` or `trmnlp test`, waited forever. Running with `--tmpfs /tmp` worked around it. A stopped container started again had the same problem, and now clears the lock before the display starts. If the display still does not start, trmnlp stops within 10 seconds and prints why, where it used to wait forever.
|
|
11
|
+
|
|
4
12
|
## 0.32.1
|
|
5
13
|
|
|
6
14
|
- `trmnlp test`'s publishable recipe fails a view that has no markup file and no shared markup. It drew only "Missing template", and passed. The message now names the file from the plugin folder, such as `src/full.liquid`, not the folders on your computer.
|
|
@@ -37,6 +37,9 @@ module TRMNLP
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def call(verb, url, headers:, body:)
|
|
40
|
+
refusal = refusal_reason(encoded(url))
|
|
41
|
+
return [nil, refusal] if refusal
|
|
42
|
+
|
|
40
43
|
attempts = 0
|
|
41
44
|
begin
|
|
42
45
|
attempts += 1
|
|
@@ -82,6 +85,22 @@ module TRMNLP
|
|
|
82
85
|
connection.get("#{url}#{url.include?('?') ? '&' : '?'}#{body}")
|
|
83
86
|
end
|
|
84
87
|
|
|
88
|
+
# The same urls and words as TRMNL, which refuses these before it sends a request.
|
|
89
|
+
def refusal_reason(url)
|
|
90
|
+
return 'the url still contains an unrendered template tag' if url.match?(/\{\{|\{%/)
|
|
91
|
+
|
|
92
|
+
uri = URI.parse(url)
|
|
93
|
+
return 'the url is not a complete http(s) url' unless %w[http https].include?(uri.scheme&.downcase)
|
|
94
|
+
|
|
95
|
+
'the url has no host, so a field it needs is probably empty' if uri.hostname.to_s.empty?
|
|
96
|
+
rescue URI::InvalidURIError
|
|
97
|
+
if url.match?(/[^\x00-\x7F]/)
|
|
98
|
+
'the url host has non-ASCII characters, use its punycode (xn--) form'
|
|
99
|
+
else
|
|
100
|
+
'the url has a character that must be percent-encoded, such as a space'
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
85
104
|
def failure_reason(response)
|
|
86
105
|
return 'the host replied 429 Too Many Requests' if response.status == 429
|
|
87
106
|
|
data/lib/trmnlp/version.rb
CHANGED