Skip to content
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
6 changes: 2 additions & 4 deletions lib/mauth/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def initialize(config = {})
Rails.logger
else
require 'logger'
is_win = RUBY_PLATFORM =~ /mswin|windows|mingw32|cygwin/i
null_device = is_win ? 'NUL' : '/dev/null'
::Logger.new(File.open(null_device, File::WRONLY))
Comment on lines -100 to -102
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed that this is no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubocop doesn't like NUL and /dev/null:
https://github.com/mdsol/mauth-client-ruby/actions/runs/12077251048/job/33679854702?pr=70

lib/mauth/client.rb:101:34: C: [Correctable] Style/FileNull: Use File::NULL instead of NUL.
          null_device = is_win ? 'NUL' : '/dev/null'
                                 ^^^^^
lib/mauth/client.rb:101:42: C: [Correctable] Style/FileNull: Use File::NULL instead of /dev/null.
          null_device = is_win ? 'NUL' : '/dev/null'
                                         ^^^^^^^^^^^

::Logger.new(File.open(File::NULL, File::WRONLY))
end
end

Expand Down Expand Up @@ -183,7 +181,7 @@ def mauth_service_response_error(response)

# Changes all keys in the top level of the hash to symbols. Does not affect nested hashes inside this one.
def symbolize_keys(hash)
hash.keys.each do |key| # rubocop:disable Style/HashEachMethods
hash.keys.each do |key|
hash[(key.to_sym rescue key) || key] = hash.delete(key)
end
hash
Expand Down
9 changes: 0 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,3 @@

require 'simplecov'
SimpleCov.start

MAUTH_CONFIG_YML = File.expand_path('config_root/config/mauth.yml', __dir__).freeze

RSpec.configure do |config|
config.before do
allow(ENV).to receive(:[]).and_call_original
allow(ENV).to receive(:[]).with('MAUTH_CONFIG_YML').and_return(MAUTH_CONFIG_YML)
end
end