zerofetcher 0.0.20 → 0.0.21

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 +35 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f17794f83fd23f8671ffa1a71978e5bdf3a23ce
4
- data.tar.gz: 987fc479ffe22a4648c204acd0664cc6791043f4
3
+ metadata.gz: 34456d525ebdb695c9105fb7f14a5a17abed0e84
4
+ data.tar.gz: ec115483c661a8aa345b8eaf14bc06e221f3f537
5
5
  SHA512:
6
- metadata.gz: 0edcaf8cf50b49f68b3e14f7a3795841f746537327598cf44cb0cac859a599692945b0b25b5e02698f0dbcb1f0ce5a362015bfef42798816ac9ff50ee71bfeb7
7
- data.tar.gz: 8567ed7b38cbdbe912db905f7a5d522ec00467c858369f394a7bb982db68b4357b1fbf37358a016abcda4f592427e6bc1afbef186b2f0b9c518318d5fd9a540e
6
+ metadata.gz: 73a7d87f3221db262f6706108accbc3aac419a6821a6414f8ba6225c27f77b8c39f75df13a6226151ad30aaff144b121096712cbba1c7beb6b4adde1a3bac9c9
7
+ data.tar.gz: 185ef9e47fc2b5c018591bc658f3eaaa41f308aadeb4caeb99e432e78acffa9b877d752d530bb03178ae0b65148d56650e231af2021266d14311f0b0f7176339
data/lib/zerofetcher.rb CHANGED
@@ -359,7 +359,42 @@ class ZeroFetcher
359
359
  end
360
360
  end
361
361
  end
362
+
363
+ #hasmany data
364
+ if row.key?("hasmany_data")
365
+ row['hasmany_data'].each do |hasmany_type,hasmany_data|
366
+ puts " - hasmany : " + hasmany_type + " - " + hasmany_data['data'].length.to_s
367
+ hasmany_data['fields'].each do |fld_key,fld_info|
368
+ hasmany_data['data'].each do |hsrow|
369
+ hsrow.each do |key,val|
370
+ if fld_key == key
371
+ case fld_info['type']
372
+ when 'image'
373
+ # Directory Check
374
+ image_path = jekyll_path+'/assets/images/'+collection_type+'/'+hasmany_type+'/'+row['id']
375
+ FileUtils::mkdir_p image_path
376
+
377
+ src_image = end_point + '/media/images/'+collection_type+'/'+site_id+'/'+row['id']+'/' + val
378
+
379
+ self.getAndSaveFile(src_image, image_path+'/' + val)
380
+ when 'file'
381
+ # Directory Check
382
+ file_path = jekyll_path+'/assets/files/'+collection_type+'/'+hasmany_type+'/'+row['id']
383
+ FileUtils::mkdir_p file_path
384
+
385
+ src_file = end_point + '/media/files/'+collection_type+'/'+site_id+'/'+row['id']+'/' + val
386
+
387
+ self.getAndSaveFile(src_file, file_path+'/' + val)
388
+ end
389
+ end
390
+ end
391
+ end
392
+ end
393
+ end # has many data each
394
+ end
395
+
362
396
  end
397
+
363
398
  end
364
399
 
365
400
  # Add Collections to _config.tml
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.20
4
+ version: 0.0.21
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-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fetches content from zero
14
14
  email: brian@d3corp.com