obf 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/external.rb +26 -0
- data/lib/obf/pdf.rb +1 -1
- 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: 88ee044dff3f0e9119c892b13270faeffd5f65bc942b1c5caf00eca770420c47
|
4
|
+
data.tar.gz: a0316557377848c9f84fe4762796d68bf3382e901629125c0063a4733673e2bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5ce21f914571fe536550fba8d589f6c8a460f0ae28bf013e98a9e6a26ab9f0ae88a6dbc29a0078edfad4927777616c61318201cdda243f4412c383fb6d34964
|
7
|
+
data.tar.gz: 84154874977a12f7bab9e994493d8ab9381d3d309b4a94dc36738cb0a866be41b01fff5a2f1b8599dc8e6bb171fcef6da6b861c879a34d83ab81885697bd822c
|
data/lib/obf/external.rb
CHANGED
@@ -16,6 +16,11 @@ module OBF::External
|
|
16
16
|
res['default_layout'] = hash['default_layout'] || 'landscape'
|
17
17
|
res['url'] = hash['url']
|
18
18
|
res['data_url'] = hash['data_url']
|
19
|
+
|
20
|
+
res['default_locale'] = hash['default_locale'] if hash['default_locale']
|
21
|
+
res['label_locale'] = hash['label_locale'] if hash['label_locale']
|
22
|
+
res['vocalization_locale'] = hash['vocalization_locale'] if hash['vocalization_locale']
|
23
|
+
|
19
24
|
res['description_html'] = hash['description_html']
|
20
25
|
res['protected_content_user_identifier'] = hash['protected_content_user_identifier'] if hash['protected_content_user_identifier']
|
21
26
|
res['license'] = OBF::Utils.parse_license(hash['license'])
|
@@ -57,6 +62,27 @@ module OBF::External
|
|
57
62
|
button['load_board']['path'] = "board_#{original_button['load_board']['id']}.obf"
|
58
63
|
end
|
59
64
|
end
|
65
|
+
if original_button['translations']
|
66
|
+
original_button['translations'].each do |loc, hash|
|
67
|
+
next unless hash.is_a?(Hash)
|
68
|
+
button['translations'] ||= {}
|
69
|
+
button['translations'][loc] ||= {}
|
70
|
+
button['translations'][loc]['label'] = hash['label'].to_s if hash['label']
|
71
|
+
button['translations'][loc]['vocalization'] = hash['vocalization'].to_s if hash['vocalization']
|
72
|
+
(hash['inflections'] || {}).each do |key, val|
|
73
|
+
if key.match(/^ext_/)
|
74
|
+
button['translations'][loc]['inflections'] ||= {}
|
75
|
+
button['translations'][loc]['inflections'][key] = val
|
76
|
+
else
|
77
|
+
button['translations'][loc]['inflections'] ||= {}
|
78
|
+
button['translations'][loc]['inflections'][key] = val.to_s
|
79
|
+
end
|
80
|
+
end
|
81
|
+
hash.keys.each do |key|
|
82
|
+
button['translations'][loc][key] = hash[key] if key.match(/^ext_/)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
60
86
|
if original_button['hidden']
|
61
87
|
button['hidden'] = original_button['hidden']
|
62
88
|
end
|
data/lib/obf/pdf.rb
CHANGED
@@ -212,7 +212,7 @@ module OBF::PDF
|
|
212
212
|
end
|
213
213
|
image_local_path = image && OBF::Utils.save_image(image, options['zipper'], bg)
|
214
214
|
if image_local_path && File.exist?(image_local_path)
|
215
|
-
pdf.image
|
215
|
+
pdf.image(image_local_path, :fit => [button_width - 10, button_height - text_height - 5], :position => :center, :vposition => :center) rescue nil
|
216
216
|
File.unlink image_local_path
|
217
217
|
end
|
218
218
|
end
|
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.
|
4
|
+
version: 0.9.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-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|