Class: OpenStudio::Extension::Extension
- Inherits:
-
Object
- Object
- OpenStudio::Extension::Extension
- Defined in:
- lib/openstudio/extension.rb
Instance Attribute Summary collapse
-
#root_dir ⇒ Object
Returns the value of attribute root_dir.
Instance Method Summary collapse
-
#core_dir ⇒ Object
Do not override Files in the core directory are copied into measure resource folders to build standalone measures Files will be copied into the resources folder of measures which have files of the same name Return the absolute path of the core dir or nil if there is none.
-
#doc_templates_dir ⇒ Object
Doc templates are common files like copyright files which are used to update measures and other code Doc templates will only be applied to measures in the current repository Return the absolute path of the doc templates dir or nil if there is none.
-
#files_dir ⇒ Object
Relevant files such as weather data, design days, etc.
-
#initialize(root_dir = nil) ⇒ Extension
constructor
Typically one does not pass in the root path and it is defaulted as the root path of the project that is inheriting the extension.
-
#measures_dir ⇒ Object
Return the absolute path of the measures or nil if there is none, used when configuring OSWs.
Constructor Details
#initialize(root_dir = nil) ⇒ Extension
Typically one does not pass in the root path and it is defaulted as the root path of the project that is inheriting the extension. The root path can be overriden as needed on initialization only. This is mainly used for testing purposes.
49 50 51 |
# File 'lib/openstudio/extension.rb', line 49 def initialize(root_dir = nil) @root_dir = root_dir || File.absolute_path(File.join(File.dirname(__FILE__), '..', '..')) end |
Instance Attribute Details
#root_dir ⇒ Object
Returns the value of attribute root_dir.
43 44 45 |
# File 'lib/openstudio/extension.rb', line 43 def root_dir @root_dir end |
Instance Method Details
#core_dir ⇒ Object
Do not override Files in the core directory are copied into measure resource folders to build standalone measures Files will be copied into the resources folder of measures which have files of the same name Return the absolute path of the core dir or nil if there is none
75 76 77 |
# File 'lib/openstudio/extension.rb', line 75 def core_dir return File.absolute_path(File.join(@root_dir, 'lib', 'openstudio', 'extension', 'core')) end |
#doc_templates_dir ⇒ Object
Doc templates are common files like copyright files which are used to update measures and other code Doc templates will only be applied to measures in the current repository Return the absolute path of the doc templates dir or nil if there is none
67 68 69 |
# File 'lib/openstudio/extension.rb', line 67 def doc_templates_dir return File.absolute_path(File.join(@root_dir, 'doc_templates')) end |
#files_dir ⇒ Object
Relevant files such as weather data, design days, etc. Return the absolute path of the files or nil if there is none, used when configuring OSWs
60 61 62 |
# File 'lib/openstudio/extension.rb', line 60 def files_dir return File.absolute_path(File.join(@root_dir, 'lib', 'files')) end |
#measures_dir ⇒ Object
Return the absolute path of the measures or nil if there is none, used when configuring OSWs
54 55 56 |
# File 'lib/openstudio/extension.rb', line 54 def measures_dir return File.absolute_path(File.join(@root_dir, 'lib', 'measures')) end |