Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question
4

What is a gem? And how does OpenStudio use them?

asked 2016-11-15 19:50:12 -0500

willyJohan gravatar image

updated 2016-11-16 12:13:00 -0500

OK, so this may be obvious to most folks on here but for those of us who who don't I thought I'd ask.

from here it seems like it is just a portable bit of reusable code, is this a sort of correct understanding?

Also, more specifically to OpenStudio:

1) Does it matter if a typical user knows any of this to make use of existing capabilities of OS or the BCL?

2) Do all BCL measures use gems? And, if not, which do and which do not and why?

3) are there any gems (or other parts of the OS ecosystem) that need to be updated outside of the regular updates (again, for your run of the mill OS energy modeller)

4) Are there any OS specific resources for learning about gems and how OS makes use of them?

Feel free to answer the last question first with the expectation that that would eventually help me answer the others.

Thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2016-11-16 09:46:29 -0500

from here it seems like it [a gem] is just a portable bit of reusable code, is this a sort of correct understanding?

  • Yes.

1) Does it matter if a typical user knows any of this to make use of existing capabilities of OS or the BCL?

  • No. Normal users don't need to know anything about gems.

2) Do all BCL measures use gems? And, if not, which do and which do not and why?

  • Only the Create Baseline Building and Create DOE Prototype Building currently use a gem. The reason is that these measures are very complex and share a lot of code. In order to make this code maintainable, we put it into a single library, which in Ruby is called a gem.

3) are there any gems (or other parts of the OS ecosystem) that need to be updated outside of the regular updates (again, for your run of the mill OS energy modeller)

  • No. The gem that these measures use is already installed with OpenStudio, you don't need to do anything besides installing OpenStudio.

4) Are there any OS specific resources for learning about gems and how OS makes use of them?

  • Normal users will never have to know about or use gems. Unless you plan on writing a series of very complicated measures which all share a bunch of code, you can ignore gems.
edit flag offensive delete link more
2

answered 2016-11-16 04:13:16 -0500

TianZhichao gravatar image

updated 2016-11-16 04:13:50 -0500

Gem is a Ruby library based on which build your own software. As OpenStudio use Ruby and C++, OS does use those library such as RubyGem and Qt. If you have any ruby programming experience, you will know how it works. Just search ruby gem on google, and you will have a basic understanding.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2016-11-15 19:50:12 -0500

Seen: 207 times

Last updated: Nov 16 '16