Skip to content

Commit

Permalink
resolve deprecation notice about Fixnum
Browse files Browse the repository at this point in the history
Fixnum was deprecated in Ruby 2.4, so this should be checking for
Integer.

Changed this check to `kind_of?` for backwards compatibility. Fixnum is
a subclass of Integer, even in Ruby < 2.4. `kind_of?` will return true
if the class given is the class of the object, or if it is one of the
superclasses of the object or modules included in the object.
`instance_of?` only returns true for an exact match on the class, does
not take subclassing into consideration.

Signed-off-by: Robb Kidd <robb@thekidds.org>
  • Loading branch information
robbkidd committed Jan 28, 2019
1 parent 850c4fe commit f44ad44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Vagrant.configure("2") do |c|
<% options = [] %>
<% item.each do |storage_option_key, storage_option_value|
options << "\"--#{storage_option_key}\""
if storage_option_value.instance_of? Fixnum
if storage_option_value.kind_of? Integer
options << storage_option_value
else
options << "\"#{storage_option_value}\""
Expand Down

0 comments on commit f44ad44

Please sign in to comment.