Compare commits

15 Commits

Author SHA1 Message Date
3c892623fa Merge pull request #6 from onyx-and-iris/dependabot/bundler/rexml-3.4.2
Bump rexml from 3.3.9 to 3.4.2
2026-03-17 21:16:57 +00:00
dependabot[bot]
92b36ecce4 Bump rexml from 3.3.9 to 3.4.2
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.9 to 3.4.2.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.9...v3.4.2)

---
updated-dependencies:
- dependency-name: rexml
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-17 21:15:05 +00:00
1dc8bf10f7 Merge pull request #5 from onyx-and-iris/dependabot/bundler/rexml-3.3.9
Bump rexml from 3.3.6 to 3.3.9
2025-03-27 15:46:02 +00:00
dependabot[bot]
426a7d6628 Bump rexml from 3.3.6 to 3.3.9
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.6 to 3.3.9.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.6...v3.3.9)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-27 15:45:47 +00:00
e1146913f9 Merge pull request #4 from onyx-and-iris/dependabot/bundler/rexml-3.3.6
Bump rexml from 3.3.3 to 3.3.6
2024-08-24 14:37:10 +01:00
dependabot[bot]
78ca03e610 Bump rexml from 3.3.3 to 3.3.6
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.3...v3.3.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-24 13:37:01 +00:00
03174b9e40 Merge pull request #3 from onyx-and-iris/dependabot/bundler/rexml-3.3.3
Bump rexml from 3.3.0 to 3.3.3
2024-08-06 11:37:52 +01:00
dependabot[bot]
63dd131d61 Bump rexml from 3.3.0 to 3.3.3
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.0 to 3.3.3.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.0...v3.3.3)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-06 10:37:37 +00:00
6ffae8e6c7 Merge pull request #2 from onyx-and-iris/dependabot/bundler/rexml-3.3.0
Bump rexml from 3.2.5 to 3.3.0
2024-06-21 08:32:05 +01:00
dependabot[bot]
2878c31819 Bump rexml from 3.2.5 to 3.3.0
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.5 to 3.3.0.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.5...v3.3.0)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-21 07:31:42 +00:00
2e774ef185 Merge pull request #1 from onyx-and-iris/dependabot/bundler/rake-13.0.6
Update rake requirement from ~> 11.2, >= 11.2.2 to >= 11.2.2, ~> 13.0
2023-09-03 16:41:03 +01:00
dependabot[bot]
3e661b23a3 Update rake requirement from ~> 11.2, >= 11.2.2 to >= 11.2.2, ~> 13.0
Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v11.3.0...v13.0.6)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-03 15:40:27 +00:00
fac83a0dde upd Gemfile.lock 2023-08-30 22:35:02 +01:00
4c4746fe8a now using String refinement
Events Director module renamed

patch bump
2023-08-29 22:55:11 +01:00
3a0f298045 upd gemfile 2023-08-29 20:36:51 +01:00
6 changed files with 25 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
obsws (0.6.0) obsws (0.6.2)
waitutil (~> 0.2.1) waitutil (~> 0.2.1)
websocket-driver (~> 0.7.5) websocket-driver (~> 0.7.5)
@@ -19,9 +19,9 @@ GEM
racc racc
racc (1.7.1) racc (1.7.1)
rainbow (3.1.1) rainbow (3.1.1)
rake (11.3.0) rake (13.0.6)
regexp_parser (2.8.1) regexp_parser (2.8.1)
rexml (3.2.5) rexml (3.4.2)
rubocop (1.52.1) rubocop (1.52.1)
json (~> 2.3) json (~> 2.3)
parallel (~> 1.10) parallel (~> 1.10)
@@ -58,11 +58,12 @@ GEM
PLATFORMS PLATFORMS
x64-mingw-ucrt x64-mingw-ucrt
x86_64-linux
DEPENDENCIES DEPENDENCIES
minitest (~> 5.16, >= 5.16.3) minitest (~> 5.16, >= 5.16.3)
obsws! obsws!
rake (~> 11.2, >= 11.2.2) rake (~> 13.0, >= 11.2.2)
standard (~> 1.30) standard (~> 1.30)
BUNDLED WITH BUNDLED WITH

View File

@@ -28,8 +28,8 @@ module OBSWS
ALL = LOW_VOLUME | HIGH_VOLUME ALL = LOW_VOLUME | HIGH_VOLUME
end end
module EventDirector module Director
include Util::String using Util::CoreExtensions
def observers def observers
@observers ||= {} @observers ||= {}
@@ -50,13 +50,13 @@ module OBSWS
end end
def fire(event, data) def fire(event, data)
observers[snakecase(event).to_sym]&.each { |block| data.empty? ? block.call : block.call(data) } observers[event.snakecase.to_sym]&.each { |block| data.empty? ? block.call : block.call(data) }
end end
end end
class Client class Client
include Logging include Logging
include EventDirector include Events::Director
include Mixin::TearDown include Mixin::TearDown
include Mixin::OPCodes include Mixin::OPCodes

View File

@@ -1,16 +1,17 @@
module OBSWS module OBSWS
module Mixin module Mixin
module Meta module Meta
include Util::String using Util::CoreExtensions
def make_field_methods(*params) def make_field_methods(*params)
params.each do |param| params.each do |param|
define_singleton_method(snakecase(param.to_s)) { @resp[param] } define_singleton_method(param.to_s.snakecase) { @resp[param] }
end end
end end
end end
class MetaObject class MetaObject
using Util::CoreExtensions
include Mixin::Meta include Mixin::Meta
def initialize(resp, fields) def initialize(resp, fields)
@@ -21,7 +22,7 @@ module OBSWS
def empty? = @fields.empty? def empty? = @fields.empty?
def attrs = @fields.map { |f| snakecase(f.to_s) } def attrs = @fields.map { |f| f.to_s.snakecase }
end end
# Represents a request response object # Represents a request response object

View File

@@ -1,16 +1,17 @@
module OBSWS module OBSWS
module Util module Util
module String module CoreExtensions
def camelcase(s) refine String do
s.split("_").map(&:capitalize).join def camelcase
split("_").map(&:capitalize).join
end end
def snakecase(s) def snakecase
s gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2')
.downcase .downcase
end end
end end
end end
end
end end

View File

@@ -11,7 +11,7 @@ module OBSWS
end end
def patch def patch
1 2
end end
def to_a def to_a

View File

@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "waitutil", "~> 0.2.1" spec.add_runtime_dependency "waitutil", "~> 0.2.1"
spec.add_development_dependency "standard", "~> 1.30" spec.add_development_dependency "standard", "~> 1.30"
spec.add_development_dependency "minitest", "~> 5.16", ">= 5.16.3" spec.add_development_dependency "minitest", "~> 5.16", ">= 5.16.3"
spec.add_development_dependency "rake", "~> 11.2", ">= 11.2.2" spec.add_development_dependency "rake", ">= 11.2.2", "~> 13.0"
spec.required_ruby_version = ">= 3.0" spec.required_ruby_version = ">= 3.0"
spec.metadata = { spec.metadata = {
"source_code_uri" => "https://github.com/onyx-and-iris/obsws-ruby" "source_code_uri" => "https://github.com/onyx-and-iris/obsws-ruby"