Skip to content

Commit 3f73978

Browse files
author
Kevin Paulisse
committed
Change fixnum -> integer everywhere
1 parent 47a9d2d commit 3f73978

File tree

17 files changed

+44
-38
lines changed

17 files changed

+44
-38
lines changed

doc/dev/integration-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe 'whatever behavior' do
2222
# @result[:logs] is a String containing everything printed to STDERR (Logger)
2323
# @result[:output] is a String containing everything printed to STDOUT
2424
# @result[:diffs] is an Array of differences
25-
# @result[:exitcode] is a Fixnum representing the exit code: 0 = no changes, 1 = failure, 2 = success, with changes
25+
# @result[:exitcode] is a Integer representing the exit code: 0 = no changes, 1 = failure, 2 = success, with changes
2626
# @result[:exception] contains any exception that was thrown
2727
end
2828

@@ -46,7 +46,7 @@ describe 'whatever behavior' do
4646
# @result[:logs] is a String containing everything printed to STDERR (Logger)
4747
# @result[:output] is a String containing everything printed to STDOUT
4848
# @result[:diffs] is an Array of differences
49-
# @result[:exitcode] is a Fixnum representing the exit code: 0 = no changes, 1 = failure, 2 = success, with changes
49+
# @result[:exitcode] is a Integer representing the exit code: 0 = no changes, 1 = failure, 2 = success, with changes
5050
# @result[:exception] contains any exception that was thrown
5151
end
5252

lib/octocatalog-diff/bootstrap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Bootstrap
1010
# @param options [Hash] Options hash:
1111
# :path [String] => Directory to bootstrap
1212
# :bootstrap_script [String] => Bootstrap script, relative to directory
13-
# @return [Hash] => [Fixnum] :status_code, [String] :output
13+
# @return [Hash] => [Integer] :status_code, [String] :output
1414
def self.bootstrap(options = {})
1515
# Options validation
1616
unless options[:path].is_a?(String)

lib/octocatalog-diff/catalog-diff/differ.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def hashdiff_initial(catalog1_in, catalog2_in)
533533

534534
# Added a new key that points to some kind of data structure that we know how
535535
# to handle.
536-
if obj[1] =~ /^(.+)\f([^\f]+)$/ && [String, Fixnum, Float, TrueClass, FalseClass, Array, Hash].include?(obj[2].class)
536+
if obj[1] =~ /^(.+)\f([^\f]+)$/ && [String, Integer, Float, TrueClass, FalseClass, Array, Hash].include?(obj[2].class)
537537
hashdiff_add_remove.add(obj[1])
538538
next
539539
end

lib/octocatalog-diff/catalog-diff/display/text.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def self.loc_string(loc, compilation_dir, logger)
255255
# Get the diff of two long strings. Call the 'diffy' gem for this.
256256
# @param string1 [String] First string (-)
257257
# @param string2 [String] Second string (+)
258-
# @param depth [Fixnum] Depth, for correct indentation
258+
# @param depth [Integer] Depth, for correct indentation
259259
# @return Array<String> Displayable result
260260
def self.diff_two_strings_with_diffy(string1, string2, depth)
261261
# Single line strings?
@@ -324,8 +324,8 @@ def self.make_trailing_whitespace_visible(string_in)
324324
# Get the diff of two hashes. Call the 'diffy' gem for this.
325325
# @param hash1 [Hash] First hash (-)
326326
# @param hash1 [Hash] Second hash (+)
327-
# @param depth [Fixnum] Depth, for correct indentation
328-
# @param limit [Fixnum] Maximum string length
327+
# @param depth [Integer] Depth, for correct indentation
328+
# @param limit [Integer] Maximum string length
329329
# @param strip_diff [Boolean] Strip leading +/-/" "
330330
# @return [Array<String>] Displayable result
331331
def self.diff_two_hashes_with_diffy(opts = {})
@@ -358,7 +358,7 @@ def self.diff_two_hashes_with_diffy(opts = {})
358358
end
359359

360360
# Special case: addition only, no truncation
361-
# @param depth [Fixnum] Depth, for correct indentation
361+
# @param depth [Integer] Depth, for correct indentation
362362
# @param hash [Hash] Added object
363363
# @return [Array<String>] Displayable result
364364
def self.addition_only_no_truncation(depth, hash)
@@ -383,7 +383,7 @@ def self.addition_only_no_truncation(depth, hash)
383383

