ttytest2 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1d11e60e54ba7d4b267d4b51d0fedeeade66563ac9957dd652b4fb94e57ed4b
4
- data.tar.gz: 568127f476a6fbed14d5288e4a07dddfa5512a9b050c9a31bd7071c92b7a90dc
3
+ metadata.gz: 196acc1f485c7ad416fbdbe07c94f0829bfb53a57c852a85bf79d72655f4debb
4
+ data.tar.gz: a2afc1f836dff32a2e2aa53a90137ce9bd768a20907855defae05da66af821e4
5
5
  SHA512:
6
- metadata.gz: 78b47ae1254de6020012e16e1825f2d43d5fe5ef36eb8c7deb141023e6a33616561f8794a02b79113963aa290e2c7b30df8fc0e73c0d4adf1c59de093ed70973
7
- data.tar.gz: 2b9da01bb485487eb5e060a8a69ae9d7e989c5d5be1f873efe94a287773d0abc1106fd16002f88343c012d21a28642421ec0c8cbf222f886bcc32580abdd0154
6
+ metadata.gz: 762f9246cadb92d30ef2d8535b135cb9d72270d8e24bc100c8d18e18ecdd949e35560a7ff6fdc3b413a7dffbacbef56cf712c0b459b4cc3f8f7797dbfeca61d3
7
+ data.tar.gz: 2e099fda420602c981073d9cb39d9be307e261086ac8682ec4b213b6a061eded99a9ccff73df9e6c16a9157676fc4dea03a33d834d643fcfdf63631090807156
data/README.md CHANGED
@@ -137,17 +137,20 @@ Helper functions to make sending output easier! They use the methods above under
137
137
  * `send_down_arrows(number_of_times)`
138
138
  * `send_home` # simulate pressing the Home key
139
139
  * `send_end` # simulate pressing the End key
140
+ * `send_clear` # clear the screen by sending clear ascii code
140
141
 
141
142
  ### Troubleshooting
142
143
 
143
144
  You can use the method rows to get all rows of the terminal as an array, of use the method capture to get the contents of the terminal window. This can be useful when troubleshooting.
144
145
 
145
146
  ``` ruby
146
- p @tty.rows # prints out the contents of the terminal as a array
147
- @tty.print_rows # equivalent to above
147
+ # you can use @tty.rows to access the entire pane, split by line into an array.
148
+ p @tty.rows # prints out the contents of the terminal as a array.
149
+ @tty.print_rows # equivalent to above, just for ease of use.
148
150
 
149
- puts "\n#{@tty.capture}" # prints out the contents of the terminal
150
- @tty.print # equivalent to above
151
+ # you can use @tty.capture to access the entire pane.
152
+ p "\n#{@tty.capture}" # prints out the contents of the terminal
153
+ @tty.print # equivalent to above, just for ease of use.
151
154
  ```
152
155
 
153
156
  ### Constants
@@ -14,5 +14,5 @@ module TTYtest
14
14
  RIGHT_ARROW = "#{ESCAPE}[C".freeze
15
15
  LEFT_ARROW = "#{ESCAPE}[D".freeze
16
16
 
17
- CLEAR = 'clear'
17
+ CLEAR = "#{ESCAPE}[2J".freeze
18
18
  end
@@ -75,8 +75,8 @@ module TTYtest
75
75
  :send_backspace, :send_backspaces,
76
76
  :send_left_arrow, :send_left_arrows, :send_right_arrow, :send_right_arrows,
77
77
  :send_down_arrow, :send_down_arrows, :send_up_arrow, :send_up_arrows,
78
- :send_keys_exact, :send_home, :send_end,
79
- :capture, :print, :print_rows
78
+ :send_keys_exact, :send_home, :send_end, :send_clear,
79
+ :capture
80
80
 
81
81
  # @!method rows
82
82
  # @return [Array<String>]
@@ -102,7 +102,8 @@ module TTYtest
102
102
  # @!method cursor_hidden?
103
103
  # @see Capture#cursor_hidden?
104
104
  # @return [true,false]
105
- def_delegators :capture, :rows, :row,
105
+ def_delegators :capture, :print, :print_rows,
106
+ :rows, :row,
106
107
  :width, :height,
107
108
  :cursor_x, :cursor_y,
108
109
  :cursor_visible?, :cursor_hidden?
@@ -146,6 +146,11 @@ module TTYtest
146
146
  send_keys_exact(%(End))
147
147
  end
148
148
 
149
+ def send_clear
150
+ send_keys_one_at_a_time(TTYtest::CLEAR)
151
+ send_newline
152
+ end
153
+
149
154
  private
150
155
 
151
156
  attr_reader :driver, :name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TTYtest
4
- VERSION = '0.9.5'
4
+ VERSION = '0.9.6'
5
5
  end
data/notes.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  to push new version to github
2
- git tag v0.9.5
2
+ git tag v0.9.6
3
3
  git push origin --tags
4
4
 
5
5
  to push new version to rubygems.org
6
6
  gem build ttytest2.gemspec
7
- gem push ttytest2-0.9.5.gem
7
+ gem push ttytest2-0.9.6.gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttytest2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Eski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-29 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler