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

Fixed typos in code.rb #10

Closed
wants to merge 1 commit into from
Closed
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
20 changes: 10 additions & 10 deletions lib/ansi/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module ANSI

require 'ansi/constants'

# Global variialbe can be used to prevent ANSI codes
# Global varialbe can be used to prevent ANSI codes
# from being used in ANSI's methods that do so to string.
#
# NOTE: This has no effect of methods that return ANSI codes.
Expand All @@ -22,7 +22,7 @@ module ANSI
# ANSI Codes
#
# Ansi::Code module makes it very easy to use ANSI codes.
# These are esspecially nice for beautifying shell output.
# These are especially nice for beautifying shell output.
#
# Ansi::Code.red + "Hello" + Ansi::Code.blue + "World"
# => "\e[31mHello\e[34mWorld"
Expand Down Expand Up @@ -165,10 +165,10 @@ def method_missing(code, *args, &blk)
end

# TODO: How to deal with position codes when $ansi is false?
# Should we reaise an error or just not push the codes?
# Should we raise an error or just not push the codes?
# For now, we will leave this it as is.

# Like +move+ but returns to original positon after
# Like +move+ but returns to original position after
# yielding the block.
def display(line, column=0) #:yield:
result = "\e[s"
Expand All @@ -188,22 +188,22 @@ def move(line, column=0)
"\e[#{line.to_i};#{column.to_i}H"
end

# Move cursor up a specificed number of spaces.
# Move cursor up a specified number of spaces.
def up(spaces=1)
"\e[#{spaces.to_i}A"
end

# Move cursor down a specificed number of spaces.
# Move cursor down a specified number of spaces.
def down(spaces=1)
"\e[#{spaces.to_i}B"
end

# Move cursor left a specificed number of spaces.
# Move cursor left a specified number of spaces.
def left(spaces=1)
"\e[#{spaces.to_i}D"
end

# Move cursor right a specificed number of spaces.
# Move cursor right a specified number of spaces.
def right(spaces=1)
"\e[#{spaces.to_i}C"
end
Expand Down Expand Up @@ -260,7 +260,7 @@ def unansi(string=nil) #:yield:
# Alias for #ansi method.
#
# @deprecated
# Here for backward scompatibility.
# Here for backward compatibility.
alias_method :style, :ansi

# Alias for #unansi method.
Expand All @@ -285,7 +285,7 @@ def unansi(string=nil) #:yield:
# Also resolves :random and :on_random.
#
# @param codes [Array<Symbol,Integer]
# Symbols or integers to covnert to ANSI code.
# Symbols or integers to convert to ANSI code.
#
# @return [String] ANSI code
def code(*codes)
Expand Down