384384
# Limit length of a string
385385
# @param str [String] String
386-
# @param limit [Fixnum] Limit (0=unlimited)
386+
# @param limit [Integer] Limit (0=unlimited)
387387
# @return [String] Truncated string
388388
def self.truncate_string(str, limit)
389389
return str if limit.nil? || str.length <= limit
@@ -392,7 +392,7 @@ def self.truncate_string(str, limit)
392392

393393
# Get the diff between two hashes. This is recursive-aware.
394394
# @param obj [diff object] diff object
395-
# @param depth [Fixnum] Depth of nesting, used for indentation
395+
# @param depth [Integer] Depth of nesting, used for indentation
396396
# @return Array<String> Printable diff outputs
397397
def self.hash_diff(obj, depth, key_in, nested = false)
398398
result = []
@@ -417,7 +417,7 @@ def self.hash_diff(obj, depth, key_in, nested = false)
417417
end
418418

419419
# Get the diff between two arbitrary objects
420-
# @param depth [Fixnum] Depth of nesting, used for indentation
420+
# @param depth [Integer] Depth of nesting, used for indentation
421421
# @param old_obj [?] Old object
422422
# @param new_obj [?] New object
423423
# @return Array<String> Diff output
@@ -432,7 +432,7 @@ def self.diff_at_depth(depth, old_obj, new_obj)
432432

433433
# Utility Method!
434434
# Indent a given text string with a certain number of spaces
435-
# @param spaces [Fixnum] Number of spaces
435+
# @param spaces [Integer] Number of spaces
436436
# @param text [String] Text
437437
def self.left_pad(spaces, text = '')
438438
[' ' * spaces, text].join('')
@@ -447,7 +447,7 @@ def self.left_pad(spaces, text = '')
447447
def self.stringify_for_diffy(obj)
448448
return JSON.pretty_generate(obj) if [Hash, Array].include?(obj.class)
449449
return '""' if obj.is_a?(String) && obj == ''
450-
return obj if [String, Fixnum, Float].include?(obj.class)
450+
return obj if [String, Integer, Float].include?(obj.class)
451451
"#{obj.class}: #{obj.inspect}"
452452
end
453453

@@ -512,8 +512,8 @@ def self._adjust_for_display_datatype(obj1, obj2, option, logger)
512512
return ['""', 'undef'] if obj2.nil?
513513

514514
# If one is an integer and the other is a string
515-
return [obj1, "\"#{obj2}\""] if obj1.is_a?(Fixnum) && obj2.is_a?(String)
516-
return ["\"#{obj1}\"", obj2] if obj1.is_a?(String) && obj2.is_a?(Fixnum)
515+
return [obj1, "\"#{obj2}\""] if obj1.is_a?(Integer) && obj2.is_a?(String)
516+
return ["\"#{obj1}\"", obj2] if obj1.is_a?(String) && obj2.is_a?(Integer)
517517

518518
# True and false
519519
return [obj1, "\"#{obj2}\""] if obj1.is_a?(TrueClass) && obj2.is_a?(String)

lib/octocatalog-diff/catalog-util/builddir.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class BuildDir
2121
# Constructor
2222
# Options for constructor:
2323
# :puppetdb_url [String] PuppetDB Server URLs
24-
# :puppetdb_server_url_timeout [Fixnum] Timeout (seconds) for puppetdb.conf
24+
# :puppetdb_server_url_timeout [Integer] Timeout (seconds) for puppetdb.conf
2525
# :facts [OctocatalogDiff::Facts] Facts object
2626
# :fact_file [String] File from which to read facts
2727
# :node [String] Node name
@@ -99,14 +99,14 @@ def create_symlinks(logger = nil)
9999

100100
# Install puppetdb.conf file in temporary directory
101101
# @param server_urls [String] String for server_urls in puppetdb.conf
102-
# @param server_url_timeout [Fixnum] Value for server_url_timeout in puppetdb.conf
102+
# @param server_url_timeout [Integer] Value for server_url_timeout in puppetdb.conf
103103
def install_puppetdb_conf(logger, server_urls, server_url_timeout = 30)
104104
unless server_urls.is_a?(String)
105105
raise ArgumentError, "server_urls must be a string, got a: #{server_urls.class}"
106106
end
107107

108108
server_url_timeout ||= 30 # If called with nil argument, supply default
109-
unless server_url_timeout.is_a?(Fixnum)
109+
unless server_url_timeout.is_a?(Integer)
110110
raise ArgumentError, "server_url_timeout must be a fixnum, got a: #{server_url_timeout.class}"
111111
end
112112

