Skip to content

Commit

Permalink
Ruby 2.4 : use Integer in place of Fixnum
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Wininger <[email protected]>
  • Loading branch information
fwininger committed Jan 23, 2017
1 parent 18f934e commit a4ab853
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions lib/winrm/connection_opts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ def validate_required_fields
end

def validate_data_types
validate_fixnum(:retry_limit)
validate_fixnum(:retry_delay)
validate_fixnum(:max_envelope_size)
validate_fixnum(:operation_timeout)
validate_fixnum(:receive_timeout, self[:operation_timeout])
validate_integer(:retry_limit)
validate_integer(:retry_delay)
validate_integer(:max_envelope_size)
validate_integer(:operation_timeout)
validate_integer(:receive_timeout, self[:operation_timeout])
end

def validate_fixnum(key, min = 0)
def validate_integer(key, min = 0)
value = self[key]
raise "#{key} must be a Fixnum" unless value && value.is_a?(Fixnum)
raise "#{key} must be a Integer" unless value && value.is_a?(Integer)
raise "#{key} must be greater than #{min}" unless value > min
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/winrm/psrp/fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module PSRP
# PowerShell Remoting Protocol message fragment.
class Fragment
# Creates a new PSRP message fragment
# @param object_id [Fixnum] The id of the fragmented message.
# @param object_id [Integer] The id of the fragmented message.
# @param blob [Array] Array of fragmented bytes.
# @param fragment_id [Fixnum] The id of this fragment
# @param fragment_id [Integer] The id of this fragment
# @param start_fragment [Boolean] If the fragment is the first fragment
# @param end_fragment [Boolean] If the fragment is the last fragment
def initialize(object_id, blob, fragment_id = 0, start_fragment = true, end_fragment = true)
Expand Down
4 changes: 2 additions & 2 deletions lib/winrm/psrp/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class Message
# Creates a new PSRP message instance
# @param runspace_pool_id [String] The UUID of the remote shell/runspace pool.
# @param pipeline_id [String] The UUID to correlate the command/pipeline response
# @param type [Fixnum] The PSRP MessageType. This is most commonly
# @param type [Integer] The PSRP MessageType. This is most commonly
# specified in hex, e.g. 0x00010002.
# @param data [String] The PSRP payload as serialized XML
# @param destination [Fixnum] The destination for this message - client or server
# @param destination [Integer] The destination for this message - client or server
def initialize(
runspace_pool_id,
type,
Expand Down
4 changes: 2 additions & 2 deletions lib/winrm/shells/retryable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ module Retryable
end

# Retries the operation a specified number of times with a delay between
# @param retries [Fixnum] The number of times to retry
# @param delay [Fixnum] The number of seconds to wait between retry attempts
# @param retries [Integer] The number of times to retry
# @param delay [Integer] The number of seconds to wait between retry attempts
def retryable(retries, delay)
yield
rescue *RETRYABLE_EXCEPTIONS.call
Expand Down
2 changes: 1 addition & 1 deletion lib/winrm/wsmv/iso8601_duration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module WSMV
module Iso8601Duration
# Convert the number of seconds to an ISO8601 duration format
# @see http://tools.ietf.org/html/rfc2445#section-4.3.6
# @param [Fixnum] seconds The amount of seconds for this duration
# @param [Integer] seconds The amount of seconds for this duration
def self.sec_to_dur(seconds)
seconds = seconds.to_i
iso_str = 'P'
Expand Down

0 comments on commit a4ab853

Please sign in to comment.