Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

necb ECMS hvac_systems.rb is incompatible with pre 2.6 versions of ruby #1295

Closed
mdahlhausen opened this issue Mar 30, 2022 · 0 comments
Closed

Comments

@mdahlhausen
Copy link
Collaborator

Steps to reproduce:

Run interactive run in the local openstudio-standards directory using a ruby version before 2.6 and require the file:

C:\Users\mdahlhau\Documents\GitHub\NREL\openstudio-standards>irb
irb(main):001:0> RUBY_VERSION
=> "2.5.5"
irb(main):002:0> require_relative 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb'

The issue occurs in these two lines of code:
https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb#L485
https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb#L1199

These lines implement an endless range [5..] which is a newer syntax introduced in Ruby 2.6.

The application here is just a simple slicing, which can be fixed by using [5..-1] instead of [5..].

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant