lib/ykxutils/nginxconfig.rb in ykxutils-0.1.8 vs lib/ykxutils/nginxconfig.rb in ykxutils-0.1.11
- old
+ new
@@ -16,25 +16,25 @@
end
def extract(scope)
hashx = {}
@hash.each do |k, v|
- if k !~ /^_/
- # puts k
- # puts v
- pn = Pathname.new(v["template"]).cleanpath
- # Pathname.new(v).cleanpath
- template_pn = @server_dir_pn + pn
- # puts(template_pn)
- value_file_path_array = v["value"].map { |x|
- @virtual_domain_dir_pn + Pathname.new(x).cleanpath
- }
- hashx[k] = Ykxutils::Erubyx::erubi_render_with_file(template_pn, scope, value_file_path_array)
+ next unless k !~ /^_/
+
+ # puts k
+ # puts v
+ pn = Pathname.new(v["template"]).cleanpath
+ # Pathname.new(v).cleanpath
+ template_pn = @server_dir_pn + pn
+ # puts(template_pn)
+ value_file_path_array = v["value"].map do |x|
+ @virtual_domain_dir_pn + Pathname.new(x).cleanpath
end
+ hashx[k] = Ykxutils::Erubyx.erubi_render_with_file(template_pn, scope, value_file_path_array)
end
template = File.read(@root_template_pn)
template_hash = { TEMPLATE: template,
OBJ: nil }
- Ykxutils::Erubyx::erubi_render(template_hash, scope, hashx)
+ Ykxutils::Erubyx.erubi_render(template_hash, scope, hashx)
end
end
end