obf 0.9.8.4 → 0.9.8.5
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/obf/external.rb +1 -0
- data/lib/obf/pdf.rb +11 -6
- data/lib/obf/validator.rb +6 -0
- 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: be39949f2f5c4c6af4bb7fd943ac2950234bee6ea9a524becabbaa4b77ec3239
|
4
|
+
data.tar.gz: 8a3fc7c6b9b52bd116a1e2f141180544c3a1ccd487477c06fb6cc25eb830e288
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9659266746cbca8d2d9cf09675def278e6a62d2b81532e92b8f7bad6b038a99b15b2c3936495938332bf4335d9190294fa57e42e8bc8e4942255d51e802768
|
7
|
+
data.tar.gz: '081f80f5b327cf2c32e03941d35d0d8c6e93a14442ed874245852052eaeba3dc537a5350def0b36942b235433fd16c674f32ea48711f13c1f6fe90f0f63091c5'
|
data/lib/obf/external.rb
CHANGED
@@ -14,6 +14,7 @@ module OBF::External
|
|
14
14
|
res['format'] = OBF::OBF::FORMAT
|
15
15
|
res['name'] = hash['name']
|
16
16
|
res['default_layout'] = hash['default_layout'] || 'landscape'
|
17
|
+
res['background'] = hash['background']
|
17
18
|
res['url'] = hash['url']
|
18
19
|
res['data_url'] = hash['data_url']
|
19
20
|
|
data/lib/obf/pdf.rb
CHANGED
@@ -43,6 +43,7 @@ module OBF::PDF
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
pdf = Prawn::Document.new(doc_opts)
|
46
|
+
# remember: https://www.alphabet-type.com/tools/charset-checker/
|
46
47
|
pdf.font_families['THFahKwangBold'] = {
|
47
48
|
normal: {font: 'THFahKwangBold', file: File.expand_path('../../THFahKwangBold.ttf', __FILE__)}
|
48
49
|
}
|
@@ -62,10 +63,12 @@ module OBF::PDF
|
|
62
63
|
if obj['boards']
|
63
64
|
multi_render = obj['boards'].length > 20
|
64
65
|
obj['boards'].each_with_index do |board, idx|
|
66
|
+
started = Time.now.to_i
|
67
|
+
puts "starting pdf of board #{idx} #{board['name'] || board['id']} at #{started}"
|
65
68
|
pre = idx.to_f / obj['boards'].length.to_f
|
66
69
|
post = (idx + 1).to_f / obj['boards'].length.to_f
|
67
70
|
OBF::Utils.as_progress_percent(pre, post) do
|
68
|
-
# if more than
|
71
|
+
# if more than 20 pages, build each page individually
|
69
72
|
# and combine them afterwards
|
70
73
|
if multi_render
|
71
74
|
path = OBF::Utils.temp_path("stash-#{idx}.pdf")
|
@@ -98,6 +101,7 @@ module OBF::PDF
|
|
98
101
|
})
|
99
102
|
end
|
100
103
|
end
|
104
|
+
puts " finished pdf of board #{idx}/#{obj['boards'].length} #{Time.now.to_i - started}s"
|
101
105
|
end
|
102
106
|
else
|
103
107
|
build_page(pdf, obj, {
|
@@ -340,11 +344,12 @@ module OBF::PDF
|
|
340
344
|
end
|
341
345
|
end
|
342
346
|
|
347
|
+
|
343
348
|
# pdf = Prawn::Document.new
|
344
|
-
# pdf.font "
|
345
|
-
# pdf.font_families.update({'MiedingerBook
|
346
|
-
# normal: "
|
349
|
+
# pdf.font "lib/TimesNewRoman.ttf"
|
350
|
+
# pdf.font_families.update({'MiedingerBook' => {
|
351
|
+
# normal: "lib/MiedingerBook.ttf" # https://fontlibrary.org/en/font/miedinger
|
347
352
|
# }})
|
348
|
-
# pdf.fallback_fonts = ['MiedingerBook
|
353
|
+
# pdf.fallback_fonts = ['MiedingerBook']
|
349
354
|
# pdf.text_box "भन्नुहोस्"
|
350
|
-
# pdf.render_file("/
|
355
|
+
# pdf.render_file("out/prawn.pdf")
|
data/lib/obf/validator.rb
CHANGED
@@ -349,6 +349,12 @@ module OBF
|
|
349
349
|
warn "description_html attribute is recommended"
|
350
350
|
end
|
351
351
|
end
|
352
|
+
|
353
|
+
add_check('background', "background attribute") do
|
354
|
+
if ext['background'] && !ext['background'].is_a?(Hash)
|
355
|
+
err "background attributee must be a hash"
|
356
|
+
end
|
357
|
+
end
|
352
358
|
|
353
359
|
add_check('buttons', "buttons attribute") do
|
354
360
|
if !ext['buttons']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.8.
|
4
|
+
version: 0.9.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Whitmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|