Module: Resque::UniqueInQueue

Defined in:
lib/resque-unique_in_queue.rb,
lib/resque/unique_in_queue.rb,
lib/resque/unique_in_queue/queue.rb,
lib/resque/unique_in_queue/version.rb,
lib/resque/unique_in_queue/configuration.rb,
sig/resque/unique_in_queue.rbs

Defined Under Namespace

Modules: Queue, Version Classes: Configuration

Constant Summary collapse

PLUGIN_TAG =
blue_text("[R-UIQ] ").freeze
VERSION =

Current gem version exposed at the traditional constant location.

Returns:

  • (String)
Version::VERSION

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.configurationObject

The plugin exposes one replaceable configuration object by design. rubocop:disable ThreadSafety/ClassAndModuleAttributes



50
51
52
# File 'lib/resque-unique_in_queue.rb', line 50

def configuration
  @configuration
end

Class Method Details

.blue_text(text) ⇒ Object

Wraps text in ANSI blue escape codes. Replaces the former colorize dependency; produces the exact sequence colorize's String#blue emitted.



27
28
29
# File 'lib/resque-unique_in_queue.rb', line 27

def self.blue_text(text)
  "\e[0;34;49m#{text}\e[0m"
end

.debug(message) ⇒ Object



37
38
39
# File 'lib/resque-unique_in_queue.rb', line 37

def debug(message)
  configuration.logger&.debug("#{PLUGIN_TAG}#{message}") if configuration.debug_mode
end

.log(message) ⇒ Object



33
34
35
# File 'lib/resque-unique_in_queue.rb', line 33

def log(message)
  configuration.logger&.send(configuration.log_level, message)
end

Instance Method Details

#configure {|@configuration| ... } ⇒ Object

For per-class config with a block

Yields:



42
43
44
# File 'lib/resque-unique_in_queue.rb', line 42

def configure
  yield(@configuration)
end