lib/basquiat/adapters/rabbitmq/events.rb in basquiat-1.3.0.pre.1 vs lib/basquiat/adapters/rabbitmq/events.rb in basquiat-1.3.0
- old
+ new
@@ -1,7 +1,6 @@
-require 'set'
-
+# frozen_string_literal: true
module Basquiat
module Adapters
class RabbitMq
class Events
attr_reader :keys
@@ -11,11 +10,11 @@
@exact = {}
@patterns = {}
end
def []=(key, value)
- if key =~ /\*|\#/
+ if key =~ /\*|#/
set_pattern_key(key, value)
else
@exact[key] = value
end
@keys.push key
@@ -32,10 +31,10 @@
def set_pattern_key(key, value)
key = key.gsub('.', '\.')
key = if key =~ /\*/
/^#{key.gsub('*', '[^.]+')}$/
else
- /^#{key.gsub(/\#/, '.*')}$/
+ /^#{key.gsub(/#/, '.*')}$/
end
@patterns[key] = value
end
def simple_pattern_match(key)