lib/octocatalog-diff/catalog-util/command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def override_and_append_commandline_with_user_supplied_arguments(cmdline)
167167
# the index.
168168
# @param cmdline [Array] Existing command line
169169
# @param key [String] Key to look up
170-
# @return [Fixnum] Index of where key is defined (nil if undefined)
170+
# @return [Integer] Index of where key is defined (nil if undefined)
171171
def key_position(cmdline, key)
172172
cmdline.index { |x| x == "--#{key}" || x =~ /\A--#{key}=/ }
173173
end

lib/octocatalog-diff/catalog/computed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Computed
2222
# @param :node [String] REQUIRED: Node name
2323
# @param :basedir [String] Directory in which to compile the catalog
2424
# @param :pass_env_vars [Array<String>] Environment variables to pass when compiling catalog
25-
# @param :retry_failed_catalog [Fixnum] Number of retries if a catalog compilation fails
25+
# @param :retry_failed_catalog [Integer] Number of retries if a catalog compilation fails
2626
# @param :tag [String] For display purposes, the catalog being compiled
2727
# @param :puppet_binary [String] Full path to Puppet
2828
# @param :puppet_version [String] Puppet version (optional; if not supplied, it is calculated)

lib/octocatalog-diff/catalog/puppetdb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PuppetDB
1515

1616
# Constructor - See OctocatalogDiff::PuppetDB for additional parameters
1717
# @param :node [String] Node name
18-
# @param :retry [Fixnum] Number of retries, if fetch fails
18+
# @param :retry [Integer] Number of retries, if fetch fails
1919
def initialize(options)
2020
raise ArgumentError, 'Hash of options must be passed to OctocatalogDiff::Catalog::PuppetDB' unless options.is_a?(Hash)
2121
raise ArgumentError, 'node must be a non-empty string' unless options[:node].is_a?(String) && options[:node] != ''

lib/octocatalog-diff/catalog/puppetmaster.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ class PuppetMaster
2222

2323
# Constructor
2424
# @param :node [String] Node name
25-
# @param :retry_failed_catalog [Fixnum] Number of retries, if fetch fails
25+
# @param :retry_failed_catalog [Integer] Number of retries, if fetch fails
2626
# @param :branch [String] Environment to fetch from Puppet Master
2727
# @param :puppet_master [String] Puppet server and port number (assumed to be DEFAULT_PUPPET_PORT_NUMBER if not given)
28-
# @param :puppet_master_api_version [Fixnum] Puppet server API (default DEFAULT_PUPPET_SERVER_API)
28+
# @param :puppet_master_api_version [Integer] Puppet server API (default DEFAULT_PUPPET_SERVER_API)
2929
# @param :puppet_master_ssl_ca [String] Path to file used to sign puppet master's certificate
3030
# @param :puppet_master_ssl_verify [Boolean] Override the CA verification setting guessed from parameters
3131
# @param :puppet_master_ssl_client_pem [String] PEM-encoded client key and certificate
3232
# @param :puppet_master_ssl_client_p12 [String] pkcs12-encoded client key and certificate
3333
# @param :puppet_master_ssl_client_password [String] Path to file containing password for SSL client key (any format)
3434
# @param :puppet_master_ssl_client_auth [Boolean] Override the client-auth that is guessed from parameters
35-
# @param :timeout [Fixnum] Connection timeout for Puppet master (default=PUPPET_MASTER_TIMEOUT seconds)
35+
# @param :timeout [Integer] Connection timeout for Puppet master (default=PUPPET_MASTER_TIMEOUT seconds)
3636
def initialize(options)
3737
raise ArgumentError, 'Hash of options must be passed to OctocatalogDiff::Catalog::PuppetMaster' unless options.is_a?(Hash)
3838
raise ArgumentError, 'node must be a non-empty string' unless options[:node].is_a?(String) && options[:node] != ''

lib/octocatalog-diff/cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Cli
5050
# @param argv [Array] Use specified arguments (defaults to ARGV)
5151
# @param logger [Logger] Logger object
5252
# @param opts [Hash] Additional options
53-
# @return [Fixnum] Exit code: 0=no diffs, 1=something went wrong, 2=worked but there are diffs
53+
# @return [Integer] Exit code: 0=no diffs, 1=something went wrong, 2=worked but there are diffs
5454
def self.cli(argv = ARGV, logger = Logger.new(STDERR), opts = {})
5555
# Save a copy of argv to print out later in debugging
5656
argv_save = argv.dup

0 commit comments

Comments
 (0)