epb_view_models 2.0.1 → 2.0.3

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.
@@ -5,7 +5,7 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "2.0.1"
8
+ VERSION = "2.0.3"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -103,7 +103,7 @@ module Helper
103
103
  refrigerant_name:
104
104
  xpath(%w[ACI-Cooling-Plant-Refrigeration/Refrigerant-Name], node),
105
105
  f_gas_inspection:
106
- checklist_values(node.at("ACI-Cooling-Plant-Refrigeration"))[
106
+ checklist_values_with_guidance(node.at("ACI-Cooling-Plant-Refrigeration"))[
107
107
  :f_gas_inspection
108
108
  ],
109
109
  pre_compressor:
@@ -32,7 +32,7 @@ module Presenter
32
32
  xml = ERB.new(get_template).result_with_hash dec_data
33
33
 
34
34
  if !@view_model.respond_to?(:dec_status) || @view_model.dec_status.nil?
35
- doc = Nokogiri.XML(xml)
35
+ doc = Nokogiri.XML(xml) { |config| config.huge.strict }
36
36
  doc.at("DEC-Status").remove
37
37
  xml = doc.to_xml
38
38
  end
@@ -22,7 +22,7 @@ module Presenter
22
22
  preferred_keys: @preferred_keys,
23
23
  list_nodes: @list_nodes,
24
24
  rootless_list_nodes: @rootless_list_nodes
25
- @sax_parser ||= Nokogiri::XML::SAX::Parser.new @assessment_document
25
+ @sax_parser ||= Nokogiri::XML::SAX::Parser.new(@assessment_document) { |config| config.huge.strict }
26
26
  end
27
27
 
28
28
  private
@@ -40,7 +40,7 @@ module Presenter
40
40
  @preferred_keys = preferred_keys
41
41
  @list_nodes = list_nodes
42
42
  @rootless_list_nodes = rootless_list_nodes
43
- super()
43
+ super() { |config| config.huge.strict }
44
44
  end
45
45
 
46
46
  def start_document
data/lib/presenter/xsd.rb CHANGED
@@ -54,7 +54,7 @@ module Presenter
54
54
  end
55
55
 
56
56
  def read_xml(file_name, node_name, node_hash)
57
- doc = Nokogiri.XML(File.read(file_name))
57
+ doc = Nokogiri.XML(File.read(file_name)) { |config| config.huge.strict }
58
58
  enums_hash = {}
59
59
 
60
60
  doc.xpath(node_name).each do |node|
@@ -12,7 +12,7 @@ module ViewModel
12
12
  schema_type = schema_type.to_sym
13
13
 
14
14
  # FIXME: For some reasons the XML is received as a string and not a Nokogiri Document (like other wrappers)
15
- xml_doc = Nokogiri.XML(xml).remove_namespaces!
15
+ xml_doc = Nokogiri.XML(xml, nil, nil, Nokogiri::XML::ParseOptions.new.huge.strict).remove_namespaces!
16
16
  @view_model = build_view_model(xml_doc, schema_type)
17
17
  @xml_summary = Presenter::Dec::XmlSummary.new(view_model)
18
18
  end
@@ -65,7 +65,7 @@ module ViewModel
65
65
  # Hack to use symbols, we need to update all callers to use symbols instead
66
66
  schema_type = schema_type.to_sym
67
67
 
68
- xml_doc = Nokogiri.XML(xml).remove_namespaces!
68
+ xml_doc = Nokogiri.XML(xml, nil, nil, Nokogiri::XML::ParseOptions.new.huge.strict).remove_namespaces!
69
69
 
70
70
  if TYPES_OF_CEPC.include?(schema_type)
71
71
  filtered_results =
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - DLUHC Energy Performance of Buildings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri