datagnan 1.2.1 → 1.2.2

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/datagnan.rb +13 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f088e30bfb4123a90aeb0a53ccdc911ee805c572
4
- data.tar.gz: 6ed257beac94a08f8dc9e485a32086188384234c
3
+ metadata.gz: 590427709ec6e2a71b590660084a9b809b8c002b
4
+ data.tar.gz: 3e66b7f3db3eb0c9c8f1a9e3b89059a7fde861f5
5
5
  SHA512:
6
- metadata.gz: 1131dcf4d53e201502c926da2881870f87cabc5e6777643dd4342605a2fb641c284248da42db7928c1198f1d7f73f99092958ce19616f318456b7797d7d5c482
7
- data.tar.gz: 6b3fa249e0972186eae0f50c1bff35ba2bc5c34d235d19c6ca5d135cab2b8b7521858560ed8c3742257bbd71a4bd7201734af36977d476d0632283afd95b420c
6
+ metadata.gz: dc4abe7040d7fa13bd64027561a5d461ab79366e4f223be74fa563e198b5dec58e6e3a343076a9ddefb604da76559ef88372a5250513755d7eef08d7ae2824d0
7
+ data.tar.gz: 235bc5f87768487a9cd4fa9a0f820d03f2703e0aab08c2f2d4c18510357d2e1f154572f4b373b1d7a4aed6890f666b23f0d689ba0f46ad73adadf6e27d4e49fc
@@ -357,7 +357,7 @@ end
357
357
  # options for parsing and filling the template
358
358
  # @param [Hash] locals
359
359
  # local variables for filling the template
360
- def datagnan(template_file, options = {}, local_vars = {})
360
+ def datagnan(template_files, options = {}, local_vars = {})
361
361
  # beginning_time = Time.now
362
362
  ## default options
363
363
  options[:scope] ||= self
@@ -365,14 +365,19 @@ def datagnan(template_file, options = {}, local_vars = {})
365
365
  options[:layout_file] = File.join(options[:views_dir], options[:layout_file] || 'layout.html')
366
366
  (options[:local_vars] ||= {}).merge! local_vars
367
367
 
368
- ## prepare template filename
369
- template_file = File.join(options[:views_dir], template_file.to_s)
370
- template_file += '.html' unless File.exist? template_file
368
+ html = ""
369
+ template_files = [template_files] unless template_files.is_a? Array
370
+ template_files.each do |template_file|
371
+ ## prepare template filename
372
+ template_file = File.join(options[:views_dir], template_file.to_s)
373
+ template_file += '.html' unless File.exist? template_file
374
+
375
+ ## render template
376
+ html += Datagnan.read(template_file, options)
377
+ ## debug
378
+ # puts "-- datagnan ( template = #{html} )"
379
+ end
371
380
 
372
- ## render template
373
- html = Datagnan.read(template_file, options)
374
- ## debug
375
- # puts "-- datagnan ( template = #{html} )"
376
381
  ## check for layout and wrap template if exist
377
382
  if File.exist? options[:layout_file]
378
383
  options[:local_vars]['template'] = { 'html' => html }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datagnan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov