zerofetcher 0.0.27 → 0.0.28
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/zerofetcher.rb +28 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 488d65417957257c3b96e40683d5f45e070cedde
|
4
|
+
data.tar.gz: f62345d8a31bf0abc81dd26ff507bea7b97b6491
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a2a7074bf61074ffb572303ac616c385eec21073a936b1fa95625bc534b0d60f4e33037478bc9dd34f6b6d42cdaa5765866f6f4967e39e94be6a897fb51980d
|
7
|
+
data.tar.gz: 7591740ffca8410dfd5e4d80a5d87c283e36c285d62aa00d28edbc66225d2b847ec1fdbc6bae33d968f5a7f26e678ae115ccba8f1cc156806a5683cb4f4afc60
|
data/lib/zerofetcher.rb
CHANGED
@@ -305,6 +305,13 @@ class ZeroFetcher
|
|
305
305
|
# Make Dir
|
306
306
|
FileUtils::mkdir_p jekyll_path+'/assets/images/properties'
|
307
307
|
|
308
|
+
# Directory Check
|
309
|
+
option_file_path = jekyll_path+'/assets/files/property_files'
|
310
|
+
FileUtils::mkdir_p option_file_path
|
311
|
+
|
312
|
+
option_image_path = jekyll_path+'/assets/images/property_images'
|
313
|
+
FileUtils::mkdir_p option_image_path
|
314
|
+
|
308
315
|
# Save Collection Info
|
309
316
|
collection_config[ 'properties' ] = {'output' => true}
|
310
317
|
|
@@ -316,7 +323,7 @@ class ZeroFetcher
|
|
316
323
|
files_saved = Array.new
|
317
324
|
|
318
325
|
# Save Individual Collection Files
|
319
|
-
data['properties'].each_with_index do |row,pidx|
|
326
|
+
data['properties']['data'].each_with_index do |row,pidx|
|
320
327
|
row_data = row.clone;
|
321
328
|
row_data.delete('id')
|
322
329
|
id_key = 'property_id'
|
@@ -334,7 +341,24 @@ class ZeroFetcher
|
|
334
341
|
|
335
342
|
src_image = end_point + '/media/images/properties/'+row['id']+'/' + image['image']
|
336
343
|
|
337
|
-
data['properties'][pidx]['images'][idx]['image'] = self.getAndSaveImages(src_image, image_path+'/' + image['image'])
|
344
|
+
data['properties']['data'][pidx]['images'][idx]['image'] = self.getAndSaveImages(src_image, image_path+'/' + image['image'])
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
# image/file option fields
|
349
|
+
data['properties']['options'].each do |option|
|
350
|
+
if row[ option['key'] ]
|
351
|
+
case option['key']
|
352
|
+
when 'file'
|
353
|
+
src_file = end_point + '/media/files/property_files/'+site_id+'/' + row[ option['key'] ]
|
354
|
+
|
355
|
+
self.getAndSaveFile(src_file, option_file_path+'/' + row[ option['key'] ])
|
356
|
+
when 'image'
|
357
|
+
src_image = end_point + '/media/images/property_images/' + site_id + '/' + row[ option['key'] ]
|
358
|
+
|
359
|
+
|
360
|
+
data['properties']['data'][pidx][ option['key'] ] = self.getAndSaveImages(src_image, option_image_path+'/' + row[ option['key'] ])
|
361
|
+
end
|
338
362
|
end
|
339
363
|
end
|
340
364
|
|
@@ -347,7 +371,8 @@ class ZeroFetcher
|
|
347
371
|
end
|
348
372
|
|
349
373
|
# Save Json Data
|
350
|
-
File.write(jekyll_path+'/_data/properties.json', JSON.pretty_generate(data['properties']))
|
374
|
+
File.write(jekyll_path+'/_data/properties.json', JSON.pretty_generate(data['properties']['data']))
|
375
|
+
File.write(jekyll_path+'/_data/properties_options.json', JSON.pretty_generate(data['properties']['options']))
|
351
376
|
|
352
377
|
# Clean up unused collection files
|
353
378
|
self.cleanUpFolder(collection_path, files_saved)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zerofetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Liccardo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fetches content from zero
|
14
14
|
email: brian@d3corp.com
|