From 12d64338491b4d924911cd66b9e2c85dd56af358 Mon Sep 17 00:00:00 2001 From: takkanm Date: Sat, 12 Nov 2016 09:20:49 +0900 Subject: fix warning: constant ::Fixnum is deprecated fix Fixnum deprecated warning on Ruby2.4-preview3. Fixnum was unify into Integer. https://bugs.ruby-lang.org/issues/12005 --- lib/axlsx/drawing/pic.rb | 2 +- lib/axlsx/drawing/scaling.rb | 4 ++-- lib/axlsx/drawing/view_3D.rb | 4 ++-- lib/axlsx/util/simple_typed_list.rb | 2 +- lib/axlsx/util/validators.rb | 10 +++++----- lib/axlsx/workbook/worksheet/worksheet.rb | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index 275a6d06..5a418df0 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -53,7 +53,7 @@ module Axlsx attr_reader :hyperlink # Picture opacity - # @return [Fixnum] + # @return [Integer] attr_reader :opacity # sets or updates a hyperlink for this image. diff --git a/lib/axlsx/drawing/scaling.rb b/lib/axlsx/drawing/scaling.rb index fcbea9f8..4c9d6888 100644 --- a/lib/axlsx/drawing/scaling.rb +++ b/lib/axlsx/drawing/scaling.rb @@ -6,7 +6,7 @@ module Axlsx include Axlsx::OptionsParser # creates a new Scaling object - # @option options [Integer, Fixnum] logBase + # @option options [Integer] logBase # @option options [Symbol] orientation # @option options [Float] max # @option options [Float] min @@ -35,7 +35,7 @@ module Axlsx attr_reader :min # @see logBase - def logBase=(v) DataTypeValidator.validate "Scaling.logBase", [Integer, Fixnum], v, lambda { |arg| arg >= 2 && arg <= 1000}; @logBase = v; end + def logBase=(v) DataTypeValidator.validate "Scaling.logBase", [Integer], v, lambda { |arg| arg >= 2 && arg <= 1000}; @logBase = v; end # @see orientation def orientation=(v) RestrictionValidator.validate "Scaling.orientation", [:minMax, :maxMin], v; @orientation = v; end # @see max diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index 9c320b4a..55bbc6c3 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -86,12 +86,12 @@ module Axlsx alias :rAngAx= :r_ang_ax= # @see perspective - def perspective=(v) + def perspective=(v) RangeValidator.validate "View3D.perspective", 0, 240, v @perspective = v end - # DataTypeValidator.validate "#{self.class}.perspective", [Integer, Fixnum], v, lambda {|arg| arg >= 0 && arg <= 240 }; @perspective = v; end + # DataTypeValidator.validate "#{self.class}.perspective", [Integer], v, lambda {|arg| arg >= 0 && arg <= 240 }; @perspective = v; end # Serializes the object # @param [String] str diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb index 95f5b3f2..77bed775 100644 --- a/lib/axlsx/util/simple_typed_list.rb +++ b/lib/axlsx/util/simple_typed_list.rb @@ -147,7 +147,7 @@ module Axlsx # determines if the index is protected # @param [Integer] index def protected? index - return false unless locked_at.is_a? Fixnum + return false unless locked_at.is_a? Integer index < locked_at end diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index 9c6f34aa..2b4afd8d 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -80,16 +80,16 @@ module Axlsx end UINT_VALIDATOR = lambda { |arg| arg.respond_to?(:>=) && arg >= 0 } - - # Requires that the value is a Fixnum or Integer and is greater or equal to 0 + + # Requires that the value is a Integer and is greater or equal to 0 # @param [Any] v The value validated - # @raise [ArgumentError] raised if the value is not a Fixnum or Integer value greater or equal to 0 + # @raise [ArgumentError] raised if the value is not a Integer value greater or equal to 0 # @return [Boolean] true if the data is valid def self.validate_unsigned_int(v) DataTypeValidator.validate(:unsigned_int, Integer, v, UINT_VALIDATOR) end - # Requires that the value is a Fixnum Integer or Float and is greater or equal to 0 + # Requires that the value is a Integer or Float and is greater or equal to 0 # @param [Any] v The value validated # @raise [ArgumentError] raised if the value is not a Fixnun, Integer, Float value greater or equal to 0 # @return [Boolean] true if the data is valid @@ -104,7 +104,7 @@ module Axlsx end # Requires that the value is a form that can be evaluated as a boolean in an xml document. - # The value must be an instance of Fixnum, String, Integer, Symbol, TrueClass or FalseClass and + # The value must be an instance of String, Integer, Symbol, TrueClass or FalseClass and # it must be one of 0, 1, "true", "false", :true, :false, true, false, "0", or "1" # @param [Any] v The value validated def self.validate_boolean(v) diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 1d35b99d..6ef1a755 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -555,7 +555,7 @@ module Axlsx # @example This would set the first and third column widhts but leave the second column in autofit state. # ws.column_widths 7.2, nil, 3 # @note For updating only a single column it is probably easier to just set the width of the ws.column_info[col_index].width directly - # @param [Integer|Float|Fixnum|nil] widths + # @param [Integer|Float|nil] widths def column_widths(*widths) widths.each_with_index do |value, index| next if value == nil -- cgit v1.2.3