Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle update #141

Merged
merged 2 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 7 additions & 27 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
inherit_gem:
rubocop-inst:
- rubocop.yml
- rubocop-rspec.yml

require:
- rubocop-performance
- rubocop-rake
- rubocop-rspec

Expand Down Expand Up @@ -35,18 +39,8 @@ Lint/BinaryOperatorWithIdenticalOperands:
Exclude:
- spec/openhab/core/types/*_spec.rb

Metrics:
Enabled: false

Performance/Casecmp:
AutoCorrect: false

RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/ExampleWording:
DisallowedExamples: []
RSpec/ExpectActual:
Exclude:
- spec/openhab/core/types/*_spec.rb
Expand All @@ -58,6 +52,8 @@ RSpec/FilePath:
RSpec/IdenticalEqualityAssertion:
Exclude:
- spec/openhab/core/types/*_spec.rb
RSpec/IndexedLet:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/MultipleExpectations:
Expand All @@ -69,8 +65,6 @@ RSpec/NestedGroups:
RSpec/NoExpectationExample:
Enabled: false

Style/Alias:
EnforcedStyle: prefer_alias_method
Style/CaseEquality:
Exclude: # we're explicitly testing this operator
- spec/openhab/core/types/*_spec.rb
Expand All @@ -90,22 +84,8 @@ Style/GlobalVars:
- $scriptExtension
- $sharedCache
- $things
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
Style/PercentQLiterals:
EnforcedStyle: upper_case_q
Style/PerlBackrefs:
Enabled: false
Style/RescueStandardError:
EnforcedStyle: implicit
Style/SpecialGlobalVars:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
Style/YodaCondition:
Exclude:
- spec/openhab/core/types/*_spec.rb
99 changes: 51 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.7.3)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.3)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
async (1.31.0)
Expand All @@ -39,18 +39,18 @@ GEM
protocol-http1 (~> 0.14.0)
protocol-http2 (~> 0.14.0)
traces (>= 0.8.0)
async-http-faraday (0.11.0)
async-http-faraday (0.12.0)
async-http (~> 0.42)
faraday
async-io (1.34.3)
async-io (1.35.0)
async
async-pool (0.4.0)
async (>= 1.25)
builder (3.2.4)
byebug (11.1.3)
coderay (1.1.3)
commonmarker (0.23.8)
concurrent-ruby (1.2.0)
commonmarker (0.23.10)
concurrent-ruby (1.2.2)
console (1.15.3)
fiber-local
cucumber (8.0.0)
Expand All @@ -65,7 +65,7 @@ GEM
mime-types (~> 3.4, >= 3.4.1)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-ci-environment (9.1.0)
cucumber-ci-environment (9.2.0)
cucumber-core (11.0.0)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
Expand All @@ -85,13 +85,13 @@ GEM
diff-lcs (1.5.0)
eventmachine (1.2.7)
eventmachine (1.2.7-java)
faraday (2.7.4)
faraday (2.7.10)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-http-cache (2.4.1)
faraday-http-cache (2.5.0)
faraday (>= 0.8)
faraday-net_http (3.0.2)
faraday-retry (2.1.0)
faraday-retry (2.2.0)
faraday (~> 2.0)
ffi (1.15.5)
ffi (1.15.5-java)
Expand Down Expand Up @@ -131,25 +131,25 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
io-console (0.6.0-java)
irb (1.6.2)
irb (1.6.3)
reline (>= 0.3.0)
json (2.6.3)
json (2.6.3-java)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
lumberjack (1.2.9)
marcel (1.0.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
minitest (5.18.0)
mime-types-data (3.2023.0808)
mini_mime (1.1.5)
minitest (5.20.0)
multi_json (1.15.0)
multi_test (1.1.0)
multi_xml (0.6.0)
Expand All @@ -170,9 +170,10 @@ GEM
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
parallel (1.22.1)
parser (3.2.1.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pastel (0.8.0)
tty-color (~> 0.5)
persistent_http (1.0.6)
Expand All @@ -182,7 +183,7 @@ GEM
persistent_http (< 2)
process_exists (0.2.0)
protocol-hpack (1.4.2)
protocol-http (0.24.1)
protocol-http (0.24.4)
protocol-http1 (0.14.6)
protocol-http (~> 0.22)
protocol-http2 (0.14.2)
Expand All @@ -195,72 +196,75 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
public_suffix (5.0.1)
racc (1.6.2)
racc (1.6.2-java)
rack (2.2.6.2)
public_suffix (5.0.3)
racc (1.7.1)
racc (1.7.1-java)
rack (2.2.8)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.7.0)
reline (0.3.2)
regexp_parser (2.8.1)
reline (0.3.8)
io-console (~> 0.5)
rexml (3.2.5)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.1)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.45.1)
rspec-support (3.12.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.26.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.17.1)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-performance (1.16.0)
rubocop-inst (1.0.2)
rubocop (~> 1.50)
rubocop-performance (~> 1.17)
rubocop-performance (1.17.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.18.1)
rubocop-rspec (2.20.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
ruby-progressbar (1.11.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
shellany (0.0.1)
spoon (0.0.6)
ffi
sys-uname (1.2.2)
sys-uname (1.2.3)
ffi (~> 1.1)
thin (1.8.1)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.1)
timecop (0.9.6)
thor (1.2.2)
timecop (0.9.8)
timers (4.3.5)
traces (0.9.1)
traces (0.11.1)
tty-color (0.6.0)
tty-command (0.10.1)
pastel (~> 0.8)
Expand All @@ -269,7 +273,7 @@ GEM
unicode-display_width (2.4.2)
webrick (1.7.0)
yaml-lint (0.1.2)
zeitwerk (2.6.7)
zeitwerk (2.6.11)

PLATFORMS
arm64-darwin-21
Expand All @@ -292,14 +296,13 @@ DEPENDENCIES
guard-yard (~> 2.2)
httparty (~> 0.20)
irb (~> 1.4)
nokogiri (~> 1.13.9)
nokogiri (~> 1.13)
openhab-scripting!
persistent_httparty (~> 0.1)
process_exists (~> 0.2)
rake (~> 13.0)
rspec (~> 3.11)
rubocop (~> 1.8)
rubocop-performance (~> 1.11)
rubocop-inst
rubocop-rake (~> 0.6)
rubocop-rspec (~> 2.11)
thin (~> 1.8.1)
Expand All @@ -309,4 +312,4 @@ DEPENDENCIES
yard!

BUNDLED WITH
2.3.26
2.4.19
7 changes: 5 additions & 2 deletions lib/openhab/core/actions/audio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ class << self
#
def play_sound(filename, sink: nil, volume: nil)
volume = PercentType.new(volume) unless volume.is_a?(PercentType) || volume.nil?
java_send :playSound, [java.lang.String, java.lang.String, PercentType.java_class],
sink, filename.to_s, volume
java_send :playSound,
[java.lang.String, java.lang.String, PercentType.java_class],
sink,
filename.to_s,
volume
end

#
Expand Down
6 changes: 4 additions & 2 deletions lib/openhab/core/items/semantics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def add(label: nil, synonyms: "", description: "", **tags)
raise ArgumentError, "Additional options can only be specified when creating one tag"
end

synonyms = Array.wrap(synonyms).map(&:to_s).map(&:strip)
synonyms = Array.wrap(synonyms).map { |s| s.to_s.strip }

tags.map do |name, parent|
# @deprecated OH4.0.0.M4 missing registry
Expand All @@ -317,7 +317,9 @@ def add(label: nil, synonyms: "", description: "", **tags)
next if lookup(name)
next unless parent

new_tag = org.openhab.core.semantics.SemanticTagImpl.new("#{parent.uid}_#{name}", label, description,
new_tag = org.openhab.core.semantics.SemanticTagImpl.new("#{parent.uid}_#{name}",
label,
description,
synonyms)
Provider.instance.add(new_tag)
lookup(name)
Expand Down
3 changes: 2 additions & 1 deletion lib/openhab/core/things/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class Proxy < Delegator
def_delegators :__getobj__, :class, :is_a?, :kind_of?

# @!visibility private
EVENTS = [Events::ThingAddedEvent::TYPE, Events::ThingUpdatedEvent::TYPE,
EVENTS = [Events::ThingAddedEvent::TYPE,
Events::ThingUpdatedEvent::TYPE,
Events::ThingRemovedEvent::TYPE].freeze
# @!visibility private
UID_METHOD = :uid
Expand Down
3 changes: 2 additions & 1 deletion lib/openhab/core/types/date_time_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def <=>(other)
def coerce(other)
logger.trace("Coercing #{self} as a request from #{other.class}")
return [other, zoned_date_time] if other.respond_to?(:to_zoned_date_time)
return [DateTimeType.new(other), self] if other.respond_to?(:to_time)

[DateTimeType.new(other), self] if other.respond_to?(:to_time)
end

#
Expand Down
3 changes: 2 additions & 1 deletion lib/openhab/core/types/open_closed_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class OpenClosedType
# @return [OpenClosedType] {OPEN} if {closed?}, {CLOSED} if {open?}
def !
return CLOSED if open?
return OPEN if closed?

OPEN if closed?
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/openhab/core/types/string_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def <=>(other)
#
def coerce(other)
logger.trace("Coercing #{self} as a request from #{other.class}")
return [other.to_str, self] if other.respond_to?(:to_str)
[other.to_str, self] if other.respond_to?(:to_str)
end

# any method that exists on String gets forwarded to to_s
Expand Down
Loading