Skip to content

Commit

Permalink
feat(gem): Add everything that is needed for the gem
Browse files Browse the repository at this point in the history
This includes two measures that we plan to ship with Ladybug Tools.
  • Loading branch information
chriswmackey authored and Chris Mackey committed Aug 25, 2021
1 parent 82169af commit 095b944
Show file tree
Hide file tree
Showing 150 changed files with 21,136 additions and 30 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on: [push, pull_request]

jobs:

deploy:
name: Deploy to GitHub and Rubygems.org
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up node # we need node for for semantic release
uses: actions/[email protected]
with:
node-version: 14.2.0
- name: install semantic-release
run:
npm install @semantic-release/exec
- name: run semantic release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update gemspec
if: steps.semantic.outputs.new_release_published == 'true'
env:
RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }}
run: |
export CLEAN_TAG=$(echo $RELEASE_TAG | sed 's/v//g')
sed -i 's/"0.0.0"/'"'$CLEAN_TAG'"'/g' lbt-measures.gemspec
- name: Release Gem
if: steps.semantic.outputs.new_release_published == 'true'
uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{secrets.RUBYGEMS_API_KEY}}
- name: Update lbt-grasshopper
if: steps.semantic.outputs.new_release_published == 'true'
env:
RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }}
DISPATCH_REPO: ladybug-tools/lbt-grasshopper
DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }}
run: |
curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-d '{
"event_type": "lbt_measures_gem_release",
"client_payload": {
"version" : "'$RELEASE_TAG'"
}
}' \
-u ladybugbot:$DEPS_TOKEN
- name: Update honeybee-energy
if: steps.semantic.outputs.new_release_published == 'true'
env:
RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }}
DISPATCH_REPO: ladybug-tools/honeybee-energy
DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }}
run: |
curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-d '{"event_type": "lbt_measures_gem_release", "client_payload": {"version": "'$RELEASE_TAG'"}}' \
-u ladybugbot:$DEPS_TOKEN
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/.bundle/
/.yardoc
/.ruby-version
/Gemfile.lock
/gems
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/coverage/
/spec/output/
/spec/reports/
/spec/test/
/tmp/
/test/
/lib/measures/test_results
/lib/measures/.rubocop*
/.vscode
/.vs

# rspec failure tracking
.rspec_status
.rakeTasks

# Ignore IDE files
/.idea
*.rubocop-http*

# measures tests
lib/measures/.rubocop.yml
lib/measures/test_results/*
lib/measures/*/tests/output

out.txt
7 changes: 7 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'http://rubygems.org'

# Specify your gem's dependencies
gemspec

# get the openstudio-extension gem
if File.exist?('../OpenStudio-extension-gem') # local development copy
gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
else # get it from rubygems.org
gem 'openstudio-extension', '0.4.2'
end
29 changes: 0 additions & 29 deletions LICENSE

This file was deleted.

23 changes: 23 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable Energy, LLC,
Ladybug Tools LLC and other contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
derived from this software without specific prior written permission from the respective party.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# lbt-measures
:straight_ruler: :straight_ruler: :straight_ruler: Collection of measures that ship with Ladybug Tools plugins.

:straight_ruler: :straight_ruler: :straight_ruler: Collection of measures that ship with the
Ladybug Tools plugins.

Most (if not all) of the measures in this gem can be found on the [BCL](https://bcl.nrel.gov/)
and are maintained by [NREL](https://www.nrel.gov/) or other contributors. However,
the versions of the measures in this gem are regularly tested for compatibility
with Ladybug Tools.

Given that different measures can have different authors, one should refer to the
individual license files with each measure for limitations about redistribution.
29 changes: 29 additions & 0 deletions lbt-measures.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'lbt-measures'
spec.version = "0.0.0"
spec.authors = ['Dan Macumber', 'Chris Mackey']
spec.email = ['[email protected]']

spec.summary = 'Collection of measures that ship with Ladybug Tools plugins.'
spec.description = 'Measures that ship with Ladybug Tools plugins and are regularly tested for compatibility with them.'
spec.homepage = 'https://github.com/ladybug-tools/lbt-measures'

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = "~> 2.7.0"

spec.add_dependency 'openstudio-extension', '0.4.3'
spec.add_development_dependency "bundler", "~> 2.1"

end
27 changes: 27 additions & 0 deletions lib/openstudio_results/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
or promote products derived from this software without specific prior written permission from the
respective party.

(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 095b944

Please sign in to comment.