tty-live 0.1.0 → 0.1.1
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/README.md +11 -2
- data/lib/tty-live.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fba6bbafda7b09d7960fbe8033bc1b992c64a1e9ecfc7962873024708530aea4
|
|
4
|
+
data.tar.gz: f311ffa18446c6c87763d7260f26f9a615566c21aa8b8831ae1800b0169d8c8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 166c585265a4c6e928abe410200126b615138d69f778f2462ec370fbbdcce88d924d6c620d29c997499e5670903cb0100b80a15b250f4e1310fe2685605c3c17
|
|
7
|
+
data.tar.gz: 7ac3efec4ca3ebf29c32eab5aff5a610778748ac440ec303655e8389942c5c6869181ac9e9ba482fcc13792b5c5904f36ddd9767e0f97077f8aa88b719a98a9f
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TTY::Live
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a wrapper for `TTY::Cursor` to help you refresh console.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -17,6 +17,8 @@ gem install tty-live
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
+
require 'tty-live'
|
|
21
|
+
|
|
20
22
|
live = TTY::Live.new
|
|
21
23
|
|
|
22
24
|
10.times do
|
|
@@ -28,6 +30,13 @@ end
|
|
|
28
30
|
puts
|
|
29
31
|
```
|
|
30
32
|
|
|
33
|
+
And you can access `TTY::Cursor`'s methods through `TTY::Live` instance:
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
# same as `print TTY::Cursor.up(5) + TTY::Cursor.forward(2)`
|
|
37
|
+
print live.up(5) + live.forward(2)
|
|
38
|
+
```
|
|
39
|
+
|
|
31
40
|
## Development
|
|
32
41
|
|
|
33
42
|
Follow your heart.
|
data/lib/tty-live.rb
CHANGED
|
@@ -2,7 +2,7 @@ require 'tty-cursor'
|
|
|
2
2
|
|
|
3
3
|
module TTY
|
|
4
4
|
class Live
|
|
5
|
-
VERSION = "0.1.
|
|
5
|
+
VERSION = "0.1.1"
|
|
6
6
|
|
|
7
7
|
def initialize
|
|
8
8
|
@line_count = 0
|
|
@@ -13,5 +13,11 @@ module TTY
|
|
|
13
13
|
@line_count = str.count("\n")
|
|
14
14
|
print str
|
|
15
15
|
end
|
|
16
|
+
|
|
17
|
+
Cursor.methods(false).each do |m|
|
|
18
|
+
define_method(m) do |*args|
|
|
19
|
+
Cursor.send(m, *args)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
16
22
|
end
|
|
17
23
|
end
|