Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #387

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
StyleGuideCopsOnly: false
TargetRubyVersion: 2.3
TargetRubyVersion: 2.4

Lint/Eval:
Security/Eval:
Description: 'The use of eval represents a serious security risk.'
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.4.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.3.1
- 2.4.0
cache: bundler
script: 'bundle exec rake'
sudo: false
4 changes: 2 additions & 2 deletions docs/dsl/by_method/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ the passed block.
later.
@param options [Hash<Symbol => 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.
Expand Down
4 changes: 2 additions & 2 deletions lib/vedeu/borders/caption.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/vedeu/borders/refresh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>]
def build_collection(size, &block)
Expand Down
14 changes: 7 additions & 7 deletions lib/vedeu/borders/title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def value
private

# @param char [String]
# @param x [Fixnum]
# @param x [Integer]
# @return [Hash<Symbol => void>]
def attributes(char, x)
border.attributes.merge(position: Vedeu::Geometries::Position.new(y, x),
Expand Down Expand Up @@ -121,7 +121,7 @@ def empty?
value.empty?
end

# @return [Fixnum]
# @return [Integer]
def end_index
start_index + (size - 1)
end
Expand Down Expand Up @@ -149,7 +149,7 @@ def pad

# Return the size of the padded, truncated value.
#
# @return [Fixnum]
# @return [Integer]
def size
pad.size
end
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/vedeu/buffers/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/vedeu/buffers/clear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/vedeu/buffers/empty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ 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<Array<Vedeu::Cells::Empty>>]
def buffer
@buffer ||= empty
end

# @return [Fixnum]
# @return [Integer]
def height
@height + 1
end

# @return [Fixnum]
# @return [Integer]
def width
@width + 1
end
Expand Down
4 changes: 2 additions & 2 deletions lib/vedeu/buffers/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lib/vedeu/colours/translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ''
Expand Down Expand Up @@ -186,31 +186,31 @@ def css_to_rgb
]
end

# @return [Fixnum]
# @return [Integer]
def css_to_numbered
[16, red, green, blue].inject(:+)
end

# 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

# 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

# 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
Expand Down
12 changes: 6 additions & 6 deletions lib/vedeu/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -94,14 +94,14 @@ 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?
alias Integer? numeric?

# Returns a boolean indicating the value has a position
# attribute.
Expand All @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions lib/vedeu/configuration/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -86,7 +86,7 @@ def compression(value = true)

# Returns the configuration options set up by the API DSL.
#
# @return [Hash<Symbol => Boolean, Fixnum, String>]
# @return [Hash<Symbol => Boolean, Integer, String>]
def configuration
if options[:log].nil? ||
options[:log] == false ||
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading