Skip to content

Commit

Permalink
Tidy-up
Browse files Browse the repository at this point in the history
  • Loading branch information
mblumtritt committed Oct 26, 2023
1 parent 0e738c2 commit ed12dbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ RuboCop::RakeTask.new(:rubocop) do |task|
end

desc 'Run Prettier'
task(:prettier) { system('npm run lint') }
task(:prettier) { sh 'npm run lint' }

task default: %i[spec rubocop prettier]
11 changes: 4 additions & 7 deletions lib/ears.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
module Ears
class << self
# The global configuration for Ears.
# @attribute [r] configuration
# @return [Ears::Configuration]
attr_reader :configuration
def configuration
@configuration ||= Ears::Configuration.new
end

# Yields the global configuration instance so you can modify it.
# @yieldparam configuration [Ears::Configuration] The global configuration instance.
Expand Down Expand Up @@ -72,9 +73,7 @@ def error!(error)

# Used internally for testing.
def reset!
@connection = nil
Thread.current[:ears_channel] = nil
@configuration = Ears::Configuration.new
@configuration = @connection = Thread.current[:ears_channel] = nil
end

private
Expand Down Expand Up @@ -102,6 +101,4 @@ def connection_config
}.compact
end
end

reset!
end

0 comments on commit ed12dbb

Please sign in to comment.