zerofetcher 0.0.25 → 0.0.26

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zerofetcher.rb +53 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7010c67f279f07b4c3af30e3cbff95c2d4a4ebb
4
- data.tar.gz: 7274aacdc04fba81ad6e03850b267d4f083ca8e8
3
+ metadata.gz: 23d39b15175b5284d8c9250d26f85cb6157d7498
4
+ data.tar.gz: 783a940ccf0730ec116a499b3fa3c950a274863d
5
5
  SHA512:
6
- metadata.gz: d04445049b9785d7258ae709404f00093b5038518d4178afd731942a2ca43fe9c23571dd7939a507e303c57288ac28a847fb8ab06efa42bb29d6a28aac34677a
7
- data.tar.gz: e2cdb551c8f239614c9bb507c5e881c74f9421e4c60d541fcf65a66b093d88f54cdd03cd0d9a063bb0139100e7003cf75ad163961e5660144ba820f55136448a
6
+ metadata.gz: d3b19da414ba00f834e71bf6e16ae7e889c8db6b6d70bb39f48210b314c365bbb20df08778dac0849221bf18821baa84db3f5859e08ebff21ca5982a7a3ed913
7
+ data.tar.gz: 07cec3f503302e5654d6e2c9eb15eddc66ab164baebf71ba04700a23e422dc8bb07d1fab211d8e0c700779ad190414ac18ae74f3b83a3e3e4ef6fcde8afc8416
data/lib/zerofetcher.rb CHANGED
@@ -300,6 +300,59 @@ class ZeroFetcher
300
300
  end
301
301
  end
302
302
 
303
+ # Properties
304
+ if data.key?("properties")
305
+ # Save Json Data
306
+ File.write(jekyll_path+'/_data/properties.json', JSON.pretty_generate(data['properties']))
307
+
308
+ # Make Dir
309
+ FileUtils::mkdir_p jekyll_path+'/assets/images/properties'
310
+
311
+ # Save Collection Info
312
+ collection_config[ 'properties' ] = {'output' => true}
313
+
314
+ # Directory Check
315
+ collection_path = jekyll_path+'/_properties'
316
+ FileUtils::mkdir_p collection_path
317
+
318
+ # Create files saved array
319
+ files_saved = Array.new
320
+
321
+ # Save Individual Collection Files
322
+ data['properties'].each do |row|
323
+ row_data = row.clone;
324
+ row_data.delete('id')
325
+ id_key = 'property_id'
326
+ row_data[ id_key ] = row['id']
327
+
328
+
329
+ # Save Images
330
+ if row.key?("images")
331
+ # Directory Check
332
+ image_path = jekyll_path+'/assets/images/properties/'+row['id']
333
+ FileUtils::mkdir_p image_path
334
+
335
+ # save images
336
+ row['images'].each_with_index do |image,idx|
337
+
338
+ src_image = end_point + '/media/images/properties/'+row['id']+'/' + image['image']
339
+
340
+ row_data['images'][idx]['image'] = self.getAndSaveImages(src_image, image_path+'/' + image['image'])
341
+ end
342
+ end
343
+
344
+ jfile = JekyllFile.new(collection_path, row_data, 'collection')
345
+ jfile.savePageFile
346
+
347
+ files_saved.push( Pathname.new( jfile.getFileName ).basename.to_s )
348
+
349
+ self.log('Saving Property File ' + jfile.getFileName)
350
+ end
351
+
352
+ # Clean up unused collection files
353
+ self.cleanUpFolder(collection_path, files_saved)
354
+ end
355
+
303
356
  # Custom Collections
304
357
  if data.key?("collections")
305
358
  data['collections'].each do |collection_type,collection_data|
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.25
4
+ version: 0.0.26
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-22 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fetches content from zero
14
14
  email: brian@d3corp.com