rbtext 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rbtext/cursor.rb +7 -2
- data/lib/rbtext/screen.rb +18 -0
- data/lib/rbtext.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a729d44ed2a3ab04b78d02b0d0226f3630ed47d789c8534f4f84244eb658395
|
4
|
+
data.tar.gz: 68e66d49346a58ed12ff5fa7bd7c44c9b6ce5a21f647f08be7b46d72acd06e2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 418da7b0d089e55f49fd9de6695899e4aec6f19c86860410d6fe4cc900c94c74658253eaec9f6fa9f13814060415cceaade928a9feae04467d881a01d4625ed4
|
7
|
+
data.tar.gz: db96c6606483f074eaf77990d64e18017b1e5e0f5867cd90f470ae07bb28aada188843ea19999000b310ecf569f41e4fce76919d9640b13fbfb4b869b03d7d90
|
data/lib/rbtext/cursor.rb
CHANGED
@@ -16,15 +16,20 @@ module RBText
|
|
16
16
|
print "\033[#{num.to_i}C"
|
17
17
|
end
|
18
18
|
|
19
|
+
def go_to_pos(x, y)
|
20
|
+
print "\033[#{y};#{x}H"
|
21
|
+
print "\033[#{y};#{x}f"
|
22
|
+
end
|
23
|
+
|
19
24
|
def beginning_of_line
|
20
25
|
print "\r"
|
21
26
|
end
|
22
27
|
|
23
|
-
module_function :up, :down, :left, :right, :beginning_of_line
|
28
|
+
module_function :up, :down, :left, :right, :beginning_of_line, :go_to_pos
|
24
29
|
end
|
25
30
|
|
26
31
|
module Cr
|
27
32
|
include RBText::Cursor
|
28
|
-
module_function :up, :down, :left, :right, :beginning_of_line
|
33
|
+
module_function :up, :down, :left, :right, :beginning_of_line, :go_to_pos
|
29
34
|
end
|
30
35
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RBText
|
2
|
+
module Screen
|
3
|
+
def clear
|
4
|
+
print "\033[2J"
|
5
|
+
end
|
6
|
+
|
7
|
+
def clear_line
|
8
|
+
print "\033[2K"
|
9
|
+
end
|
10
|
+
|
11
|
+
module_function :clear, :clear_line
|
12
|
+
end
|
13
|
+
|
14
|
+
module S
|
15
|
+
include RBText::Screen
|
16
|
+
module_function :clear, :clear_line
|
17
|
+
end
|
18
|
+
end
|
data/lib/rbtext.rb
CHANGED
@@ -2,11 +2,12 @@ require_relative "rbtext/cursor.rb"
|
|
2
2
|
require_relative "rbtext/colors.rb"
|
3
3
|
require_relative "rbtext/formatting.rb"
|
4
4
|
require_relative "rbtext/ftext.rb"
|
5
|
+
require_relative "rbtext/screen.rb"
|
5
6
|
|
6
7
|
module RBText
|
7
8
|
@ver_1 = 0
|
8
9
|
@ver_2 = 0
|
9
|
-
@ver_3 =
|
10
|
+
@ver_3 = 6
|
10
11
|
|
11
12
|
def version
|
12
13
|
"#{@ver_1}.#{@ver_2}.#{@ver_3}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbtext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Lee
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- lib/rbtext/cursor.rb
|
22
22
|
- lib/rbtext/formatting.rb
|
23
23
|
- lib/rbtext/ftext.rb
|
24
|
+
- lib/rbtext/screen.rb
|
24
25
|
homepage: https://github.com/Matthiasclee/RBText
|
25
26
|
licenses:
|
26
27
|
- AGPL-3.0
|