raindeer 0.11.0 → 0.11.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/lib/cli/static.rb +14 -2
- data/lib/matrix/effects/color_effect.rb +1 -1
- data/lib/matrix/matrix.rb +1 -1
- data/lib/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: 00e1c8ea25c77f078076f7997931cc4d68ffbc073dbc6e38820f42744be37df3
|
|
4
|
+
data.tar.gz: fc8a23be880837861fac8f81af34b440e819ae35863048a624655a557b9b83fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aef29d377676a4e661d889ac0a87dd6aceb0310d8b2fffe5537ff120c90259f70e910b29765d2bebb04623c3178710a8c2795c64d0064dd64973b77fa34cecc6
|
|
7
|
+
data.tar.gz: 1221b6cc68e0d6b07abc6f1fb844ac3c84fda5c5f9a58db89400c6c66d6dbc9bdee56ef76f1756aa91998618e8492e3258203fc8c1e30bb1dd91ee6b32300c8e
|
data/lib/cli/static.rb
CHANGED
|
@@ -6,6 +6,7 @@ require 'ruby-progressbar'
|
|
|
6
6
|
|
|
7
7
|
require 'antlers' # Adds antlers support to dirload.
|
|
8
8
|
require 'dirload'
|
|
9
|
+
require 'lowdata' # Data classes can be loaded without a database.
|
|
9
10
|
|
|
10
11
|
require_relative '../pages/pages'
|
|
11
12
|
|
|
@@ -35,6 +36,7 @@ module Rain
|
|
|
35
36
|
folder_path = File.join(build_path, request_result.path)
|
|
36
37
|
|
|
37
38
|
puts "#{folder_path} => #{request_result.status}"
|
|
39
|
+
next unless request_result.html
|
|
38
40
|
|
|
39
41
|
FileUtils.mkdir_p(folder_path)
|
|
40
42
|
File.write(File.expand_path('index.html', folder_path), request_result.html)
|
|
@@ -80,12 +82,22 @@ module Rain
|
|
|
80
82
|
paths.map do |path|
|
|
81
83
|
request = Protocol::HTTP::Request.new('http', nil, 'GET', path)
|
|
82
84
|
response = Low::Events::RequestEvent.take(request:).response
|
|
83
|
-
|
|
85
|
+
RequestResult.new(path:, status: response.status, html: response.read)
|
|
86
|
+
rescue Observers::ObserverError => e
|
|
87
|
+
raise unless database_error?(e)
|
|
88
|
+
|
|
89
|
+
# Static sites don't have a database so paths that need one are skipped.
|
|
90
|
+
RequestResult.new(path:, status: 'Skipped', html: nil)
|
|
91
|
+
ensure
|
|
84
92
|
progress_bar.increment
|
|
85
|
-
result
|
|
86
93
|
end
|
|
87
94
|
end
|
|
88
95
|
|
|
96
|
+
def database_error?(error)
|
|
97
|
+
error = error.cause until error.nil? || error.is_a?(LowData::ConfigError)
|
|
98
|
+
error&.message == LowData::ConfigError::MISSING_DATABASE
|
|
99
|
+
end
|
|
100
|
+
|
|
89
101
|
def request_paths(metadata:)
|
|
90
102
|
file_paths = metadata.file_types.values_at('md', 'rd', 'markdown', 'raindown').flat_map { it }.compact
|
|
91
103
|
paths = file_paths.map { |file_path| Rain::Pages.url_path(file_path:) }.compact
|
|
@@ -7,7 +7,7 @@ module Rain
|
|
|
7
7
|
def render(output:, next_output:, **)
|
|
8
8
|
color = next_output ? @config.cell_color : @config.lead_color
|
|
9
9
|
|
|
10
|
-
return Paint[output, '#006ab0'] if @config.leet_keys.invert.key?(output)
|
|
10
|
+
return Paint[output, '#006ab0'] if @config.leet && @config.leet_keys.invert.key?(output)
|
|
11
11
|
|
|
12
12
|
output ? Paint[output, color] : Paint[' ']
|
|
13
13
|
end
|
data/lib/matrix/matrix.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Rain
|
|
|
18
18
|
def initialize(event_pool:, config: ConfigLoader.load('matrix.yaml'))
|
|
19
19
|
@event_pool = event_pool
|
|
20
20
|
@config = config
|
|
21
|
-
@effects = [LeetEffect.new(config:), ColorEffect.new(config:)]
|
|
21
|
+
@effects = [(LeetEffect.new(config:) if config.leet), ColorEffect.new(config:)].compact
|
|
22
22
|
|
|
23
23
|
@screen_size = nil
|
|
24
24
|
|
data/lib/version.rb
CHANGED