diff --git a/lib/slayer/command.rb b/lib/slayer/command.rb index a3cf29b..c25737b 100644 --- a/lib/slayer/command.rb +++ b/lib/slayer/command.rb @@ -22,7 +22,7 @@ def err(value: nil, status: :default, message: nil) end def err!(value: nil, status: :default, message: nil) - unless ENV[:SUPPRESS_SLAYER_WARNINGS] + unless ENV['SUPPRESS_SLAYER_WARNINGS'] warn '[DEPRECATION] `err!` is deprecated. Please use `return err` instead.' end raise ResultFailureError, err(value: value, status: status, message: message) diff --git a/lib/slayer/compat/compat_040.rb b/lib/slayer/compat/compat_040.rb index c7fb571..9d81bc6 100644 --- a/lib/slayer/compat/compat_040.rb +++ b/lib/slayer/compat/compat_040.rb @@ -4,17 +4,17 @@ module Slayer class Command class << self def pass(value: nil, status: :default, message: nil) - warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] ok(value: value, status: status, message: message) end def flunk(value: nil, status: :default, message: nil) - warn '[DEPRECATION] `flunk` is deprecated. Please use `err` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `flunk` is deprecated. Please use `err` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] err(value: value, status: status, message: message) end def flunk!(value: nil, status: :default, message: nil) - unless ENV[:SUPPRESS_SLAYER_WARNINGS] + unless ENV['SUPPRESS_SLAYER_WARNINGS'] warn '[DEPRECATION] `flunk!` is deprecated. Please use `return err` instead.' end err!(value: value, status: status, message: message) @@ -28,24 +28,24 @@ def flunk!(value: nil, status: :default, message: nil) class Result def success? - warn '[DEPRECATION] `success?` is deprecated. Please use `ok?` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `success?` is deprecated. Please use `ok?` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] ok? end def failure? - warn '[DEPRECATION] `failure?` is deprecated. Please use `err?` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `failure?` is deprecated. Please use `err?` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] err? end end class ResultMatcher def pass(...) - warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `pass` is deprecated. Please use `ok` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] ok(...) end def fail(...) - warn '[DEPRECATION] `fail` is deprecated. Please use `err` instead.' unless ENV[:SUPPRESS_SLAYER_WARNINGS] + warn '[DEPRECATION] `fail` is deprecated. Please use `err` instead.' unless ENV['SUPPRESS_SLAYER_WARNINGS'] err(...) end end