diff --git a/.ruby-version b/.ruby-version index 2bf1c1ccf..0bee604df 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.3.3 diff --git a/.travis.yml b/.travis.yml index e52f4ec76..5f031cd08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: ruby rvm: - - 2.3.1 + - 2.3.3 + - 2.4.3 cache: bundler script: 'bundle exec rake' sudo: false diff --git a/docs/dsl/by_method/bind.md b/docs/dsl/by_method/bind.md index 97dc8b9d5..7ab082d41 100644 --- a/docs/dsl/by_method/bind.md +++ b/docs/dsl/by_method/bind.md @@ -8,11 +8,11 @@ the passed block. later. @param options [Hash void>] The options to register the event with. -@option options :delay [Fixnum|Float] Limits the execution +@option options :delay [Integer|Float] Limits the execution of the triggered event to only execute when first triggered, with subsequent triggering being ignored until the delay has expired. -@option options :debounce [Fixnum|Float] Limits the +@option options :debounce [Integer|Float] Limits the execution of the triggered event to only execute once the debounce has expired. Subsequent triggers before debounce expiry are ignored. diff --git a/lib/vedeu/borders/caption.rb b/lib/vedeu/borders/caption.rb index 94ae7497d..bb063e3f7 100644 --- a/lib/vedeu/borders/caption.rb +++ b/lib/vedeu/borders/caption.rb @@ -17,13 +17,13 @@ class Caption < Vedeu::Borders::Title private - # @return [Fixnum] + # @return [Integer] # @see Vedeu::Borders::Title#start_index def start_index (width - size) - 1 end - # @return [Fixnum] + # @return [Integer] # @see Vedeu::Borders::Title#y def y geometry.yn diff --git a/lib/vedeu/borders/refresh.rb b/lib/vedeu/borders/refresh.rb index 383d92f53..393b7e118 100644 --- a/lib/vedeu/borders/refresh.rb +++ b/lib/vedeu/borders/refresh.rb @@ -201,7 +201,7 @@ def titlebar # Build a collection with the given size of objects given within # the block. # - # @param size [Fixnum] + # @param size [Integer] # @macro param_block # @return [Array] def build_collection(size, &block) diff --git a/lib/vedeu/borders/title.rb b/lib/vedeu/borders/title.rb index 886a3b5ad..2ecf95f6a 100644 --- a/lib/vedeu/borders/title.rb +++ b/lib/vedeu/borders/title.rb @@ -88,7 +88,7 @@ def value private # @param char [String] - # @param x [Fixnum] + # @param x [Integer] # @return [Hash void>] def attributes(char, x) border.attributes.merge(position: Vedeu::Geometries::Position.new(y, x), @@ -121,7 +121,7 @@ def empty? value.empty? end - # @return [Fixnum] + # @return [Integer] def end_index start_index + (size - 1) end @@ -149,7 +149,7 @@ def pad # Return the size of the padded, truncated value. # - # @return [Fixnum] + # @return [Integer] def size pad.size end @@ -158,7 +158,7 @@ def size # title (or caption) should start. The title will appear # top-left, whilst the caption will be justified bottom-right. # - # @return [Fixnum] + # @return [Integer] def start_index 1 end @@ -183,19 +183,19 @@ def truncate # Return the size of the horizontal border given. # - # @return [Fixnum] + # @return [Integer] def width horizontal.size end - # @return [Fixnum] + # @return [Integer] def x geometry.bx + start_index end # Return the vertical position for the title (or caption). # - # @return [Fixnum] + # @return [Integer] def y geometry.y end diff --git a/lib/vedeu/buffers/buffer.rb b/lib/vedeu/buffers/buffer.rb index 55835f6c3..4dc36ab26 100644 --- a/lib/vedeu/buffers/buffer.rb +++ b/lib/vedeu/buffers/buffer.rb @@ -145,7 +145,7 @@ def render # Returns the number of lines of content for the buffer or 0 if # the buffer is empty. # - # @return [Fixnum] + # @return [Integer] def size if back? back.lines.size diff --git a/lib/vedeu/buffers/clear.rb b/lib/vedeu/buffers/clear.rb index 7d3a427a4..0f976da6a 100644 --- a/lib/vedeu/buffers/clear.rb +++ b/lib/vedeu/buffers/clear.rb @@ -22,12 +22,12 @@ def buffer @buffer ||= clear end - # @return [Fixnum] + # @return [Integer] def height @height + 1 end - # @return [Fixnum] + # @return [Integer] def width @width + 1 end diff --git a/lib/vedeu/buffers/empty.rb b/lib/vedeu/buffers/empty.rb index 2aa50303f..6c043b103 100644 --- a/lib/vedeu/buffers/empty.rb +++ b/lib/vedeu/buffers/empty.rb @@ -18,11 +18,11 @@ class Empty attr_reader :name # @!attribute [r] x - # @return [Fixnum] + # @return [Integer] attr_reader :x # @!attribute [r] y - # @return [Fixnum] + # @return [Integer] attr_reader :y # @return [Array>] @@ -30,12 +30,12 @@ def buffer @buffer ||= empty end - # @return [Fixnum] + # @return [Integer] def height @height + 1 end - # @return [Fixnum] + # @return [Integer] def width @width + 1 end diff --git a/lib/vedeu/buffers/view.rb b/lib/vedeu/buffers/view.rb index 7b9bdd727..0932a4fc1 100644 --- a/lib/vedeu/buffers/view.rb +++ b/lib/vedeu/buffers/view.rb @@ -64,7 +64,7 @@ def update(value_or_values) private # @param value [void] - # @return [Fixnum] + # @return [Integer] def column(value) Vedeu::Point.coerce(value: value.position.x, min: bx, max: bxn).value end @@ -91,7 +91,7 @@ def geometry end # @param value [void] - # @return [Fixnum] + # @return [Integer] def row(value) Vedeu::Point.coerce(value: value.position.y, min: by, max: byn).value end diff --git a/lib/vedeu/colours/translator.rb b/lib/vedeu/colours/translator.rb index a9f7416dc..ad97c5c88 100644 --- a/lib/vedeu/colours/translator.rb +++ b/lib/vedeu/colours/translator.rb @@ -58,7 +58,7 @@ def self.coerce(value) # Return a new instance of Vedeu::Colours::Translator. # - # @param colour [Fixnum|String|Symbol] + # @param colour [Integer|String|Symbol] # @return [Vedeu::Colours::Translator] def initialize(colour = '') @colour = colour || '' @@ -186,7 +186,7 @@ def css_to_rgb ] end - # @return [Fixnum] + # @return [Integer] def css_to_numbered [16, red, green, blue].inject(:+) end @@ -194,7 +194,7 @@ def css_to_numbered # Takes the red component of {#css_to_rgb} and converts to the # correct value for setting the terminal red value. # - # @return [Fixnum] + # @return [Integer] def red (css_to_rgb[0] / 51) * 36 end @@ -202,7 +202,7 @@ def red # Takes the green component of {#css_to_rgb} and converts to the # correct value for setting the terminal green value. # - # @return [Fixnum] + # @return [Integer] def green (css_to_rgb[1] / 51) * 6 end @@ -210,7 +210,7 @@ def green # Takes the blue component of {#css_to_rgb} and converts to the # correct value for setting the terminal blue value. # - # @return [Fixnum] + # @return [Integer] def blue (css_to_rgb[2] / 51) * 1 end diff --git a/lib/vedeu/common.rb b/lib/vedeu/common.rb index 0ae9ffaf8..20d0a6abe 100644 --- a/lib/vedeu/common.rb +++ b/lib/vedeu/common.rb @@ -11,7 +11,7 @@ module Common # Returns a boolean indicating whether a variable is nil, false or # empty. # - # @param variable [String|Symbol|Array|Fixnum] The variable to + # @param variable [String|Symbol|Array|Integer] The variable to # check. # @return [Boolean] def absent?(variable) @@ -94,12 +94,12 @@ def line_model? end end - # Returns a boolean indicating whether the value is a Fixnum. + # Returns a boolean indicating whether the value is a Integer. # - # @param value [Fixnum|void] + # @param value [Integer|void] # @return [Boolean] def numeric?(value) - value.is_a?(Fixnum) || value == Float::INFINITY + value.is_a?(Integer) || value == Float::INFINITY end alias fixnum? numeric? @@ -116,7 +116,7 @@ def positionable?(value) # Returns a boolean indicating whether a variable has a useful # value. # - # @param variable [String|Symbol|Array|Fixnum] The variable to + # @param variable [String|Symbol|Array|Integer] The variable to # check. # @return [Boolean] def present?(variable) diff --git a/lib/vedeu/configuration/api.rb b/lib/vedeu/configuration/api.rb index 31fae5de0..6486b61ce 100644 --- a/lib/vedeu/configuration/api.rb +++ b/lib/vedeu/configuration/api.rb @@ -64,7 +64,7 @@ def colour(attrs = {}) end # {include:file:docs/configuration/colour_mode.md} - # @param value [Fixnum] + # @param value [Integer] # @macro raise_invalid_syntax # @return [Boolean] def colour_mode(value = nil) @@ -86,7 +86,7 @@ def compression(value = true) # Returns the configuration options set up by the API DSL. # - # @return [Hash Boolean, Fixnum, String>] + # @return [Hash Boolean, Integer, String>] def configuration if options[:log].nil? || options[:log] == false || @@ -130,8 +130,8 @@ def drb!(value = true) alias drb drb! # {include:file:docs/configuration/drb_height.md} - # @param height [Fixnum] - # @return [Fixnum] + # @param height [Integer] + # @return [Integer] def drb_height(height = 25) options[:drb_height] = height end @@ -144,15 +144,15 @@ def drb_host(hostname = '') end # {include:file:docs/configuration/drb_port.md} - # @param port [Fixnum|String] + # @param port [Integer|String] # @return [String] def drb_port(port = '') options[:drb_port] = port end # {include:file:docs/configuration/drb_width.md} - # @param width [Fixnum] - # @return [Fixnum] + # @param width [Integer] + # @return [Integer] def drb_width(width = 80) options[:drb_width] = width end @@ -174,8 +174,8 @@ def foreground(value = nil) end # {include:file:docs/configuration/height.md} - # @param height [Fixnum] - # @return [Fixnum] + # @param height [Integer] + # @return [Integer] def height(height = 25) options[:height] = height end @@ -318,8 +318,8 @@ def threaded(boolean) alias threaded= threaded # {include:file:docs/configuration/width.md} - # @param width [Fixnum] - # @return [Fixnum] + # @param width [Integer] + # @return [Integer] def width(width = 80) options[:width] = width end @@ -357,7 +357,7 @@ def options # Checks that the value provided to {#colour_mode} is valid. # - # @param value [Fixnum] + # @param value [Integer] # @return [Boolean] def valid_colour_mode?(value) numeric?(value) && [8, 16, 256, 16_777_216].include?(value) diff --git a/lib/vedeu/configuration/configuration.rb b/lib/vedeu/configuration/configuration.rb index 13ac48a04..0dfa40571 100644 --- a/lib/vedeu/configuration/configuration.rb +++ b/lib/vedeu/configuration/configuration.rb @@ -113,7 +113,7 @@ def colour # Returns the chosen colour mode. # - # @return [Fixnum] + # @return [Integer] def colour_mode instance.options[:colour_mode] end @@ -153,14 +153,14 @@ def drb_port # Returns the height for the fake terminal in the DRb server. # - # @return [Fixnum] + # @return [Integer] def drb_height instance.options[:drb_height] end # Returns the width for the fake terminal in the DRb server. # - # @return [Fixnum] + # @return [Integer] def drb_width instance.options[:drb_width] end @@ -175,7 +175,7 @@ def foreground # # {include:file:docs/dsl/by_method/height.md} # - # @return [Fixnum] + # @return [Integer] def height if drb? drb_height @@ -340,7 +340,7 @@ def threaded? # # {include:file:docs/dsl/by_method/width.md} # - # @return [Fixnum] + # @return [Integer] def width if drb? drb_width @@ -446,7 +446,7 @@ def defaults # environment variable, or be optimistic and settle for 256 # colours. # - # @return [Fixnum] + # @return [Integer] def detect_colour_mode case ENV['TERM'] when 'xterm-256color', 'screen-256color' diff --git a/lib/vedeu/cursors/coordinate.rb b/lib/vedeu/cursors/coordinate.rb index ea1b79dc0..d52dae5da 100644 --- a/lib/vedeu/cursors/coordinate.rb +++ b/lib/vedeu/cursors/coordinate.rb @@ -20,10 +20,10 @@ class Coordinate # Return a new instance of Vedeu::Cursors::Coordinate. # - # @param attributes [Hash Fixnum|String|Symbol>] + # @param attributes [Hash Integer|String|Symbol>] # @option attributes geometry [Vedeu::Geometries::Geometry] # @option attributes type [Symbol] - # @option attributes offset [Fixnum] + # @option attributes offset [Integer] # @return [Vedeu::Cursors::Coordinate] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| @@ -38,7 +38,7 @@ def initialize(attributes = {}) # # d_dn = 4 # represents width or height # dn # => 6 # - # @return [Fixnum] + # @return [Integer] def dn_position return 0 if d_dn <= 0 @@ -56,7 +56,7 @@ def dn_position # position(2) # => 6 # position(15) # => 13 # - # @return [Fixnum] + # @return [Integer] def d_position Vedeu::Point.coerce(value: position, min: bd, max: bdn).value end @@ -70,7 +70,7 @@ def d_position attr_reader :geometry # @!attribute [r] offset - # @return [Fixnum] + # @return [Integer] attr_reader :offset # @!attribute [r] type @@ -97,7 +97,7 @@ def coordinate # # d_dn = 3 # dn_index # => 2 # - # @return [Fixnum] + # @return [Integer] def dn_index return 0 if d_dn < 1 @@ -128,7 +128,7 @@ def defaults # Return the position respective of the offset. # - # @return [Fixnum] + # @return [Integer] def position if offset <= 0 d diff --git a/lib/vedeu/cursors/cursor.rb b/lib/vedeu/cursors/cursor.rb index 5f8a56f9c..caded50f9 100644 --- a/lib/vedeu/cursors/cursor.rb +++ b/lib/vedeu/cursors/cursor.rb @@ -26,36 +26,36 @@ class Cursor attr_reader :name # @!attribute [w] ox - # @return [Fixnum] + # @return [Integer] attr_writer :ox # @!attribute [w] oy - # @return [Fixnum] + # @return [Integer] attr_writer :oy # @!attribute [w] x - # @return [Fixnum] + # @return [Integer] attr_writer :x # @!attribute [w] y - # @return [Fixnum] + # @return [Integer] attr_writer :y # Returns a new instance of Vedeu::Cursors::Cursor. # - # @param attributes [Hash Boolean|Fixnum|String| + # @param attributes [Hash Boolean|Integer|String| # Vedeu::Cursors::Repository>] # @option attributes name [String|Symbol] The name of the # interface this cursor belongs to. - # @option attributes ox [Fixnum] The offset x coordinate. - # @option attributes oy [Fixnum] The offset y coordinate. + # @option attributes ox [Integer] The offset x coordinate. + # @option attributes oy [Integer] The offset y coordinate. # @option attributes repository # [Vedeu::Repositories::Repository] # @option attributes visible [Boolean] The visibility of the # cursor. - # @option attributes x [Fixnum] The terminal x coordinate for + # @option attributes x [Integer] The terminal x coordinate for # the cursor. - # @option attributes y [Fixnum] The terminal y coordinate for + # @option attributes y [Integer] The terminal y coordinate for # the cursor. # @return [Vedeu::Cursors::Cursor] def initialize(attributes = {}) @@ -64,7 +64,7 @@ def initialize(attributes = {}) end end - # @return [Hash Boolean|Fixnum|String| + # @return [Hash Boolean|Integer|String| # Vedeu::Cursors::Repository>] def attributes { @@ -147,7 +147,7 @@ def render Vedeu.render_output(escape_sequence) end - # @return [Array] + # @return [Array] def to_a position.to_a end @@ -175,12 +175,12 @@ def hide render end - # @return [Fixnum] + # @return [Integer] def ox @ox = @ox < 1 ? 1 : @ox end - # @return [Fixnum] + # @return [Integer] def oy @oy = @oy < 1 ? 1 : @oy end @@ -202,12 +202,12 @@ def show render end - # @return [Fixnum] The column/character coordinate. + # @return [Integer] The column/character coordinate. def x @x = Vedeu::Point.coerce(value: @x, min: bx, max: bxn).value end - # @return [Fixnum] The row/line coordinate. + # @return [Integer] The row/line coordinate. def y @y = Vedeu::Point.coerce(value: @y, min: by, max: byn).value end diff --git a/lib/vedeu/cursors/move.rb b/lib/vedeu/cursors/move.rb index 1f1c913c4..df1d505e2 100644 --- a/lib/vedeu/cursors/move.rb +++ b/lib/vedeu/cursors/move.rb @@ -24,7 +24,7 @@ def self.move(name, direction, offset) # @macro param_name # @param direction [Symbol] - # @param offset [Fixnum] + # @param offset [Integer] # @return [Vedeu::Cursors::Move] def initialize(name, direction, offset) @name = name diff --git a/lib/vedeu/cursors/reposition.rb b/lib/vedeu/cursors/reposition.rb index 9adc04e64..44f6f37f2 100644 --- a/lib/vedeu/cursors/reposition.rb +++ b/lib/vedeu/cursors/reposition.rb @@ -12,13 +12,13 @@ class Reposition # Returns a new instance of Vedeu::Cursors::Reposition. # - # @param attributes [Hash Fixnum|Symbol|String] + # @param attributes [Hash Integer|Symbol|String] # @option attributes mode [Symbol] One of either :absolute or # :relative. Relates to the coordinates provided. # @option attributes name [String|Symbol] The name of the cursor # and related interface/view. - # @option attributes x [Fixnum] The new row/line position. - # @option attributes y [Fixnum] The new column/character + # @option attributes x [Integer] The new row/line position. + # @option attributes y [Integer] The new column/character # position. # @return [Vedeu::Cursors::Reposition] def initialize(attributes = {}) @@ -41,16 +41,16 @@ def reposition attr_reader :name # @!attribute [r] x - # @return [Fixnum] + # @return [Integer] attr_reader :x # @!attribute [r] y - # @return [Fixnum] + # @return [Integer] attr_reader :y private - # @return [Hash Fixnum>] + # @return [Hash Integer>] def absolute { x: coordinate((x - geometry.x), :x).x, @@ -67,7 +67,7 @@ def absolute? # Determine correct x and y related coordinates. # - # @param offset [Fixnum] + # @param offset [Integer] # @param type [Symbol] # @return [Vedeu::Cursors::Coordinate] def coordinate(offset, type) @@ -125,7 +125,7 @@ def modes [:relative, :absolute] end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def new_attributes if absolute? && inside_geometry? cursor.attributes.merge!(absolute) @@ -139,7 +139,7 @@ def new_attributes end end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def relative { x: coordinate(x, :x).x, diff --git a/lib/vedeu/distributed/server.rb b/lib/vedeu/distributed/server.rb index 3e22efa44..ab89485bf 100644 --- a/lib/vedeu/distributed/server.rb +++ b/lib/vedeu/distributed/server.rb @@ -85,7 +85,7 @@ def output end alias write output - # @return [Fixnum] The PID of the currently running application. + # @return [Integer] The PID of the currently running application. def pid Process.pid end diff --git a/lib/vedeu/distributed/subprocess.rb b/lib/vedeu/distributed/subprocess.rb index 6998b69fd..9b603f1fd 100644 --- a/lib/vedeu/distributed/subprocess.rb +++ b/lib/vedeu/distributed/subprocess.rb @@ -53,7 +53,7 @@ def kill attr_reader :application # @!attribute [r] pid - # @return [Fixnum] + # @return [Integer] attr_reader :pid private @@ -63,7 +63,7 @@ def command "ruby #{file_path}" end - # @return [Fixnum] The number of bytes written. + # @return [Integer] The number of bytes written. def file_write file.write(application) end @@ -73,7 +73,7 @@ def file_close file.close end - # @return [Fixnum] The number of files removed; 1. + # @return [Integer] The number of files removed; 1. def file_unlink File.unlink(file_name) end @@ -94,7 +94,7 @@ def file_name Dir.tmpdir + "/foo_#{timestamp}" end - # return [Fixnum] + # return [Integer] def timestamp @timestamp ||= Time.now.to_i end diff --git a/lib/vedeu/distributed/uri.rb b/lib/vedeu/distributed/uri.rb index 94e00e026..1a15dbb08 100644 --- a/lib/vedeu/distributed/uri.rb +++ b/lib/vedeu/distributed/uri.rb @@ -19,13 +19,13 @@ class Uri attr_reader :host # @!attribute [r] port - # @return [Fixnum|String] + # @return [Integer|String] attr_reader :port # Returns a new instance of Vedeu::Distributed::Uri. # # @param host [String] Hostname or IP address. - # @param port [Fixnum|String] + # @param port [Integer|String] # @return [Vedeu::Distributed::Uri] def initialize(host = 'localhost', port = 21_420) @host = host || 'localhost' diff --git a/lib/vedeu/dsl/helpers/align.rb b/lib/vedeu/dsl/helpers/align.rb index 50ec5393e..8fc122e1b 100644 --- a/lib/vedeu/dsl/helpers/align.rb +++ b/lib/vedeu/dsl/helpers/align.rb @@ -24,7 +24,7 @@ class Align # @option options align [Symbol] # @option options name [String|Symbol] # @option options pad [String] - # @option options width [Fixnum] + # @option options width [Integer] # @return [Vedeu::DSL::Align] def initialize(value = '', options = {}) @value = value || '' @@ -117,7 +117,7 @@ def right # Return the width of the interface when a name is given, # otherwise use the given width. # - # @return [Fixnum] + # @return [Integer] def width if present?(options[:width]) options[:width] diff --git a/lib/vedeu/dsl/helpers/attributes.rb b/lib/vedeu/dsl/helpers/attributes.rb index 8139a90e3..34942905b 100644 --- a/lib/vedeu/dsl/helpers/attributes.rb +++ b/lib/vedeu/dsl/helpers/attributes.rb @@ -40,7 +40,7 @@ def self.build(context = nil, # Hash Array|Symbol>|Symbol] The style. # @option options truncate [Boolean] Whether the value should be # truncated. - # @option options width [Fixnum] The desired width for the + # @option options width [Integer] The desired width for the # value. # @option options wordwrap [Boolean] Whether the value should be # wordwrapped. @@ -180,7 +180,7 @@ def value end end - # @return [Fixnum|NilClass] + # @return [Integer|NilClass] def width if numeric?(options[:width]) options[:width] diff --git a/lib/vedeu/dsl/helpers/truncate.rb b/lib/vedeu/dsl/helpers/truncate.rb index 1236266cd..ed4d07034 100644 --- a/lib/vedeu/dsl/helpers/truncate.rb +++ b/lib/vedeu/dsl/helpers/truncate.rb @@ -16,14 +16,14 @@ class Truncate # Returns a new instance of Vedeu::DSL::Truncate. # # @param value [String] - # @param options [Hash Boolean|Fixnum|NilClass|String| + # @param options [Hash Boolean|Integer|NilClass|String| # Symbol] # @option options name [String|Symbol] The name of the geometry # to use to determine the width if the width option is not # given. # @option options truncate [Boolean] Whether to truncate the # value. - # @option options width [Fixnum] The width of the new value. + # @option options width [Integer] The width of the new value. # @return [Vedeu::DSL::Truncate] def initialize(value = '', options = {}) @value = value || '' @@ -44,7 +44,7 @@ def text protected # @!attribute [r] options - # @return [Hash Boolean|Fixnum|NilClass|String| + # @return [Hash Boolean|Integer|NilClass|String| # Symbol] attr_reader :options @@ -91,7 +91,7 @@ def value # Return the width of the interface when a name is given, # otherwise use the given width. # - # @return [Fixnum] + # @return [Integer] def width if present?(options[:width]) options[:width] diff --git a/lib/vedeu/dsl/helpers/wordwrap.rb b/lib/vedeu/dsl/helpers/wordwrap.rb index 2489a993c..4684e4e1f 100644 --- a/lib/vedeu/dsl/helpers/wordwrap.rb +++ b/lib/vedeu/dsl/helpers/wordwrap.rb @@ -26,7 +26,7 @@ def self.for(text, options = {}) # @option options ellipsis [String] See {#ellipsis}. # @option options mode [Symbol] See {#mode}. # @option options name [String|Symbol] See {#name}. - # @option options width [Fixnum] See {#width}. + # @option options width [Integer] See {#width}. # @return [Vedeu::DSL::Wordwrap] def initialize(text, options = {}) @text = text @@ -131,7 +131,7 @@ def prune_string(string) # Returns the width of the string minus the ellipsis. # - # @return [Fixnum] + # @return [Integer] def pruned_width width - ellipsis.size end @@ -182,7 +182,7 @@ def registered? # Returns the width to prune or wrap to. # # @macro raise_missing_required - # @return [Fixnum] + # @return [Integer] def width return options[:width] if present?(options[:width]) return geometry.width if registered? diff --git a/lib/vedeu/editor/collection.rb b/lib/vedeu/editor/collection.rb index ffd43cb6a..97b5f0100 100644 --- a/lib/vedeu/editor/collection.rb +++ b/lib/vedeu/editor/collection.rb @@ -15,7 +15,7 @@ module Collection # Fetches an item from a collection. # - # @param index [Fixnum] + # @param index [Integer] # @return [String] def by_index(index) Vedeu::Editor::Item.by_index(collection, index) diff --git a/lib/vedeu/editor/cropper.rb b/lib/vedeu/editor/cropper.rb index 93a207330..84d800bfb 100644 --- a/lib/vedeu/editor/cropper.rb +++ b/lib/vedeu/editor/cropper.rb @@ -26,8 +26,8 @@ class Cropper # # @param lines [Vedeu::Editor::Lines] # @macro param_name - # @param ox [Fixnum] - # @param oy [Fixnum] + # @param ox [Integer] + # @param oy [Integer] # @return [Vedeu::Editor::Cropper] def initialize(lines:, ox:, oy:, name:) @lines = lines @@ -68,11 +68,11 @@ def to_a attr_reader :name # @!attribute [r] ox - # @return [Fixnum] + # @return [Integer] attr_reader :ox # @!attribute [r] oy - # @return [Fixnum] + # @return [Integer] attr_reader :oy private diff --git a/lib/vedeu/editor/cursor.rb b/lib/vedeu/editor/cursor.rb index 7c44a4a20..31f9007fb 100644 --- a/lib/vedeu/editor/cursor.rb +++ b/lib/vedeu/editor/cursor.rb @@ -24,30 +24,30 @@ class Cursor attr_reader :name # @!attribute [rw] ox - # @return [Fixnum] + # @return [Integer] attr_accessor :ox # @!attribute [rw] oy - # @return [Fixnum] + # @return [Integer] attr_accessor :oy # @!attribute [rw] x - # @return [Fixnum] + # @return [Integer] attr_writer :x # @!attribute [rw] y - # @return [Fixnum] + # @return [Integer] attr_writer :y # Returns a new instance of Vedeu::Editor::Cursor. # - # @param attributes [Hash Fixnum|String|Symbol>] - # @option attributes y [Fixnum] The current line. - # @option attributes x [Fixnum] The current character within the + # @param attributes [Hash Integer|String|Symbol>] + # @option attributes y [Integer] The current line. + # @option attributes x [Integer] The current character within the # line. # @option attributes name [String|Symbol] - # @option attributes oy [Fixnum] - # @option attributes ox [Fixnum] + # @option attributes oy [Integer] + # @option attributes ox [Integer] # @return [Vedeu::Editor::Cursor] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| @@ -67,7 +67,7 @@ def bol # Move the virtual cursor down by one line. # - # @param size [Fixnum] The number of characters on the next + # @param size [Integer] The number of characters on the next # line. The cursor is placed at the end of this next line if # the x coordinate is greater than the next line length. # @return [Vedeu::Editor::Cursor] @@ -134,7 +134,7 @@ def to_s # Move the virtual cursor up by one line. # - # @param size [Fixnum] The number of characters on the next + # @param size [Integer] The number of characters on the next # line. The cursor is placed at the end of this next line if # the x coordinate is greater than the next line length. # @return [Vedeu::Editor::Cursor] @@ -146,7 +146,7 @@ def up(size = nil) self end - # @return [Fixnum] The column/character coordinate. + # @return [Integer] The column/character coordinate. def x @x = 0 if @x <= 0 @ox = @x - (bxn - bx) if @x > bxn - bx @@ -154,7 +154,7 @@ def x @x end - # @return [Fixnum] The row/line coordinate. + # @return [Integer] The row/line coordinate. def y @y = 0 if @y <= 0 @oy = @y - (byn - by) if @y > byn - by @@ -182,19 +182,19 @@ def defaults # Return the real y coordinate. # - # @return [Fixnum] + # @return [Integer] def real_y (by + y) - oy end # Return the real x coordinate. # - # @return [Fixnum] + # @return [Integer] def real_x (bx + x) - ox end - # @return [Hash Fixnum, String, Symbol>] + # @return [Hash Integer, String, Symbol>] def new_attributes { name: name, diff --git a/lib/vedeu/editor/delete.rb b/lib/vedeu/editor/delete.rb index d33ae7848..c0d24afbe 100644 --- a/lib/vedeu/editor/delete.rb +++ b/lib/vedeu/editor/delete.rb @@ -21,8 +21,8 @@ def self.from(collection, index = nil, size = 0) # Returns a new instance of Vedeu::Editor::Delete. # # @param collection [Vedeu::Editor::Line|Vedeu::Editor::Lines] - # @param index [Fixnum] - # @param size [Fixnum] + # @param index [Integer] + # @param size [Integer] # @return [Vedeu::Editor::Delete] def initialize(collection, index = nil, size = 0) @collection = collection @@ -45,12 +45,12 @@ def delete attr_reader :collection # @!attribute [r] size - # @return [Fixnum] + # @return [Integer] attr_reader :size private - # @return [Fixnum] + # @return [Integer] def index return nil unless @index diff --git a/lib/vedeu/editor/document.rb b/lib/vedeu/editor/document.rb index 57ee6ff1a..10b7f86b7 100644 --- a/lib/vedeu/editor/document.rb +++ b/lib/vedeu/editor/document.rb @@ -114,7 +114,7 @@ def insert_line # Returns the current line from the collection of lines. # - # @param index [Fixnum] + # @param index [Integer] # @return [Array] def line(index = y) lines.line(index) @@ -245,7 +245,7 @@ def last_line? y + 1 >= lines.size end - # @return [Fixnum] + # @return [Integer] def next_line_size line(y + 1).size end @@ -263,7 +263,7 @@ def output oy: oy).viewport end - # @return [Fixnum] + # @return [Integer] def prev_line_size line(y - 1).size end diff --git a/lib/vedeu/editor/insert.rb b/lib/vedeu/editor/insert.rb index 1dc931ddb..3a7720add 100644 --- a/lib/vedeu/editor/insert.rb +++ b/lib/vedeu/editor/insert.rb @@ -22,8 +22,8 @@ def self.into(collection, entity, index = nil, size = 0) # # @param collection [String|Vedeu::Editor::Line|Vedeu::Editor::Lines] # @param entity [String] - # @param index [Fixnum] - # @param size [Fixnum] + # @param index [Integer] + # @param size [Integer] # @return [Vedeu::Editor::Insert] def initialize(collection, entity, index = nil, size = 0) @collection = collection @@ -46,11 +46,11 @@ def insert attr_reader :entity # @!attribute [r] index - # @return [Fixnum] + # @return [Integer] attr_reader :index # @!attribute [r] size - # @return [Fixnum] + # @return [Integer] attr_reader :size private @@ -72,7 +72,7 @@ def index? numeric?(index) end - # @return [Fixnum] + # @return [Integer] def position if index < 0 0 diff --git a/lib/vedeu/editor/item.rb b/lib/vedeu/editor/item.rb index 0d7df4ce5..e3448986b 100644 --- a/lib/vedeu/editor/item.rb +++ b/lib/vedeu/editor/item.rb @@ -19,7 +19,7 @@ def self.by_index(collection, index = nil) # Returns a new instance of Vedeu::Editor::Item. # # @param collection [Vedeu::Editor::Line|Vedeu::Editor::Lines] - # @param index [Fixnum] + # @param index [Integer] # @return [Vedeu::Editor::item] def initialize(collection, index = nil) @collection = collection @@ -49,7 +49,7 @@ def by_index attr_reader :collection # @!attribute [r] index - # @return [Fixnum] + # @return [Integer] attr_reader :index private diff --git a/lib/vedeu/editor/line.rb b/lib/vedeu/editor/line.rb index 6478da75a..77c3d4e85 100644 --- a/lib/vedeu/editor/line.rb +++ b/lib/vedeu/editor/line.rb @@ -37,7 +37,7 @@ def initialize(collection = nil) # Return the character at the given index. # - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [String|NilClass] def character(index = nil) return '' if collection && collection.empty? @@ -49,7 +49,7 @@ def character(index = nil) # Delete the character from the line positioned at the given # index. # - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [String] def delete_character(index = nil) Vedeu::Editor::Line.coerce(Vedeu::Editor::Delete @@ -60,7 +60,7 @@ def delete_character(index = nil) # index. # # @param character [String] - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [Vedeu::Editor::Line] def insert_character(character, index = nil) return self unless character diff --git a/lib/vedeu/editor/lines.rb b/lib/vedeu/editor/lines.rb index 26883e6e8..c5f40a62b 100644 --- a/lib/vedeu/editor/lines.rb +++ b/lib/vedeu/editor/lines.rb @@ -38,8 +38,8 @@ def initialize(collection = nil) # Deletes the character from the line where the cursor is # currently positioned. # - # @param y [Fixnum] - # @param x [Fixnum] + # @param y [Integer] + # @param x [Integer] # @return [Vedeu::Editor::Lines] def delete_character(y, x) collection[y] = line(y).delete_character(x) unless line(y).empty? @@ -49,7 +49,7 @@ def delete_character(y, x) # Delete the line from the lines positioned at the given index. # - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [String] def delete_line(index = nil) Vedeu::Editor::Lines.coerce(Vedeu::Editor::Delete @@ -67,8 +67,8 @@ def each(&block) # Insert a character in to a line. # # @param character [String] - # @param y [Fixnum] - # @param x [Fixnum] + # @param y [Integer] + # @param x [Integer] # @return [Vedeu::Editor::Lines] def insert_character(character, y, x) collection[y] = line(y).insert_character(character, x) @@ -78,7 +78,7 @@ def insert_character(character, y, x) # Insert the line on the line below the given index. # - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [Vedeu::Editor::Lines] def insert_line(index = nil) Vedeu::Editor::Lines.coerce( @@ -91,7 +91,7 @@ def insert_line(index = nil) # Returns the line at the given index. # - # @param index [Fixnum|NilClass] + # @param index [Integer|NilClass] # @return [Vedeu::Editor::Line] def line(index = nil) return Vedeu::Editor::Line.new unless collection diff --git a/lib/vedeu/esc/colours.rb b/lib/vedeu/esc/colours.rb index 298e7ea00..2f851f8c0 100644 --- a/lib/vedeu/esc/colours.rb +++ b/lib/vedeu/esc/colours.rb @@ -16,7 +16,7 @@ module Colours # Produces the background named colour escape sequence hash from # the foreground escape sequence hash. # - # @return [Hash Fixnum>] + # @return [Hash Integer>] def background_codes foreground_codes.each_with_object({}) do |(k, v), h| h[k] = v + 10 @@ -68,7 +68,7 @@ def colour(named_colour, &block) # :light_yellow, :light_blue, :light_magenta, :light_cyan, # :white # - # @return [Hash Fixnum>] + # @return [Hash Integer>] def foreground_codes { black: 30, diff --git a/lib/vedeu/events/event.rb b/lib/vedeu/events/event.rb index f2197aab8..1436bbe9e 100644 --- a/lib/vedeu/events/event.rb +++ b/lib/vedeu/events/event.rb @@ -46,11 +46,11 @@ class << self # @macro param_name # @param options [Hash void>] The options to # register the event with. - # @option options :delay [Fixnum|Float] Limits the execution + # @option options :delay [Integer|Float] Limits the execution # of the triggered event to only execute when first # triggered, with subsequent triggering being ignored until # the delay has expired. - # @option options :debounce [Fixnum|Float] Limits the + # @option options :debounce [Integer|Float] Limits the # execution of the triggered event to only execute once the # debounce has expired. Subsequent triggers before debounce # expiry are ignored. @@ -246,14 +246,14 @@ def deadline? # Return the amount of time in seconds to debounce the event by. # - # @return [Fixnum|Float] + # @return [Integer|Float] def debounce options[:debounce] || defaults[:debounce] end # Return the amount of time in seconds to throttle the event by. # - # @return [Fixnum|Float] + # @return [Integer|Float] def delay options[:delay] || defaults[:delay] end diff --git a/lib/vedeu/geometries/area/area.rb b/lib/vedeu/geometries/area/area.rb index 422d88cd8..10cd40fa6 100644 --- a/lib/vedeu/geometries/area/area.rb +++ b/lib/vedeu/geometries/area/area.rb @@ -20,40 +20,40 @@ class Area :top? # @!attribute [r] y - # @return [Fixnum] Returns the top coordinate (row/line start + # @return [Integer] Returns the top coordinate (row/line start # position) of the interface. attr_reader :y alias top y # @!attribute [r] yn - # @return [Fixnum] Returns the bottom coordinate (row/line end + # @return [Integer] Returns the bottom coordinate (row/line end # position) of the interface. attr_reader :yn alias bottom yn # @!attribute [r] x - # @return [Fixnum] Returns the left coordinate (column/character + # @return [Integer] Returns the left coordinate (column/character # start position) of the interface. attr_reader :x alias left x # @!attribute [r] xn - # @return [Fixnum] Returns the right coordinate (column/ + # @return [Integer] Returns the right coordinate (column/ # character end position) of the interface. attr_reader :xn alias right xn - # @param attributes [Hash Boolean|Fixnum|Symbol>] + # @param attributes [Hash Boolean|Integer|Symbol>] # @option attributes horizontal_alignment [Symbol] # @option attributes maximised [Boolean] # @option attributes name [String|Symbol] # @option attributes vertical_alignment [Symbol] - # @option attributes x [Fixnum] The starting x coordinate. - # @option attributes xn [Fixnum] The ending x coordinate. - # @option attributes width [Fixnum] - # @option attributes y [Fixnum] The starting y coordinate. - # @option attributes yn [Fixnum] The ending y coordinate. - # @option attributes height [Fixnum] + # @option attributes x [Integer] The starting x coordinate. + # @option attributes xn [Integer] The ending x coordinate. + # @option attributes width [Integer] + # @option attributes y [Integer] The starting y coordinate. + # @option attributes yn [Integer] The ending y coordinate. + # @option attributes height [Integer] # @return [Vedeu::Geometries::Area] def self.from_attributes(attributes = {}) y_attributes = { @@ -83,10 +83,10 @@ def self.from_attributes(attributes = {}) # Returns a new instance of Vedeu::Area. # # @macro param_name - # @param y [Fixnum] The starting row/line position. - # @param yn [Fixnum] The ending row/line position. - # @param x [Fixnum] The starting column/character position. - # @param xn [Fixnum] The ending column/character position. + # @param y [Integer] The starting row/line position. + # @param yn [Integer] The ending row/line position. + # @param x [Integer] The starting column/character position. + # @param xn [Integer] The ending column/character position. # @return [Vedeu::Geometries::Area] def initialize(name:, y:, yn:, x:, xn:) @name = name @@ -113,7 +113,7 @@ def eql?(other) # Returns the width of the interface determined by whether a # left, right, both or neither borders are shown. # - # @return [Fixnum] + # @return [Integer] def bordered_width return width unless border && enabled? @@ -132,7 +132,7 @@ def bordered_width # Returns the height of the interface determined by whether a # top, bottom, both or neither borders are shown. # - # @return [Fixnum] + # @return [Integer] def bordered_height return height unless border && enabled? @@ -151,7 +151,7 @@ def bordered_height # Return the column position for 1 character right of the left # border. # - # @return [Fixnum] + # @return [Integer] def bx (enabled? && left?) ? x + 1 : x end @@ -159,7 +159,7 @@ def bx # Return the column position for 1 character left of the right # border. # - # @return [Fixnum] + # @return [Integer] def bxn (enabled? && right?) ? xn - 1 : xn end @@ -167,7 +167,7 @@ def bxn # Return the row position for 1 character under of the top # border. # - # @return [Fixnum] + # @return [Integer] def by (enabled? && top?) ? y + 1 : y end @@ -175,7 +175,7 @@ def by # Return the column position for 1 character above of the bottom # border. # - # @return [Fixnum] + # @return [Integer] def byn (enabled? && bottom?) ? yn - 1 : yn end @@ -183,7 +183,7 @@ def byn # Returns an array containing the centred y and x coordinates of # the interface. # - # @return [Array] + # @return [Array] def centre [centre_y, centre_x] end @@ -191,7 +191,7 @@ def centre # Returns the centred y coordinate (the vertical centre row) of # the interface. # - # @return [Fixnum] + # @return [Integer] def centre_y (height / 2) + y end @@ -199,21 +199,21 @@ def centre_y # Returns the centred x coordinate (the horizontal centre # character) of the interface. # - # @return [Fixnum] + # @return [Integer] def centre_x (width / 2) + x end # Returns the height of the interface. # - # @return [Fixnum] + # @return [Integer] def height (yn - y) + 1 end # Returns the width of the interface. # - # @return [Fixnum] + # @return [Integer] def width (xn - x) + 1 end @@ -227,8 +227,8 @@ def width # north(2) # => 2 (positive goes 'more' north) # north(-4) # => 8 (negative goes south) # - # @param offset [Fixnum] - # @return [Fixnum] + # @param offset [Integer] + # @return [Integer] def north(offset = 1) y - offset end @@ -242,8 +242,8 @@ def north(offset = 1) # east(2) # => 21 (positive goes 'more' east) # east(-4) # => 15 (negative goes west) # - # @param offset [Fixnum] - # @return [Fixnum] + # @param offset [Integer] + # @return [Integer] def east(offset = 1) xn + offset end @@ -257,8 +257,8 @@ def east(offset = 1) # south(2) # => 14 (positive goes 'more' south) # south(-4) # => 8 (negative goes north) # - # @param offset [Fixnum] - # @return [Fixnum] + # @param offset [Integer] + # @return [Integer] def south(offset = 1) yn + offset end @@ -272,8 +272,8 @@ def south(offset = 1) # west(2) # => 6 (positive goes 'more' west) # west(-4) # => 12 (negative goes east) # - # @param offset [Fixnum] - # @return [Fixnum] + # @param offset [Integer] + # @return [Integer] def west(offset = 1) x - offset end diff --git a/lib/vedeu/geometries/area/dimension.rb b/lib/vedeu/geometries/area/dimension.rb index 0990d48e1..3f0678a8e 100644 --- a/lib/vedeu/geometries/area/dimension.rb +++ b/lib/vedeu/geometries/area/dimension.rb @@ -22,21 +22,21 @@ class Dimension :unaligned? # @param (see #initialize) - # @return [Array] + # @return [Array] def self.pair(attributes = {}) new(attributes).pair end # Returns a new instance of Vedeu::Geometries::Dimension. # - # @param attributes [Hash Fixnum, NilClass>] + # @param attributes [Hash Integer, NilClass>] # @option attributes alignment [Symbol] - # @option attributes d [Fixnum|NilClass] + # @option attributes d [Integer|NilClass] # The starting value (y or x). - # @option attributes dn [Fixnum|NilClass] + # @option attributes dn [Integer|NilClass] # The ending value (yn or xn). - # @option attributes d_dn [Fixnum|NilClass] A width or a height. - # @option attributes default [Fixnum|NilClass] + # @option attributes d_dn [Integer|NilClass] A width or a height. + # @option attributes default [Integer|NilClass] # The terminal width or height. # @option attributes maximised [Boolean] # @return [Vedeu::Geometries::Dimension] @@ -52,7 +52,7 @@ def initialize(attributes = {}) # character to the last row/line or column/character of the # terminal. # - # @return [Array] + # @return [Array] def pair if maximised? [1, default] @@ -75,19 +75,19 @@ def pair protected # @!attribute [r] d - # @return [Fixnum|NilClass] The starting value (y or x). + # @return [Integer|NilClass] The starting value (y or x). attr_reader :d # @!attribute [r] dn - # @return [Fixnum|NilClass] The ending value (yn or xn). + # @return [Integer|NilClass] The ending value (yn or xn). attr_reader :dn # @!attribute [r] d_dn - # @return [Fixnum|NilClass] A width or a height. + # @return [Integer|NilClass] A width or a height. attr_reader :d_dn # @!attribute [r] default - # @return [Fixnum|NilClass] The terminal width or height. + # @return [Integer|NilClass] The terminal width or height. attr_reader :default # @!attribute [r] maximised @@ -108,7 +108,7 @@ def alignment # 2) Or use the width or height value. # 3) Or use the default/current terminal width or height value. # - # @return [Fixnum|NilClass] + # @return [Integer|NilClass] def length if d && dn (dn - d) + 1 @@ -129,7 +129,7 @@ def length # length = 24 # => 12 # centred_d = 27 # (39 - 12 = 27) # - # @return [Fixnum] + # @return [Integer] def centred_d d = (default / 2) - (length / 2) d < 1 ? 1 : d @@ -142,7 +142,7 @@ def centred_d # length = 24 # => 12 # centred_dn = 51 # (39 + 12 = 51) # - # @return [Fixnum] + # @return [Integer] def centred_dn dn = (default / 2) + (length / 2) dn > default ? default : dn @@ -155,7 +155,7 @@ def centred_dn # 2) Use the xn or yn (dn), or # 3) Default to the terminal width or height. # - # @return [Fixnum] + # @return [Integer] def end_coordinate if d_dn (d_dn > default) ? default : d_dn @@ -176,7 +176,7 @@ def end_coordinate # 2) Use the x or y (d), or # 3) Default to 1. # - # @return [Fixnum] + # @return [Integer] def start_coordinate if d_dn (default - d_dn) < 1 ? 1 : (default - d_dn) @@ -192,7 +192,7 @@ def start_coordinate # Fetch the starting coordinate, or use 1 when not set. # - # @return [Fixnum] + # @return [Integer] def _d d || 1 end @@ -206,7 +206,7 @@ def _d # add the width or height to the start and minus 1. # 4) otherwise, use the terminal default width or height. # - # @return [Fixnum] + # @return [Integer] def _dn if dn dn diff --git a/lib/vedeu/geometries/dsl/dsl.rb b/lib/vedeu/geometries/dsl/dsl.rb index 95a4cffa2..a2f65b759 100644 --- a/lib/vedeu/geometries/dsl/dsl.rb +++ b/lib/vedeu/geometries/dsl/dsl.rb @@ -89,10 +89,10 @@ class DSL # @param vertical [Symbol] One of :bottom, :middle, :none, :top. # @param horizontal [Symbol] One of :center, :centre, :left, # :none, :right. - # @param width [Fixnum] The number of characters/columns wide; + # @param width [Integer] The number of characters/columns wide; # this is required when the given value for horizontal is any # value other than :none. - # @param height [Fixnum] The number of lines/rows tall; this is + # @param height [Integer] The number of lines/rows tall; this is # required when the given value for vertical is any value # other than :none. # @macro raise_invalid_syntax @@ -104,8 +104,8 @@ def align(vertical: :none, horizontal: :none, width: nil, height: nil) # @param value [Symbol] One of :center, :centre, :left, :none, # :right. - # @param width [Fixnum] The number of characters/columns. - # @param x [Fixnum] When given, sets the x coordinate. + # @param width [Integer] The number of characters/columns. + # @param x [Integer] When given, sets the x coordinate. # @return [Vedeu::Geometries::Geometry] def horizontal_alignment(value = :none, width = nil, x = nil) alignment = Vedeu::Coercers::HorizontalAlignment.validate(value) @@ -117,8 +117,8 @@ def horizontal_alignment(value = :none, width = nil, x = nil) end # @param value [Symbol] One of :bottom, :middle, :none, :top. - # @param height [Fixnum] The number of lines/rows. - # @param y [Fixnum] When given, sets the y coordinate. + # @param height [Integer] The number of lines/rows. + # @param y [Integer] When given, sets the y coordinate. # @return [Vedeu::Geometries::Geometry] def vertical_alignment(value = :none, height = nil, y = nil) alignment = Vedeu::Coercers::VerticalAlignment.validate(value) @@ -130,7 +130,7 @@ def vertical_alignment(value = :none, height = nil, y = nil) end # {include:file:docs/dsl/by_method/geometry/align_bottom.md} - # @param height [Fixnum] The number of lines/rows. + # @param height [Integer] The number of lines/rows. # @return [Vedeu::Geometries::Geometry] def align_bottom(height = nil) y = if height @@ -143,7 +143,7 @@ def align_bottom(height = nil) end # {include:file:docs/dsl/by_method/geometry/align_centre.md} - # @param width [Fixnum] The number of characters/columns. + # @param width [Integer] The number of characters/columns. # @return [Vedeu::Geometries::Geometry] def align_centre(width = nil) x = if width @@ -157,14 +157,14 @@ def align_centre(width = nil) alias align_center align_centre # {include:file:docs/dsl/by_method/geometry/align_left.md} - # @param width [Fixnum] The number of characters/columns. + # @param width [Integer] The number of characters/columns. # @return [Vedeu::Geometries::Geometry] def align_left(width = nil) horizontal_alignment(:left, width) end # {include:file:docs/dsl/by_method/geometry/align_middle.md} - # @param height [Fixnum] The number of lines/rows. + # @param height [Integer] The number of lines/rows. # @return [Vedeu::Geometries::Geometry] def align_middle(height = nil) y = if height @@ -177,7 +177,7 @@ def align_middle(height = nil) end # {include:file:docs/dsl/by_method/geometry/align_right.md} - # @param width [Fixnum] The number of characters/columns. + # @param width [Integer] The number of characters/columns. # @return [Vedeu::Geometries::Geometry] def align_right(width = nil) x = if width @@ -190,48 +190,48 @@ def align_right(width = nil) end # {include:file:docs/dsl/by_method/geometry/align_top.md} - # @param height [Fixnum] The number of lines/rows. + # @param height [Integer] The number of lines/rows. # @return [Vedeu::Geometries::Geometry] def align_top(height = nil) vertical_alignment(:top, height) end # {include:file:docs/dsl/by_method/geometry/columns.md} - # @param value [Fixnum] + # @param value [Integer] # @macro raise_out_of_range - # @return [Fixnum|Vedeu::Error::OutOfRange] + # @return [Integer|Vedeu::Error::OutOfRange] def columns(value) Vedeu::Geometries::Grid.columns(value) end # {include:file:docs/dsl/by_method/geometry/height.md} - # @param value [Fixnum] - # @return [Fixnum] + # @param value [Integer] + # @return [Integer] def height(value) model.height = proc { value } end alias height= height # {include:file:docs/dsl/by_method/geometry/rows.md} - # @param value [Fixnum] + # @param value [Integer] # @macro raise_out_of_range - # @return [Fixnum] + # @return [Integer] def rows(value) Vedeu::Geometries::Grid.rows(value) end # {include:file:docs/dsl/by_method/geometry/width.md} - # @param value [Fixnum] The number of characters/columns. - # @return [Fixnum] + # @param value [Integer] The number of characters/columns. + # @return [Integer] def width(value) model.width = proc { value } end alias width= width # {include:file:docs/dsl/by_method/geometry/x.md} - # @param value [Fixnum] + # @param value [Integer] # @macro param_block - # @return [Fixnum] + # @return [Integer] def x(value = 1, &block) return model.x = block if block_given? @@ -240,9 +240,9 @@ def x(value = 1, &block) alias x= x # {include:file:docs/dsl/by_method/geometry/xn.md} - # @param value [Fixnum] + # @param value [Integer] # @macro param_block - # @return [Fixnum] + # @return [Integer] def xn(value = 1, &block) return model.xn = block if block_given? @@ -251,9 +251,9 @@ def xn(value = 1, &block) alias xn= xn # {include:file:docs/dsl/by_method/geometry/y.md} - # @param value [Fixnum] + # @param value [Integer] # @macro param_block - # @return [Fixnum] + # @return [Integer] def y(value = 1, &block) return model.y = block if block_given? @@ -262,9 +262,9 @@ def y(value = 1, &block) alias y= y # {include:file:docs/dsl/by_method/geometry/yn.md} - # @param value [Fixnum] + # @param value [Integer] # @macro param_block - # @return [Fixnum] + # @return [Integer] def yn(value = 1, &block) return model.yn = block if block_given? diff --git a/lib/vedeu/geometries/dsl/grid.rb b/lib/vedeu/geometries/dsl/grid.rb index c418fe128..2403a64b5 100644 --- a/lib/vedeu/geometries/dsl/grid.rb +++ b/lib/vedeu/geometries/dsl/grid.rb @@ -27,7 +27,7 @@ def self.rows(value) # Returns a new instance of Vedeu::Geometries::Grid. # - # @param value [Fixnum] + # @param value [Integer] # @return [Vedeu::Geometries::Grid] def initialize(value) @value = value @@ -47,7 +47,7 @@ def rows # Returns the width of a single column in characters. # - # @return [Fixnum] + # @return [Integer] def column Vedeu.width / 12 end @@ -62,13 +62,13 @@ def out_of_range?(v) # Returns the height of a single row in characters. # - # @return [Fixnum] + # @return [Integer] def row Vedeu.height / 12 end # @macro raise_out_of_range - # @return [Fixnum] + # @return [Integer] def value raise Vedeu::Error::OutOfRange if out_of_range?(@value) diff --git a/lib/vedeu/geometries/geometry.rb b/lib/vedeu/geometries/geometry.rb index 76890d6eb..0c1823e59 100644 --- a/lib/vedeu/geometries/geometry.rb +++ b/lib/vedeu/geometries/geometry.rb @@ -46,7 +46,7 @@ class Geometry attr_accessor :client # @!attribute [w] height - # @return [Fixnum] + # @return [Integer] attr_writer :height # @!attribute [rw] horizontal_alignment @@ -67,41 +67,41 @@ class Geometry attr_accessor :vertical_alignment # @!attribute [w] width - # @return [Fixnum] + # @return [Integer] attr_writer :width # @!attribute [w] x - # @return [Fixnum] + # @return [Integer] attr_writer :x # @!attribute [w] xn - # @return [Fixnum] + # @return [Integer] attr_writer :xn # @!attribute [w] y - # @return [Fixnum] + # @return [Integer] attr_writer :y # @!attribute [w] yn - # @return [Fixnum] + # @return [Integer] attr_writer :yn # Returns a new instance of Vedeu::Geometries::Geometry. # - # @param attributes [Hash Boolean|Fixnum|String| + # @param attributes [Hash Boolean|Integer|String| # Symbol|Vedeu::Geometries::Repository] # @option attributes client [void] - # @option attributes height [Fixnum] + # @option attributes height [Integer] # @option attributes horizontal_alignment [Symbol] # @option attributes maximised [Boolean] # @option attributes name [String|Symbol] # @option attributes repository [Vedeu::Geometries::Repository] # @option attributes vertical_alignment [Symbol] - # @option attributes width [Fixnum] - # @option attributes x [Fixnum] - # @option attributes xn [Fixnum] - # @option attributes y [Fixnum] - # @option attributes yn [Fixnum] + # @option attributes width [Integer] + # @option attributes x [Integer] + # @option attributes xn [Integer] + # @option attributes y [Integer] + # @option attributes yn [Integer] # @return [Vedeu::Geometries::Geometry] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| @@ -109,7 +109,7 @@ def initialize(attributes = {}) end end - # @return [Hash Boolean|Fixnum|String|Symbol>] + # @return [Hash Boolean|Integer|String|Symbol>] def attributes { client: client, diff --git a/lib/vedeu/geometries/move.rb b/lib/vedeu/geometries/move.rb index cf4cb15f6..373d10211 100644 --- a/lib/vedeu/geometries/move.rb +++ b/lib/vedeu/geometries/move.rb @@ -87,12 +87,12 @@ def direction? direction != :none end - # @return [Hash Hash Fixnum>>] + # @return [Hash Hash Integer>>] def directional_move movement.fetch(direction, {}) end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def down { y: y + offset, @@ -105,7 +105,7 @@ def geometry @geometry ||= Vedeu.geometries.by_name(name) end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def left { x: x - offset, @@ -116,7 +116,7 @@ def left # Moves the geometry in the direction given by the offset also # given. # - # @return [Hash Hash Fixnum>>] + # @return [Hash Hash Integer>>] def movement { down: down, @@ -133,7 +133,7 @@ def new_attributes geometry.attributes.merge!(unalign_unmaximise) end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def origin { x: 1, @@ -143,7 +143,7 @@ def origin } end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def right { x: x + offset, @@ -160,7 +160,7 @@ def unalign_unmaximise }.merge(directional_move) end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def up { y: y - offset, diff --git a/lib/vedeu/geometries/position.rb b/lib/vedeu/geometries/position.rb index 6ecbdce81..17af2485f 100644 --- a/lib/vedeu/geometries/position.rb +++ b/lib/vedeu/geometries/position.rb @@ -12,12 +12,12 @@ module Geometries class Position # @!attribute [r] y - # @return [Fixnum] + # @return [Integer] attr_reader :y alias first y # @!attribute [r] x - # @return [Fixnum] + # @return [Integer] attr_reader :x alias last x @@ -39,8 +39,8 @@ def [](y = 1, x = 1) # Initializes a new instance of Vedeu::Geometries::Position. # - # @param y [Fixnum] The row/line position. - # @param x [Fixnum] The column/character position. + # @param y [Integer] The row/line position. + # @param x [Integer] The column/character position. # @return [Vedeu::Geometries::Position] def initialize(y = 1, x = 1) @y = Vedeu::Point.coerce(value: y, max: Vedeu.height).value @@ -52,7 +52,7 @@ def initialize(y = 1, x = 1) # Converts a position into an index for the terminal. An index # is the position minus 1. # - # @return [Array] + # @return [Array] def as_indices ix = Vedeu::Point.coerce(value: (x - 1), min: 0).value iy = Vedeu::Point.coerce(value: (y - 1), min: 0).value @@ -61,7 +61,7 @@ def as_indices end # @param other [Vedeu::Geometries::Position] - # @return [Fixnum] + # @return [Integer] def <=>(other) if y == other.y x <=> other.x @@ -83,7 +83,7 @@ def eql?(other) # Return a tuple containing the y and x coordinates. # - # @return [Array] + # @return [Array] def to_a [y, x] end @@ -95,7 +95,7 @@ def to_ast # Return the position as a Hash. # - # @return [Hash Fixnum|NilClass>] + # @return [Hash Integer|NilClass>] def to_h { position: { diff --git a/lib/vedeu/input/mouse.rb b/lib/vedeu/input/mouse.rb index ab65fc46d..c252796e6 100644 --- a/lib/vedeu/input/mouse.rb +++ b/lib/vedeu/input/mouse.rb @@ -62,7 +62,7 @@ def click private - # @return [Fixnum] + # @return [Integer] def button mouse[0] end @@ -75,7 +75,7 @@ def left_click? button == 0 end - # @return [Array] + # @return [Array] def mouse @_input ||= input.chars[3..-1].map { |character| character.ord - 32 } end @@ -96,12 +96,12 @@ def wheel_down? button == 65 end - # @return [Fixnum] + # @return [Integer] def x mouse[1] end - # @return [Fixnum] + # @return [Integer] def y mouse[2] end diff --git a/lib/vedeu/interfaces/clear_content.rb b/lib/vedeu/interfaces/clear_content.rb index b539f8273..57233301a 100644 --- a/lib/vedeu/interfaces/clear_content.rb +++ b/lib/vedeu/interfaces/clear_content.rb @@ -73,7 +73,7 @@ def interface @_interface ||= Vedeu.interfaces.by_name(name) end - # @param iy [Fixnum] + # @param iy [Integer] # @return [String] def optimised_line(iy) Vedeu::Geometries::Position.new(by + iy, bx).to_s + colour.to_s + chars diff --git a/lib/vedeu/interfaces/dsl.rb b/lib/vedeu/interfaces/dsl.rb index 5cdaca5f5..3ad9ed3f8 100644 --- a/lib/vedeu/interfaces/dsl.rb +++ b/lib/vedeu/interfaces/dsl.rb @@ -123,7 +123,7 @@ def keymap?(name) # refreshing too often, the reduces artefacts particularly when # resizing the terminal screen. # - # @param value [Fixnum|Float] Time in seconds. (0.5 = 500ms). + # @param value [Integer|Float] Time in seconds. (0.5 = 500ms). # # @example # Vedeu.interface :my_interface do @@ -132,7 +132,7 @@ def keymap?(name) # # ... # end # - # @return [Fixnum|Float] + # @return [Integer|Float] def delay(value) model.delay = value end @@ -306,8 +306,8 @@ def visible(value = true) # # ... # end # - # @param value [Fixnum] - # @return [Fixnum] + # @param value [Integer] + # @return [Integer] def zindex(value) model.zindex = value end diff --git a/lib/vedeu/interfaces/interface.rb b/lib/vedeu/interfaces/interface.rb index b407504b7..5c2cc0128 100644 --- a/lib/vedeu/interfaces/interface.rb +++ b/lib/vedeu/interfaces/interface.rb @@ -19,7 +19,7 @@ class Interface include Vedeu::Toggleable # @!attribute [rw] client - # @return [Fixnum|Float] + # @return [Integer|Float] attr_accessor :client # @!attribute [rw] cursor_visible @@ -28,7 +28,7 @@ class Interface alias cursor_visible? cursor_visible # @!attribute [rw] delay - # @return [Fixnum|Float] + # @return [Integer|Float] attr_accessor :delay # @!attribute [rw] editable @@ -53,7 +53,7 @@ class Interface attr_accessor :wordwrap # @!attribute [rw] zindex - # @return [Fixnum] + # @return [Integer] attr_accessor :zindex # Return a new instance of Vedeu::Interfaces::Interface. @@ -70,7 +70,7 @@ class Interface # @option attributes style [Vedeu::Presentation::Style] # @option attributes visible [Boolean] # @option attributes wordwrap [Boolean] - # @option attributes zindex [Fixnum] + # @option attributes zindex [Integer] # @return [Vedeu::Interfaces::Interface] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| diff --git a/lib/vedeu/logging/debug.rb b/lib/vedeu/logging/debug.rb index f6d8a05f7..860c72571 100644 --- a/lib/vedeu/logging/debug.rb +++ b/lib/vedeu/logging/debug.rb @@ -106,7 +106,7 @@ def ignore_classes /^Array/, /^Hash/, /^String/, - /^Fixnum/, + /^Integer/, ] end diff --git a/lib/vedeu/logging/log.rb b/lib/vedeu/logging/log.rb index 4741e618e..1777423be 100644 --- a/lib/vedeu/logging/log.rb +++ b/lib/vedeu/logging/log.rb @@ -18,7 +18,7 @@ class << self # @api private # @!attribute [rw] count - # @return [Fixnum] Used by tests to access the `count` + # @return [Integer] Used by tests to access the `count` # instance variable. attr_accessor :count diff --git a/lib/vedeu/menus/menu.rb b/lib/vedeu/menus/menu.rb index 67c016c5b..b90633601 100644 --- a/lib/vedeu/menus/menu.rb +++ b/lib/vedeu/menus/menu.rb @@ -21,7 +21,7 @@ class Menu # current. # # @!attribute [rw] current - # @return [Fixnum] + # @return [Integer] attr_accessor :current # The name of the menu. Used to reference the menu throughout @@ -35,7 +35,7 @@ class Menu # selected. # # @!attribute [rw] selected - # @return [Fixnum] + # @return [Integer] attr_accessor :selected # Returns a new instance of Vedeu::Menus::Menu. @@ -43,8 +43,8 @@ class Menu # @param attributes [Hash] # @option attributes collection [Array] # @option attributes name [String|Symbol] - # @option attributes current [Fixnum] - # @option attributes selected [Fixnum|NilClass] + # @option attributes current [Integer] + # @option attributes selected [Integer|NilClass] # @return [Vedeu::Menus::Menu] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| @@ -188,14 +188,14 @@ def deselect_item # Returns the last index of the collection. # - # @return [Fixnum] + # @return [Integer] def last collection.size - 1 end # Returns the size of the collection. # - # @return [Fixnum] + # @return [Integer] def size collection.size end diff --git a/lib/vedeu/models/page.rb b/lib/vedeu/models/page.rb index 51ffe1a90..726a42671 100644 --- a/lib/vedeu/models/page.rb +++ b/lib/vedeu/models/page.rb @@ -38,8 +38,8 @@ def content rows.flat_map(&:content) end - # @param row_index [Fixnum] - # @param cell_index [Fixnum] + # @param row_index [Integer] + # @param cell_index [Integer] # @return [NilClass|void] def cell(row_index = nil, cell_index = nil) return nil if row_index.nil? || cell_index.nil? @@ -70,7 +70,7 @@ def eql?(other) end alias == eql? - # @param index [Fixnum] + # @param index [Integer] # @return [NilClass|Vedeu::Models::Row] def row(index = nil) return nil if index.nil? @@ -78,7 +78,7 @@ def row(index = nil) rows[index] end - # @return [Fixnum] + # @return [Integer] def size rows.size end diff --git a/lib/vedeu/models/row.rb b/lib/vedeu/models/row.rb index 2b9e15431..c341a2d9b 100644 --- a/lib/vedeu/models/row.rb +++ b/lib/vedeu/models/row.rb @@ -34,7 +34,7 @@ def initialize(cells = []) @cells = cells || [] end - # @param index [Fixnum] + # @param index [Integer] # @return [NilClass|void] def cell(index) return nil if index.nil? || empty? @@ -78,7 +78,7 @@ def reset_character Vedeu::Cells::Escape.new(value: Vedeu.esc.reset) end - # @return [Fixnum] + # @return [Integer] def size cells.size end diff --git a/lib/vedeu/output/viewport.rb b/lib/vedeu/output/viewport.rb index 89266dcad..f1deea2d1 100644 --- a/lib/vedeu/output/viewport.rb +++ b/lib/vedeu/output/viewport.rb @@ -88,9 +88,9 @@ def columns # columns to change the viewport by on either the y or x axis) # determined by the offset (the cursor's y or x offset position. # - # @param offset [Fixnum] The cursor's oy or ox values. - # @param dimension [Fixnum] Either the height or width. - # @return [Fixnum] + # @param offset [Integer] The cursor's oy or ox values. + # @param dimension [Integer] Either the height or width. + # @return [Integer] def content_offset(offset, dimension) return 0 unless offset >= dimension @@ -107,7 +107,7 @@ def geometry Vedeu.geometries.by_name(name) end - # @return [Fixnum] + # @return [Integer] def left content_offset(ox, bordered_width) end @@ -156,7 +156,7 @@ def show (lines[rows] || []).map { |line| (line.chars[columns] || []) } end - # @return [Fixnum] + # @return [Integer] def top content_offset(oy, bordered_height) end diff --git a/lib/vedeu/output/write.rb b/lib/vedeu/output/write.rb index 26199e221..7c3a49b81 100644 --- a/lib/vedeu/output/write.rb +++ b/lib/vedeu/output/write.rb @@ -28,9 +28,9 @@ def self.write(output = nil, options = {}) # Returns a new instance of Vedeu::Output::Write. # # @param output [String] - # @param options [Hash Fixnum>] - # @option x [Fixnum] - # @option y [Fixnum] + # @param options [Hash Integer>] + # @option x [Integer] + # @option y [Integer] # @option colour [Hash String>] # @option style [Array|Symbol] # @return [Vedeu::Output::Write] @@ -75,7 +75,7 @@ def defaults } end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def options defaults.merge!(@options) end @@ -86,7 +86,7 @@ def output @output.to_s end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def position_start { x: options[:x], @@ -94,7 +94,7 @@ def position_start } end - # @return [Hash Fixnum>] + # @return [Hash Integer>] def position_end { x: options[:x] + output.size, diff --git a/lib/vedeu/presentation/position.rb b/lib/vedeu/presentation/position.rb index fb0087d02..1754d735d 100644 --- a/lib/vedeu/presentation/position.rb +++ b/lib/vedeu/presentation/position.rb @@ -37,7 +37,7 @@ def position? # Returns the x coordinate for the model when the position # attribute of the including model is set. # - # @return [Fixnum|NilClass] + # @return [Integer|NilClass] def x position.x if position? end @@ -45,7 +45,7 @@ def x # Returns the y coordinate for the model when the position # attribute of the including model is set. # - # @return [Fixnum|NilClass] + # @return [Integer|NilClass] def y position.y if position? end diff --git a/lib/vedeu/repositories/assemblage.rb b/lib/vedeu/repositories/assemblage.rb index f1e2a57a5..f1a50f3a2 100644 --- a/lib/vedeu/repositories/assemblage.rb +++ b/lib/vedeu/repositories/assemblage.rb @@ -15,7 +15,7 @@ module Assemblage # Return an individual element or collection of elements (if # the given index is a Range). # - # @param index [Fixnum|Range] + # @param index [Integer|Range] # @return [void] def [](index) collection[index] @@ -56,7 +56,7 @@ def eql?(other) # Return the size of the collection. # - # @return [Fixnum] + # @return [Integer] def size collection.size end diff --git a/lib/vedeu/repositories/cache.rb b/lib/vedeu/repositories/cache.rb index 03afd6c0d..16a177afb 100644 --- a/lib/vedeu/repositories/cache.rb +++ b/lib/vedeu/repositories/cache.rb @@ -25,7 +25,7 @@ def initialize # @param resource [void] # @param options [Hash] # @option options value [void] The value to be cached. - # @option options expires [Fixnum] The number of seconds after + # @option options expires [Integer] The number of seconds after # which the resource will have expired. # @return [void] def add(resource, options = {}) diff --git a/lib/vedeu/repositories/collection.rb b/lib/vedeu/repositories/collection.rb index f1cdf8cc6..5d0347685 100644 --- a/lib/vedeu/repositories/collection.rb +++ b/lib/vedeu/repositories/collection.rb @@ -22,7 +22,7 @@ class Collection alias value collection # @!attribute [rw] parent - # @return [Fixnum] + # @return [Integer] attr_accessor :parent # @!attribute [rw] name diff --git a/lib/vedeu/repositories/store.rb b/lib/vedeu/repositories/store.rb index fbfb57f64..cabd549c7 100644 --- a/lib/vedeu/repositories/store.rb +++ b/lib/vedeu/repositories/store.rb @@ -56,7 +56,7 @@ def registered # Return the number of entries stored. # - # @return [Fixnum] + # @return [Integer] def size storage.size end diff --git a/lib/vedeu/runtime/launcher.rb b/lib/vedeu/runtime/launcher.rb index bbae24c80..5580de9e2 100644 --- a/lib/vedeu/runtime/launcher.rb +++ b/lib/vedeu/runtime/launcher.rb @@ -13,7 +13,7 @@ module Vedeu class Launcher # @!attribute [r] exit_code - # @return [Fixnum] Return value indicating successful execution + # @return [Integer] Return value indicating successful execution # (0) or an error occurred (1). attr_reader :exit_code diff --git a/lib/vedeu/sentence.rb b/lib/vedeu/sentence.rb index c977f8b63..020aecdb8 100644 --- a/lib/vedeu/sentence.rb +++ b/lib/vedeu/sentence.rb @@ -83,7 +83,7 @@ def last elements[-1] end - # @return [Fixnum] + # @return [Integer] def count elements.size end diff --git a/lib/vedeu/support/point.rb b/lib/vedeu/support/point.rb index ac9364e67..2aaa0d5d1 100644 --- a/lib/vedeu/support/point.rb +++ b/lib/vedeu/support/point.rb @@ -14,7 +14,7 @@ class Point include Vedeu::Common # @!attribute [r] value - # @return [Fixnum] + # @return [Integer] attr_reader :value # @param (see #initialize) @@ -30,9 +30,9 @@ def self.valid?(value: nil, min: 1, max: Float::INFINITY) new(value: value, min: min, max: max).valid? end - # @param value [Fixnum|NilClass] - # @param min [Fixnum] - # @param max [Fixnum|Float::INFINITY] + # @param value [Integer|NilClass] + # @param min [Integer] + # @param max [Integer|Float::INFINITY] # @return [Vedeu::Point] def initialize(value: nil, min: 1, max: Float::INFINITY) @min = min @@ -68,21 +68,21 @@ def valid? private # @macro raise_invalid_syntax - # @return [Fixnum] + # @return [Integer] def min return @min if numeric?(@min) raise Vedeu::Error::InvalidSyntax, - "Expecting 'min' to be a Fixnum." + "Expecting 'min' to be a Integer." end # @macro raise_invalid_syntax - # @return [Fixnum] + # @return [Integer] def max return @max if numeric?(@max) raise Vedeu::Error::InvalidSyntax, - "Expecting 'max' to be a Fixnum or Float::INFINITY." + "Expecting 'max' to be a Integer or Float::INFINITY." end end # Point diff --git a/lib/vedeu/support/x_coordinate.rb b/lib/vedeu/support/x_coordinate.rb index b16682067..5954fa198 100644 --- a/lib/vedeu/support/x_coordinate.rb +++ b/lib/vedeu/support/x_coordinate.rb @@ -16,7 +16,7 @@ def initialize(geometry) # Return the :x value from the geometry. # - # @return [Fixnum] + # @return [Integer] def d geometry.x end @@ -24,7 +24,7 @@ def d # Return the :bx value from the geometry. # - # @return [Fixnum] + # @return [Integer] def bd geometry.bx end @@ -32,7 +32,7 @@ def bd # Return the :bxn value from the geometry. # - # @return [Fixnum] + # @return [Integer] def bdn geometry.bxn end @@ -40,7 +40,7 @@ def bdn # Return the :bordered_width value from the geometry. # - # @return [Fixnum] + # @return [Integer] def d_dn geometry.bordered_width end diff --git a/lib/vedeu/support/y_coordinate.rb b/lib/vedeu/support/y_coordinate.rb index 12681e1bd..4f52803ef 100644 --- a/lib/vedeu/support/y_coordinate.rb +++ b/lib/vedeu/support/y_coordinate.rb @@ -16,7 +16,7 @@ def initialize(geometry) # Return the :y value from the geometry. # - # @return [Fixnum] + # @return [Integer] def d geometry.y end @@ -24,7 +24,7 @@ def d # Return the :by value from the geometry. # - # @return [Fixnum] + # @return [Integer] def bd geometry.by end @@ -32,7 +32,7 @@ def bd # Return the :byn value from the geometry. # - # @return [Fixnum] + # @return [Integer] def bdn geometry.byn end @@ -40,7 +40,7 @@ def bdn # Return the :bordered_height value from the geometry. # - # @return [Fixnum] + # @return [Integer] def d_dn geometry.bordered_height end diff --git a/lib/vedeu/terminal/terminal.rb b/lib/vedeu/terminal/terminal.rb index 284305e8d..adde4e96b 100644 --- a/lib/vedeu/terminal/terminal.rb +++ b/lib/vedeu/terminal/terminal.rb @@ -122,7 +122,7 @@ def centre # Returns the `y` (row/line) component of the coordinate tuple # provided by {Vedeu::Terminal.centre} # - # @return [Fixnum] + # @return [Integer] def centre_y centre[0] end @@ -130,7 +130,7 @@ def centre_y # Returns the `x` (column/character) component of the coodinate # tuple provided by {Vedeu::Terminal.centre} # - # @return [Fixnum] + # @return [Integer] def centre_x centre[-1] end @@ -138,7 +138,7 @@ def centre_x # Returns 1. This 1 is either the top-most or left-most coordinate # of the terminal. # - # @return [Fixnum] + # @return [Integer] def origin 1 end @@ -148,7 +148,7 @@ def origin # Returns a tuple containing the height and width of the current # terminal. # - # @return [Array] + # @return [Array] def size console.winsize end diff --git a/lib/vedeu/views/default_attributes.rb b/lib/vedeu/views/default_attributes.rb index 032c5d1ba..5fceccaa7 100644 --- a/lib/vedeu/views/default_attributes.rb +++ b/lib/vedeu/views/default_attributes.rb @@ -26,7 +26,7 @@ module DefaultAttributes alias truncate? truncate # @!attribute [r] width - # @return [Fixnum|NilClass] + # @return [Integer|NilClass] attr_reader :width # @!attribute [r] wordwrap diff --git a/lib/vedeu/views/line.rb b/lib/vedeu/views/line.rb index 0745938c8..785ee1f03 100644 --- a/lib/vedeu/views/line.rb +++ b/lib/vedeu/views/line.rb @@ -85,7 +85,7 @@ def eql?(other) # Returns the size of the content in characters without # formatting. # - # @return [Fixnum] + # @return [Integer] def size streams.map(&:size).inject(0, :+) end diff --git a/lib/vedeu/views/view.rb b/lib/vedeu/views/view.rb index 754a41f7f..f8be555a5 100644 --- a/lib/vedeu/views/view.rb +++ b/lib/vedeu/views/view.rb @@ -62,7 +62,7 @@ class DSL alias wordwrap? wordwrap # @!attribute [rw] zindex - # @return [Fixnum] + # @return [Integer] attr_accessor :zindex # Return a new instance of Vedeu::Views::View. @@ -76,7 +76,7 @@ class DSL # @option attributes parent [Vedeu::Views::Composition] # @option attributes style [Vedeu::Presentation::Style] # @option attributes wordwrap [Boolean] - # @option attributes zindex [Fixnum] + # @option attributes zindex [Integer] # @return [Vedeu::Views::View] def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| diff --git a/test/lib/vedeu/coercers/position_test.rb b/test/lib/vedeu/coercers/position_test.rb index 5c8e9b10d..40a7c6e76 100644 --- a/test/lib/vedeu/coercers/position_test.rb +++ b/test/lib/vedeu/coercers/position_test.rb @@ -40,7 +40,7 @@ module Coercers it { subject.x.must_equal(8) } end - context 'when the value is an Fixnum' do + context 'when the value is an Integer' do let(:_value) { 2 } it { subject.must_be_instance_of(klass) } diff --git a/test/lib/vedeu/common_test.rb b/test/lib/vedeu/common_test.rb index 8aed1d9bf..306accf4a 100644 --- a/test/lib/vedeu/common_test.rb +++ b/test/lib/vedeu/common_test.rb @@ -37,7 +37,7 @@ def undefined_value_test(variable) describe '#absent?' do subject { instance.undefined_value_test(_value) } - context 'when the variable is a Fixnum' do + context 'when the variable is a Integer' do let(:_value) { 17 } it { subject.must_equal(false) } @@ -309,7 +309,7 @@ def undefined_value_test(variable) describe '#present?' do subject { instance.defined_value_test(_value) } - context 'when the variable is a Fixnum' do + context 'when the variable is a Integer' do let(:_value) { 17 } it { subject.must_equal(true) } diff --git a/test/lib/vedeu/distributed/server_test.rb b/test/lib/vedeu/distributed/server_test.rb index 07d16e653..0798f2349 100644 --- a/test/lib/vedeu/distributed/server_test.rb +++ b/test/lib/vedeu/distributed/server_test.rb @@ -226,7 +226,7 @@ module Distributed subject { instance.pid } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it { subject.must_equal(9876) } end diff --git a/test/lib/vedeu/editor/cursor_test.rb b/test/lib/vedeu/editor/cursor_test.rb index 334668f47..c54df1466 100644 --- a/test/lib/vedeu/editor/cursor_test.rb +++ b/test/lib/vedeu/editor/cursor_test.rb @@ -198,7 +198,7 @@ module Editor describe '#x' do subject { instance.x } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } # @todo Add more tests. # it { skip } @@ -207,7 +207,7 @@ module Editor describe '#y' do subject { instance.x } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } # @todo Add more tests. # it { skip } diff --git a/test/lib/vedeu/geometries/area/area_test.rb b/test/lib/vedeu/geometries/area/area_test.rb index 178732e77..4b8b7a0e6 100644 --- a/test/lib/vedeu/geometries/area/area_test.rb +++ b/test/lib/vedeu/geometries/area/area_test.rb @@ -306,21 +306,21 @@ module Geometries describe '#centre_y' do subject { instance.centre_y } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it { subject.must_equal(7) } end describe '#centre_x' do subject { instance.centre_x } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it { subject.must_equal(14) } end describe '#height' do subject { instance.height } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } context 'when a starting coordinate and height is given' do let(:y) { 3 } @@ -342,7 +342,7 @@ module Geometries describe '#width' do subject { instance.width } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } # it { subject.must_equal(16) } end @@ -350,7 +350,7 @@ module Geometries describe '#north' do subject { instance.north(offset) } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } context 'with the default offset' do it { subject.must_equal(3) } @@ -372,7 +372,7 @@ module Geometries describe '#east' do subject { instance.east(offset) } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } context 'with the default offset' do it { subject.must_equal(22) } @@ -394,7 +394,7 @@ module Geometries describe '#south' do subject { instance.south(offset) } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } context 'with the default offset' do it { subject.must_equal(10) } @@ -416,7 +416,7 @@ module Geometries describe '#west' do subject { instance.west(offset) } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } context 'with the default offset' do it { subject.must_equal(5) } diff --git a/test/lib/vedeu/models/page_test.rb b/test/lib/vedeu/models/page_test.rb index a498cadff..1ad1450c3 100644 --- a/test/lib/vedeu/models/page_test.rb +++ b/test/lib/vedeu/models/page_test.rb @@ -172,7 +172,7 @@ module Models describe '#size' do subject { instance.size } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } end end # Page diff --git a/test/lib/vedeu/models/row_test.rb b/test/lib/vedeu/models/row_test.rb index 7dec94feb..70f1ddc5c 100644 --- a/test/lib/vedeu/models/row_test.rb +++ b/test/lib/vedeu/models/row_test.rb @@ -130,7 +130,7 @@ module Models describe '#size' do subject { instance.size } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } end end # Row diff --git a/test/lib/vedeu/support/point_test.rb b/test/lib/vedeu/support/point_test.rb index 53a1aa66d..0166d7978 100644 --- a/test/lib/vedeu/support/point_test.rb +++ b/test/lib/vedeu/support/point_test.rb @@ -22,7 +22,7 @@ module Vedeu describe '.coerce' do subject { described.coerce(value: _value, min: min, max: max) } - context 'when :min is not a Fixnum' do + context 'when :min is not a Integer' do let(:min) { :invalid } it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) } @@ -40,7 +40,7 @@ module Vedeu it { subject.must_be_instance_of(Vedeu::Point) } end - context 'when :max is not a Fixnum or Float::INFINITY' do + context 'when :max is not a Integer or Float::INFINITY' do let(:max) { :invalid } it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) } @@ -99,13 +99,13 @@ module Vedeu describe '.valid?' do subject { described.valid?(value: _value, min: min, max: max) } - context 'when the value is not a Fixnum' do + context 'when the value is not a Integer' do let(:_value) { :invalid } it { subject.must_equal(false) } end - context 'when the value is a Fixnum' do + context 'when the value is a Integer' do context 'but the value < min' do let(:_value) { 1 } diff --git a/test/lib/vedeu/support/x_coordinate_test.rb b/test/lib/vedeu/support/x_coordinate_test.rb index e0ee00e9c..8773bd436 100644 --- a/test/lib/vedeu/support/x_coordinate_test.rb +++ b/test/lib/vedeu/support/x_coordinate_test.rb @@ -18,7 +18,7 @@ module Vedeu describe '#d' do subject { instance.d } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -29,7 +29,7 @@ module Vedeu describe '#bd' do subject { instance.bd } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -40,7 +40,7 @@ module Vedeu describe '#bdn' do subject { instance.bdn } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -51,7 +51,7 @@ module Vedeu describe '#d_dn' do subject { instance.d_dn } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end diff --git a/test/lib/vedeu/support/y_coordinate_test.rb b/test/lib/vedeu/support/y_coordinate_test.rb index d371ded4b..a3238ada4 100644 --- a/test/lib/vedeu/support/y_coordinate_test.rb +++ b/test/lib/vedeu/support/y_coordinate_test.rb @@ -18,7 +18,7 @@ module Vedeu describe '#d' do subject { instance.d } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -29,7 +29,7 @@ module Vedeu describe '#bd' do subject { instance.bd } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -40,7 +40,7 @@ module Vedeu describe '#bdn' do subject { instance.bdn } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end @@ -51,7 +51,7 @@ module Vedeu describe '#d_dn' do subject { instance.d_dn } - # it { subject.must_be_instance_of(Fixnum) } + # it { subject.must_be_instance_of(Integer) } # it { subject.must_equal() } end diff --git a/test/lib/vedeu/terminal/terminal_test.rb b/test/lib/vedeu/terminal/terminal_test.rb index 49608daa5..938132e33 100644 --- a/test/lib/vedeu/terminal/terminal_test.rb +++ b/test/lib/vedeu/terminal/terminal_test.rb @@ -131,7 +131,7 @@ module Vedeu describe '.centre_y' do subject { described.centre_y } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it 'returns the centre `y` point on the terminal' do subject.must_equal(12) @@ -141,7 +141,7 @@ module Vedeu describe '.centre_x' do subject { described.centre_x } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it 'returns the centre `x` point on the terminal' do subject.must_equal(20) @@ -151,7 +151,7 @@ module Vedeu describe '.origin' do subject { Vedeu::Terminal.origin } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it { subject.must_equal(1) } it { described.must_respond_to(:tx) } it { described.must_respond_to(:ty) } diff --git a/test/lib/vedeu/views/line_test.rb b/test/lib/vedeu/views/line_test.rb index 8f163840f..e38fc4e4c 100644 --- a/test/lib/vedeu/views/line_test.rb +++ b/test/lib/vedeu/views/line_test.rb @@ -113,7 +113,7 @@ module Views describe '#size' do subject { instance.size } - it { subject.must_be_instance_of(Fixnum) } + it { subject.class < Integer } it 'returns the size of the line' do subject.must_equal(53) diff --git a/vedeu.gemspec b/vedeu.gemspec index cf12aa456..bb2f21581 100644 --- a/vedeu.gemspec +++ b/vedeu.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '5.9.0' spec.add_development_dependency 'minitest-reporters', '1.1.9' spec.add_development_dependency 'mocha', '1.1.0' - spec.add_development_dependency 'rubocop', '0.40.0' + spec.add_development_dependency 'rubocop', '0.49.0' spec.add_development_dependency 'simplecov', '0.11.2' spec.add_development_dependency 'simplecov-console', '0.3.0' spec.add_development_dependency 'yard', '0.8.7.6'