Skip to content

Commit 6bc5294

Browse files
committed
refactor out ruby_info to method
1 parent 71cdca9 commit 6bc5294

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/ruby_dep/warning.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ def show_warnings
4343

4444
def check_ruby
4545
version = Gem::Version.new(RUBY_VERSION)
46-
info = VERSION_INFO[RUBY_ENGINE] || {}
47-
info.each do |ruby, status|
46+
current_ruby_info.each do |ruby, status|
4847
return status if version >= Gem::Version.new(ruby)
4948
end
5049
:insecure
@@ -54,5 +53,9 @@ def silenced?
5453
value = ENV['RUBY_DEP_GEM_SILENCE_WARNINGS']
5554
(value || '0') !~ /^0|false|no|n$/
5655
end
56+
57+
def current_ruby_info
58+
VERSION_INFO[RUBY_ENGINE] || {}
59+
end
5760
end
5861
end

0 commit comments

Comments
 (0)