openstudio-extension 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6e84ea4693147440c182272ddb36fce2fab938bd
4
+ data.tar.gz: 7f9c6fea6520d12cb9179070fcae33e4d28d53e3
5
+ SHA512:
6
+ metadata.gz: e7f60f747c1ada979e624def3ba692a22198ee58438484c37c93d21764d67fb574eed03c2faf4fe8e8052b6fddd64ea8eb68363d332a1fbde60c386186360b31
7
+ data.tar.gz: 3dfc4a2d409665ea67bf6adf4ccfaf9fd819368a2dfe5031d6204a995adbf0953eb8382d096afa93bc7028607dc5918298b216e00d201a6ecc6d6a7dbb0f7cc3
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /.ruby-version
4
+ /Gemfile.lock
5
+ /gems
6
+ /_yardoc/
7
+ /coverage/
8
+ /doc/
9
+ /pkg/
10
+ /spec/reports/
11
+ /tmp/
12
+
13
+ # rspec failure tracking
14
+ .rspec_status
15
+
16
+ # Ignore IDE files
17
+ /.idea
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.2.4
7
+ before_install: gem install bundler -v 1.14
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in openstudio-extension.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # OpenStudio::Extension
2
+
3
+ This gem repository serves as a base for single purpose repositories that host API methods, CLI tools, and OpenStudio measures which leverage those methods and tools. Other repositories (e.g. urbanopt-geojson-gem) will depend on this repository and inherit/mix-in needed functionality. The repository is formatted as a gem to allow for semantic versioning via Bundle. The repository includes methods for testing, documentation, and build tasks.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'openstudio-extension'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install 'openstudio-extension'
21
+
22
+ ## Usage
23
+
24
+ To be filled out later.
25
+
26
+ # Releasing
27
+
28
+ * Update change log
29
+ * Update version in `/lib/openstudio_measure_tester/version.rb`
30
+ * Merge down to master
31
+ * Release via github
32
+ * run `rake release` from master
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ ########################################################################################################################
2
+ # openstudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC. All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5
+ # following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8
+ # disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11
+ # following disclaimer in the documentation and/or other materials provided with the distribution.
12
+ #
13
+ # (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote
14
+ # products derived from this software without specific prior written permission from the respective party.
15
+ #
16
+ # (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative
17
+ # works may not use the "openstudio" trademark, "OS", "os", or any other confusingly similar designation without
18
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR
23
+ # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25
+ # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ ########################################################################################################################
28
+
29
+ require "bundler/gem_tasks"
30
+ require "rspec/core/rake_task"
31
+
32
+ RSpec::Core::RakeTask.new(:spec)
33
+
34
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "openstudio/extension"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,84 @@
1
+ ########################################################################################################################
2
+ # OpenStudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC. All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5
+ # following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8
+ # disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11
+ # following disclaimer in the documentation and/or other materials provided with the distribution.
12
+ #
13
+ # (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote
14
+ # products derived from this software without specific prior written permission from the respective party.
15
+ #
16
+ # (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative
17
+ # works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without
18
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR
23
+ # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25
+ # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ ########################################################################################################################
28
+
29
+ require 'rake'
30
+ require 'rake/tasklib'
31
+ require 'rake/testtask'
32
+ require 'rubocop/rake_task'
33
+
34
+ require_relative '../openstudio_measure_tester'
35
+
36
+ module OpenStudio
37
+ module Extension
38
+ class RakeTask < Rake::TaskLib
39
+ attr_accessor :name
40
+
41
+ def initialize(*args, &task_block)
42
+ @name = args.shift || :openstudio
43
+
44
+ setup_subtasks(@name)
45
+ end
46
+
47
+ private
48
+
49
+ def setup_subtasks(name)
50
+ namespace name do
51
+ desc 'Run the CLI task to check for measure updates'
52
+ task :update_measures do
53
+ puts 'updating measures...'
54
+ exit 0
55
+ end
56
+
57
+ desc 'Use openstudio’s system ruby to run tests'
58
+ task :test_with_openstudio do
59
+ puts 'testing with openstudio'
60
+ exit 0
61
+ end
62
+
63
+ desc 'Use openstudio docker image to run tests'
64
+ task :test_with_docker do
65
+ puts 'testing with docker'
66
+ exit 0
67
+ end
68
+
69
+ desc 'Copy the measures to a location that can be uploaded to BCL'
70
+ task :stage_bcl do
71
+ puts 'Staging measures for BCL'
72
+ exit 0
73
+ end
74
+
75
+ desc 'Upload measures from the specified location.'
76
+ task :push_bcl do
77
+ puts 'Push measures to BCL'
78
+ exit 0
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,33 @@
1
+ ########################################################################################################################
2
+ # openstudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC. All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5
+ # following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8
+ # disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11
+ # following disclaimer in the documentation and/or other materials provided with the distribution.
12
+ #
13
+ # (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote
14
+ # products derived from this software without specific prior written permission from the respective party.
15
+ #
16
+ # (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative
17
+ # works may not use the "openstudio" trademark, "OS", "os", or any other confusingly similar designation without
18
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR
23
+ # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25
+ # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ ########################################################################################################################
28
+
29
+ module OpenStudio
30
+ module Extension
31
+ VERSION = "0.1.0"
32
+ end
33
+ end
@@ -0,0 +1,65 @@
1
+ ########################################################################################################################
2
+ # openstudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC. All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5
+ # following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8
+ # disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11
+ # following disclaimer in the documentation and/or other materials provided with the distribution.
12
+ #
13
+ # (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote
14
+ # products derived from this software without specific prior written permission from the respective party.
15
+ #
16
+ # (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative
17
+ # works may not use the "openstudio" trademark, "OS", "os", or any other confusingly similar designation without
18
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR
23
+ # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25
+ # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ ########################################################################################################################
28
+
29
+ require "openstudio/extension/version"
30
+
31
+ module OpenStudio
32
+ module Extension
33
+ # Return the version of the OpenStudio Extension Gem
34
+ def openstudio_extension_version
35
+ OpenStudio::Extension::VERSION
36
+ end
37
+
38
+ # Base method
39
+ # Return the absolute path of the measures or nil if there is none, can be used when configuring OSWs
40
+ def measures_dir
41
+ puts 'return directory'
42
+ end
43
+
44
+ # Base method
45
+ # List the names (and versions?) of the measures.
46
+ def list_measures
47
+ puts 'return the list of measures'
48
+ end
49
+
50
+ # Base method
51
+ # Relevant files such as weather data, design days, etc.
52
+ # return the absolute path of the files or nil if there is none, can be used when configuring OSWs
53
+ def files_dir
54
+ puts 'return the files directory'
55
+ end
56
+
57
+ # Base method
58
+ # returns a minimum openstudio version or nil
59
+ # need something like this because can’t restrict os version via gemfile
60
+ # Not sure how to do this yet
61
+ def minimum_openstudio_version
62
+ puts 'return the minimum openstudio version'
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,28 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "openstudio/extension/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "openstudio-extension"
8
+ spec.version = OpenStudio::Extension::VERSION
9
+ spec.authors = ["Nicholas Long", "Dan Macumber"]
10
+ spec.email = ["nicholas.long@nrel.gov", "daniel.macumber@nrel.gov"]
11
+
12
+ spec.summary = "openstudio base gem for creating generic extensions with encapsulated data and measures."
13
+ spec.description = "openstudio base gem for creating generic extensions with encapsulated data and measures."
14
+ spec.homepage = "https://openstudio.net"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.14"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: openstudio-extension
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nicholas Long
8
+ - Dan Macumber
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2019-05-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.14'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.14'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '10.0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '10.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ description: openstudio base gem for creating generic extensions with encapsulated
57
+ data and measures.
58
+ email:
59
+ - nicholas.long@nrel.gov
60
+ - daniel.macumber@nrel.gov
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - ".gitignore"
66
+ - ".rspec"
67
+ - ".travis.yml"
68
+ - Gemfile
69
+ - README.md
70
+ - Rakefile
71
+ - bin/console
72
+ - bin/setup
73
+ - lib/OpenStudio/Extension/rake_task.rb
74
+ - lib/OpenStudio/Extension/version.rb
75
+ - lib/OpenStudio/extension.rb
76
+ - openstudio-extension.gemspec
77
+ homepage: https://openstudio.net
78
+ licenses: []
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.5
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: openstudio base gem for creating generic extensions with encapsulated data
100
+ and measures.
101
+ test_files: []