obf 0.9.8.35 → 0.9.8.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/external.rb +29 -0
  3. data/lib/obf/pdf.rb +5 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3274b731d612ffd8a4ce7b39c4f5c24693c15d62ef2e22126df98ce428e8d0ae
4
- data.tar.gz: e7956b737623c1f5b8471c2fc3465478aebb6dd60b157bae69c7ffa9935da140
3
+ metadata.gz: 643f357ab48bdd49d04a5769707fec92e9b6c924ba551cbbcf65ba136b945e40
4
+ data.tar.gz: d98c4a91aa881bdeee22e1563b3aafb7c036050b2b4a83379ff47fdea5b56687
5
5
  SHA512:
6
- metadata.gz: fc988d4f31a72cf4e64db2256e6610dfbfbf397937f65822689cb89751a80475de8ff4e93cface38edab88821f077a79c5f9352de5c7a233f6d5e4e65a62bd59
7
- data.tar.gz: d93c9e458967e25de8b6d79feeffac73cef7f4ef674f57b15432aa3f66312017aa932c921c2afeb770f352557f382ef16409b6f871d2feae021232ada4d650bd
6
+ metadata.gz: 9f86ae672f6c60077c5927271dfc2eb1fc020bd39eac7b0f2dc2f638f47608df541ead763c8e8a68d34cf7de5e130190f767f4a0e900edd90051a0f45d8d2364
7
+ data.tar.gz: 735e978e4a00b66f0f032d570936d86eed0741ed44dc04b7a0716e86070ab728f6b811f8abf6726d850caba9d21cb919b1ff16cc618a6f5f7d3d90472d216b13
@@ -116,6 +116,8 @@ module OBF::External
116
116
  OBF::Utils.update_current_progress(idx.to_f / button_count.to_f)
117
117
  end
118
118
 
119
+ # board_id 1_527892 has some svg's still, not pre-rasterized versions
120
+ # 1_531854 convert-im6.q16: non-conforming drawing primitive definition `Helvetica''' @ error/draw.c/DrawImage/3265.
119
121
  if to_include[:images]
120
122
  hydra = OBF::Utils.hydra
121
123
  grabs = []
@@ -129,6 +131,7 @@ module OBF::External
129
131
  end
130
132
  end
131
133
  end
134
+ OBF::Utils.log(" batch-retrieving #{grabs.length} images for board #{res['name'] || res['id']}")
132
135
  hydra.run
133
136
 
134
137
  grabs.each do |grab|
@@ -192,6 +195,20 @@ module OBF::External
192
195
  end
193
196
  res['images'] << trim_empties(image)
194
197
  end
198
+ elsif to_include[:image_urls]
199
+ images.each do |original_image|
200
+ image = {
201
+ 'id' => original_image['id'],
202
+ 'width' => original_image['width'],
203
+ 'height' => original_image['height'],
204
+ 'license' => OBF::Utils.parse_license(original_image['license']),
205
+ 'url' => original_image['url'],
206
+ 'data_url' => original_image['data_url'],
207
+ 'content_type' => original_image['content_type']
208
+ }
209
+ res['images'] << trim_empties(image)
210
+ end
211
+
195
212
  end
196
213
 
197
214
  if to_include[:sounds]
@@ -225,6 +242,18 @@ module OBF::External
225
242
  sound['path'] = zip_path
226
243
  end
227
244
 
245
+ res['sounds'] << trim_empties(sound)
246
+ end
247
+ elsif to_include[:sound_urls]
248
+ sounds.each do |original_sound|
249
+ sound = {
250
+ 'id' => original_sound['id'],
251
+ 'duration' => original_sound['duration'],
252
+ 'license' => OBF::Utils.parse_license(original_sound['license']),
253
+ 'url' => original_sound['url'],
254
+ 'data_url' => original_sound['data_url'],
255
+ 'content_type' => original_sound['content_type']
256
+ }
228
257
  res['sounds'] << trim_empties(sound)
229
258
  end
230
259
  end
@@ -181,9 +181,11 @@ module OBF::PDF
181
181
  text_options = {:text => "Go Back"}
182
182
  text_options[:anchor] = "page1" if options['links']
183
183
  pdf.formatted_text_box [text_options], :at => [x + 10, header_height], :width => 80, :height => 80, :align => :center, :valign => :bottom, :overflow => :shrink_to_fit
184
- backlinks = (options['backlinks'] || []).join(',')
185
- pdf.fill_color "ffffff"
186
- pdf.formatted_text_box [{:text => backlinks}], :at => [x + 20, header_height + 5 - 25], :width => 70, :height => 30, :align => :center, :valign => :center, :overflow => :shrink_to_fit
184
+ if options['backlinks'].length <= 3
185
+ backlinks = (options['backlinks'] || []).join(',')
186
+ pdf.fill_color "ffffff"
187
+ pdf.formatted_text_box [{:text => backlinks}], :at => [x + 20, header_height + 5 - 25], :width => 70, :height => 30, :align => :center, :valign => :center, :overflow => :shrink_to_fit
188
+ end
187
189
  end
188
190
  end
189
191
 
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.35
4
+ version: 0.9.8.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2020-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json