summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-11-15 14:36:04 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-11-15 14:36:04 -0800
commit9689452421b9cbbb26a5112c29be15c74cbf6014 (patch)
tree86281b997e98515822d7e146a28771d292541bef
parente4dbb483b1252a1e861ffaf421317e1e450c3abb (diff)
downloadchef-9689452421b9cbbb26a5112c29be15c74cbf6014.tar.gz
fix Lint/UnifiedInteger cop
believe this becomes necessary for ruby 2.4/3.0 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/application/exit_code.rb2
-rw-r--r--lib/chef/mixin/powershell_type_coercions.rb2
-rw-r--r--lib/chef/node/common_api.rb2
-rw-r--r--lib/chef/resource/launchd.rb4
-rw-r--r--lib/chef/resource/reboot.rb2
5 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/application/exit_code.rb b/lib/chef/application/exit_code.rb
index 6fec2524dd..b02bb68d4a 100644
--- a/lib/chef/application/exit_code.rb
+++ b/lib/chef/application/exit_code.rb
@@ -88,7 +88,7 @@ class Chef
def normalize_legacy_exit_code(exit_code)
case exit_code
- when Fixnum
+ when Integer
exit_code
when Exception
lookup_exit_code_by_exception(exit_code)
diff --git a/lib/chef/mixin/powershell_type_coercions.rb b/lib/chef/mixin/powershell_type_coercions.rb
index 6159c87948..4ec555ded6 100644
--- a/lib/chef/mixin/powershell_type_coercions.rb
+++ b/lib/chef/mixin/powershell_type_coercions.rb
@@ -23,7 +23,7 @@ class Chef
def type_coercions
@type_coercions ||= {
- Fixnum => { :type => lambda { |x| x.to_s } },
+ Integer => { :type => lambda { |x| x.to_s } },
Float => { :type => lambda { |x| x.to_s } },
FalseClass => { :type => lambda { |x| "$false" } },
TrueClass => { :type => lambda { |x| "$true" } },
diff --git a/lib/chef/node/common_api.rb b/lib/chef/node/common_api.rb
index 9bb83a5178..c9786807e9 100644
--- a/lib/chef/node/common_api.rb
+++ b/lib/chef/node/common_api.rb
@@ -24,7 +24,7 @@ class Chef
# method-style access to attributes
def valid_container?(obj, key)
- return obj.is_a?(Hash) || (obj.is_a?(Array) && key.is_a?(Fixnum))
+ return obj.is_a?(Hash) || (obj.is_a?(Array) && key.is_a?(Integer))
end
private :valid_container?
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index 27937515ec..6427b13f84 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -72,8 +72,8 @@ class Chef
raise Chef::Exceptions::ValidationFailed, error_msg
end
- unless entry.values.all? { |val| val.is_a?(Fixnum) }
- failed_values = entry.values.reject { |val| val.is_a?(Fixnum) }.join(", ")
+ unless entry.values.all? { |val| val.is_a?(Integer) }
+ failed_values = entry.values.reject { |val| val.is_a?(Integer) }.join(", ")
error_msg = "Invalid value(s) (#{failed_values}) for start_calendar_interval item. Values must be integers!"
raise Chef::Exceptions::ValidationFailed, error_msg
end
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 24d6e74157..519defa602 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -41,7 +41,7 @@ class Chef
end
def delay_mins(arg = nil)
- set_or_return(:delay_mins, arg, :kind_of => Fixnum)
+ set_or_return(:delay_mins, arg, :kind_of => Integer)
end
end
end