Compare commits
No commits in common. "master" and "v0.1.0" have entirely different histories.
6 changed files with 7 additions and 12 deletions
|
@ -2,7 +2,7 @@ require "../src/spinner"
|
||||||
require "colorize"
|
require "colorize"
|
||||||
|
|
||||||
chars = Spinner::Charset[:arrow].map do |c|
|
chars = Spinner::Charset[:arrow].map do |c|
|
||||||
c.colorize(:light_green).to_s
|
c.colorize(:light_green)
|
||||||
end
|
end
|
||||||
|
|
||||||
spin = Spin.new(0.2, chars)
|
spin = Spin.new(0.2, chars)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
require "../src/spinner"
|
require "../src/spinner"
|
||||||
require "colorize"
|
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|
|
chars = colors.map do |color|
|
||||||
".xXx.".colorize(color).to_s
|
".xXx.".colorize(color)
|
||||||
end
|
end
|
||||||
|
|
||||||
spin = Spin.new(0.01, chars)
|
spin = Spin.new(0.01, chars)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: spinner
|
name: spinner
|
||||||
version: 0.1.1
|
version: 0.1.0
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Aşkın Gedik <askn@bil.omu.edu.tr>
|
- Aşkın Gedik <askn@bil.omu.edu.tr>
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
require "./spinner/*"
|
require "./spinner/*"
|
||||||
|
|
||||||
class Spin
|
class Spin
|
||||||
property delay
|
property delay, chars
|
||||||
property chars : Array(String)
|
|
||||||
|
|
||||||
CL = STDOUT.tty? ? "\u001b[0G" : "\u000d \u000d"
|
CL = STDOUT.tty? ? "\u001b[0G" : "\u000d \u000d"
|
||||||
CLEAR = STDOUT.tty? ? "\u001b[2K" : "\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
|
@state = true
|
||||||
@chars = chars.to_a
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def stop
|
def stop
|
||||||
|
|
|
@ -31,9 +31,6 @@ module Spinner
|
||||||
progress1: {"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"},
|
progress1: {"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"},
|
||||||
progress2: {"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"},
|
progress2: {"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"},
|
||||||
progress3: {"[ ]", "[=> ]", "[===> ]", "[=====> ]", "[======> ]", "[========> ]", "[==========> ]", "[============> ]", "[==============> ]", "[================> ]", "[==================> ]", "[===================>]"},
|
progress3: {"[ ]", "[=> ]", "[===> ]", "[=====> ]", "[======> ]", "[========> ]", "[==========> ]", "[============> ]", "[==============> ]", "[================> ]", "[==================> ]", "[===================>]"},
|
||||||
pulsate1: {"█▒▒▒▒▒▒▒▒▒", "▒█▒▒▒▒▒▒▒▒", "▒▒█▒▒▒▒▒▒▒", "▒▒▒█▒▒▒▒▒▒", "▒▒▒▒█▒▒▒▒▒", "▒▒▒▒▒█▒▒▒▒", "▒▒▒▒▒▒█▒▒▒", "▒▒▒▒▒▒▒█▒▒", "▒▒▒▒▒▒▒▒█▒", "▒▒▒▒▒▒▒▒▒█", "▒▒▒▒▒▒▒▒█▒", "▒▒▒▒▒▒▒█▒▒", "▒▒▒▒▒▒█▒▒▒", "▒▒▒▒▒█▒▒▒▒", "▒▒▒▒█▒▒▒▒▒", "▒▒▒█▒▒▒▒▒▒", "▒▒█▒▒▒▒▒▒▒", "▒█▒▒▒▒▒▒▒▒"},
|
|
||||||
pulsate2: {"[= ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ =]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]", "[ = ]"},
|
|
||||||
pulsate3: {"= ", "== ", "=== ", "==== ", "===== ", "====== ", "======= ", "========", " =======", " ======", " =====", " ====", " ===", " ==", " =", " ==", " ===", " ====", " =====", " ======", " =======", "========", "======= ", "====== ", "===== ", "==== ", "=== ", "== "},
|
|
||||||
fish: {">))'> ", " >))'> ", " >))'> ", " >))'> ", " >))'>", " <'((<", " <'((< ", " <'((< ", " <'((< ", "<'((< "},
|
fish: {">))'> ", " >))'> ", " >))'> ", " >))'> ", " >))'>", " <'((<", " <'((< ", " <'((< ", " <'((< ", "<'((< "},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
module Spinner
|
module Spinner
|
||||||
VERSION = "0.1.1"
|
VERSION = "0.1.0"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue