Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
21d0b9b73e | ||
|
8a8dbca835 | ||
|
c96b4744b6 | ||
|
847c8294b6 | ||
|
83ea19b0fb | ||
|
f710c617ac | ||
|
df343cb0b2 |
6 changed files with 12 additions and 7 deletions
|
@ -2,7 +2,7 @@ require "../src/spinner"
|
|||
require "colorize"
|
||||
|
||||
chars = Spinner::Charset[:arrow].map do |c|
|
||||
c.colorize(:light_green)
|
||||
c.colorize(:light_green).to_s
|
||||
end
|
||||
|
||||
spin = Spin.new(0.2, chars)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require "../src/spinner"
|
||||
require "colorize"
|
||||
|
||||
colors = {:red, :light_red, :yellow, :green, :light_blue, :blue, :magenta}
|
||||
colors = [:red, :light_red, :yellow, :green, :light_blue, :blue, :magenta]
|
||||
chars = colors.map do |color|
|
||||
".xXx.".colorize(color)
|
||||
".xXx.".colorize(color).to_s
|
||||
end
|
||||
|
||||
spin = Spin.new(0.01, chars)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: spinner
|
||||
version: 0.1.0
|
||||
version: 0.1.1
|
||||
|
||||
authors:
|
||||
- Aşkın Gedik <askn@bil.omu.edu.tr>
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
require "./spinner/*"
|
||||
|
||||
class Spin
|
||||
property delay, chars
|
||||
property delay
|
||||
property chars : Array(String)
|
||||
|
||||
CL = STDOUT.tty? ? "\u001b[0G" : "\u000d \u000d"
|
||||
CLEAR = STDOUT.tty? ? "\u001b[2K" : "\u000d"
|
||||
|
||||
def initialize(@delay = 0.1, @chars = Spinner::Charset[:pipe])
|
||||
def initialize(@delay = 0.1, chars = Spinner::Charset[:pipe])
|
||||
@state = true
|
||||
@chars = chars.to_a
|
||||
end
|
||||
|
||||
def stop
|
||||
|
|
|
@ -31,6 +31,9 @@ module Spinner
|
|||
progress1: {"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"},
|
||||
progress2: {"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"},
|
||||
progress3: {"[ ]", "[=> ]", "[===> ]", "[=====> ]", "[======> ]", "[========> ]", "[==========> ]", "[============> ]", "[==============> ]", "[================> ]", "[==================> ]", "[===================>]"},
|
||||
pulsate1: {"█▒▒▒▒▒▒▒▒▒", "▒█▒▒▒▒▒▒▒▒", "▒▒█▒▒▒▒▒▒▒", "▒▒▒█▒▒▒▒▒▒", "▒▒▒▒█▒▒▒▒▒", "▒▒▒▒▒█▒▒▒▒", "▒▒▒▒▒▒█▒▒▒", "▒▒▒▒▒▒▒█▒▒", "▒▒▒▒▒▒▒▒█▒", "▒▒▒▒▒▒▒▒▒█", "▒▒▒▒▒▒▒▒█▒", "▒▒▒▒▒▒▒█▒▒", "▒▒▒▒▒▒█▒▒▒", "▒▒▒▒▒█▒▒▒▒", "▒▒▒▒█▒▒▒▒▒", "▒▒▒█▒▒▒▒▒▒", "▒▒█▒▒▒▒▒▒▒", "▒█▒▒▒▒▒▒▒▒"},
|
||||
pulsate2: {"[= ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ =]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]"},
|
||||
pulsate3: {"= ", "== ", "=== ", "==== ", "===== ", "====== ", "======= ", "========", " =======", " ======", " =====", " ====", " ===", " ==", " =", " ==", " ===", " ====", " =====", " ======", " =======", "========", "======= ", "====== ", "===== ", "==== ", "=== ", "== "},
|
||||
fish: {">))'> ", " >))'> ", " >))'> ", " >))'> ", " >))'>", " <'((<", " <'((< ", " <'((< ", " <'((< ", "<'((< "},
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Spinner
|
||||
VERSION = "0.1.0"
|
||||
VERSION = "0.1.1"
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue