Skip to content

Commit

Permalink
Merge pull request spox#99 from webframp/fix/deprecated-constants
Browse files Browse the repository at this point in the history
Fix deprecation warnings for ruby 2.4
  • Loading branch information
chrisroberts authored Dec 16, 2017
2 parents ba248d8 + c3b62a6 commit 67548d4
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/batali/b_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ def _dump(*_)
end

::Object.constants.each do |const_name|
next if const_name == :Config || const_name == :TimeoutError
deprecated_constants = [
:Config,
:TimeoutError,
:Fixnum,
:Bignum,
:NIL,
:TRUE,
:FALSE
]
next if deprecated_constants.include?(const_name)
const_set(const_name, ::Object.const_get(const_name))
end

Expand All @@ -66,7 +75,16 @@ def require(*args)
instance_exec do
class << self
::Object.constants.each do |const_name|
next if const_name == :Config || const_name == :TimeoutError
deprecated_constants = [
:Config,
:TimeoutError,
:Fixnum,
:Bignum,
:NIL,
:TRUE,
:FALSE
]
next if deprecated_constants.include?(const_name)
const_set(const_name, ::Object.const_get(const_name))
end
end
Expand Down

0 comments on commit 67548d4

Please sign in to comment.