Skip to content

Commit

Permalink
Squashed 'hpxml-measures/' changes from 896a53ea5..4e35921a1
Browse files Browse the repository at this point in the history
4e35921a1 Fix base-multiple-buildings.xml to be valid.

git-subtree-dir: hpxml-measures
git-subtree-split: 4e35921a14dbe97e535671825016a69715bfd3c2
  • Loading branch information
shorowit committed May 13, 2021
1 parent 3e0ac17 commit 0e8508b
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 348 deletions.
12 changes: 1 addition & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ GEM
ansi (1.5.0)
ast (2.4.2)
builder (3.2.4)
ci_reporter (2.0.0)
builder (>= 2.1.2)
ci_reporter_minitest (1.0.0)
ci_reporter (~> 2.0)
minitest (~> 5.0)
codecov (0.2.12)
json
simplecov
docile (1.3.5)
json (2.5.1)
mini_portile2 (2.5.0)
minitest (5.14.4)
minitest-reporters (1.4.3)
Expand Down Expand Up @@ -50,8 +41,6 @@ PLATFORMS
x64-mingw32

DEPENDENCIES
ci_reporter_minitest (~> 1.0.0)
codecov (= 0.2.12)
minitest (~> 5.9)
minitest-reporters
nokogiri (~> 1.10)
Expand All @@ -60,6 +49,7 @@ DEPENDENCIES
rake
schematron-nokogiri
simplecov
simplecov-html

BUNDLED WITH
2.2.11
12 changes: 11 additions & 1 deletion tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,17 @@ def create_hpxmls
building_element = XMLHelper.get_element(hpxml_element, 'Building')
for i in 2..3
new_building_element = Marshal.load(Marshal.dump(building_element))
XMLHelper.add_attribute(XMLHelper.get_element(new_building_element, 'BuildingID'), 'id', "MyBuilding#{i}")

# Make all IDs unique so the HPXML is valid
new_building_element.each_node do |node|
next unless node.is_a?(Oga::XML::Element)

id = XMLHelper.get_attribute_value(node, 'id')
next if id.nil?

XMLHelper.add_attribute(node, 'id', "#{id}_#{i}")
end

hpxml_element.children << new_building_element
end
XMLHelper.write_file(hpxml_doc, hpxml_path)
Expand Down
Loading

0 comments on commit 0e8508b

Please sign in to comment.