Skip to content

Commit

Permalink
Merge pull request #8 from rd2/y2023
Browse files Browse the repository at this point in the history
Copyright (2023) + OSv351
  • Loading branch information
brgix authored Jan 1, 2023
2 parents 3f36fb7 + 4cbeea0 commit f1ab6bc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 16 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test_300x:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:
docker exec -t test bundle exec rake
docker kill test
test_321x:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -39,7 +39,7 @@ jobs:
docker exec -t test bundle exec rake
docker kill test
test_330x:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -55,7 +55,7 @@ jobs:
docker exec -t test bundle exec rake
docker kill test
test_340x:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -70,3 +70,19 @@ jobs:
docker exec -t test bundle update
docker exec -t test bundle exec rake
docker kill test
test_351x:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Run Tests
run: |
echo $(pwd)
echo $(ls)
docker pull nrel/openstudio:3.5.1
docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.5.1
docker exec -t test pwd
docker exec -t test ls
docker exec -t test bundle update
docker exec -t test bundle exec rake
docker kill test
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2022, Denis Bourgeois
Copyright (c) 2022-2023, Denis Bourgeois
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion lib/oslg.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BSD 3-Clause License
#
# Copyright (c) 2022, Denis Bourgeois
# Copyright (c) 2022-2023, Denis Bourgeois
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
24 changes: 17 additions & 7 deletions lib/oslg/oslog.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BSD 3-Clause License
#
# Copyright (c) 2022, Denis Bourgeois
# Copyright (c) 2022-2023, Denis Bourgeois
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -127,6 +127,7 @@ def fatal?
# @return [String] "DEBUG", "INFO", "WARN", "ERROR" or "FATAL"
def tag(level)
return @@tag[level] if level >= DEBUG && level <= FATAL

""
end

Expand All @@ -138,6 +139,7 @@ def tag(level)
# @return [String] preset OSlg message
def msg(status)
return @@msg[status] if status >= DEBUG && status <= FATAL

""
end

Expand All @@ -163,6 +165,7 @@ def log(level = DEBUG, message = "")
@@logs << {level: level, message: message}
@@status = level if level > @@status
end

@@status
end

Expand Down Expand Up @@ -194,10 +197,11 @@ def invalid(id = "", mth = "", ord = 0, lvl = DEBUG, res = nil)
mth = mth[0...60] + " ..." if mth.length > 60
return res if mth.empty?

msg = "Invalid '#{id}' "
msg = "Invalid '#{id}' "
msg += "arg ##{ord} " if ord > 0
msg += "(#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand Down Expand Up @@ -232,6 +236,7 @@ def mismatch(id = "", obj = nil, cl = nil, mth = "", lvl = DEBUG, res = nil)

msg = "'#{id}' #{obj.class}? expecting #{cl} (#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand Down Expand Up @@ -264,8 +269,9 @@ def hashkey(id = "", hsh = {}, key = "", mth = "", lvl = DEBUG, res = nil)
mth = mth[0...60] + " ..." if mth.length > 60
return res if mth.empty?

msg = "Missing '#{key}' key in '#{id}' Hash (#{mth})"
msg = "Missing '#{key}' key in '#{id}' Hash (#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand Down Expand Up @@ -294,8 +300,9 @@ def empty(id = "", mth = "", lvl = DEBUG, res = nil)
mth = mth[0...60] + " ..." if mth.length > 60
return res if mth.empty?

msg = "Empty '#{id}' (#{mth})"
msg = "Empty '#{id}' (#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand Down Expand Up @@ -325,8 +332,9 @@ def zero(id = "", mth = "", lvl = DEBUG, res = nil)
mth = mth[0...60] + " ..." if mth.length > 60
return res if mth.empty?

msg = "Zero '#{id}' (#{mth})"
msg = "Zero '#{id}' (#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand Down Expand Up @@ -355,9 +363,10 @@ def negative(id = "", mth = "", lvl = DEBUG, res = nil)

mth = mth[0...60] + " ..." if mth.length > 60
return res if mth.empty?
msg = "Negative '#{id}' (#{mth})"

msg = "Negative '#{id}' (#{mth})"
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL

res
end

Expand All @@ -368,6 +377,7 @@ def negative(id = "", mth = "", lvl = DEBUG, res = nil)
def clean!
@@status = 0
@@logs = []

@@level
end

Expand Down
4 changes: 2 additions & 2 deletions lib/oslg/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BSD 3-Clause License
#
# Copyright (c) 2022, Denis Bourgeois
# Copyright (c) 2022-2023, Denis Bourgeois
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -29,5 +29,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

module OSlg
VERSION = "0.2.5".freeze
VERSION = "0.2.6".freeze
end
2 changes: 1 addition & 1 deletion oslg.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake", "~> 13.0"
s.add_development_dependency "rspec", "~> 3.11"

s.metadata["homepage_uri"] = s.homepage
s.metadata["homepage_uri" ] = s.homepage
s.metadata["source_code_uri"] = "#{s.homepage}/tree/v#{s.version}"
s.metadata["bug_tracker_uri"] = "#{s.homepage}/issues"
end

0 comments on commit f1ab6bc

Please sign in to comment.