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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -2
  3. data/lib/tty-live.rb +7 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca83d87b358fbf3af65907c56ce8fadb7a460e8a9073b62f1cdfea1ea9e07f02
4
- data.tar.gz: 4f303f3d0f9f3ab8ff5ba1deea5f5afa5e34fe5144b971ba5dd4f8bc297912c9
3
+ metadata.gz: fba6bbafda7b09d7960fbe8033bc1b992c64a1e9ecfc7962873024708530aea4
4
+ data.tar.gz: f311ffa18446c6c87763d7260f26f9a615566c21aa8b8831ae1800b0169d8c8f
5
5
  SHA512:
6
- metadata.gz: 8f57d8e136cc084f944a31fecc8b0607a6dfdf8dd008d772fc47d3a2387bd544c1f5b2bff973c96d9885a671ab97f8507973e41cdf9236336c02375fbf5d1631
7
- data.tar.gz: 2bcba8f8c0c03b0dc470f502f44bba75b11ebff598966b91f7f7673fcba56d88f935dd1e6d3cb951f0216c04fe5421435bf0b87ba9debb332c0ff73a6e06f2a1
6
+ metadata.gz: 166c585265a4c6e928abe410200126b615138d69f778f2462ec370fbbdcce88d924d6c620d29c997499e5670903cb0100b80a15b250f4e1310fe2685605c3c17
7
+ data.tar.gz: 7ac3efec4ca3ebf29c32eab5aff5a610778748ac440ec303655e8389942c5c6869181ac9e9ba482fcc13792b5c5904f36ddd9767e0f97077f8aa88b719a98a9f
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Tty::Live
1
+ # TTY::Live
2
2
 
3
- Refresh console
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.0"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-live
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - c