scriptty 1.2.0-java → 1.3.0-java
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.
- data/VERSION +1 -1
- data/lib/scriptty/expect.rb +4 -2
- data/lib/scriptty/request_dispatcher.rb +1 -1
- data/test/expect_test.rb +41 -0
- data/test/request_dispatcher_test.rb +14 -0
- data/test/util/transcript/writer_test.rb +1 -0
- metadata +158 -150
- data/.gitignore +0 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/scriptty/expect.rb
CHANGED
@@ -176,8 +176,10 @@ module ScripTTY
|
|
176
176
|
end
|
177
177
|
|
178
178
|
# Sleep for the specified number of seconds
|
179
|
-
|
180
|
-
|
179
|
+
#
|
180
|
+
# Pass :transcribe=>false to this method to suppress output to the transcript.
|
181
|
+
def sleep(seconds, options={})
|
182
|
+
@transcript_writer.info("Script executing command", "sleep", seconds.inspect) if @transcript_writer and options[:transcribe] != false
|
181
183
|
sleep_done = false
|
182
184
|
@net.timer(seconds) { sleep_done = true ; @net.suspend }
|
183
185
|
dispatch until sleep_done
|
data/test/expect_test.rb
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
require File.dirname(__FILE__) + "/test_helper.rb"
|
19
19
|
require 'scriptty/expect'
|
20
20
|
require 'scriptty/net/event_loop'
|
21
|
+
require 'scriptty/util/transcript/writer'
|
22
|
+
require 'stringio'
|
21
23
|
|
22
24
|
class ExpectTest < Test::Unit::TestCase
|
23
25
|
|
@@ -65,5 +67,44 @@ class ExpectTest < Test::Unit::TestCase
|
|
65
67
|
e.load_screens "screens.txt"
|
66
68
|
assert_not_nil e.screen(:hello_world), "screen should load successfully"
|
67
69
|
end
|
70
|
+
|
71
|
+
def test_sleep_with_and_without_transcribe
|
72
|
+
sio = StringIO.new
|
73
|
+
writer = ScripTTY::Util::Transcript::Writer.new(sio)
|
74
|
+
|
75
|
+
e = ScripTTY::Expect.new
|
76
|
+
e.transcript_writer = writer
|
77
|
+
|
78
|
+
writer.override_timestamp = 1.0
|
79
|
+
e.puts "Normal sleep should output transcript records"
|
80
|
+
e.sleep(0.1)
|
81
|
+
e.sleep(0.1)
|
82
|
+
e.sleep(0.1)
|
83
|
+
|
84
|
+
writer.override_timestamp = 2.0
|
85
|
+
e.puts "sleep with :transcribe=>false should output nothing to the transcript"
|
86
|
+
e.sleep(0.1, :transcribe=>false)
|
87
|
+
e.sleep(0.1, :transcribe=>false)
|
88
|
+
e.sleep(0.1, :transcribe=>false)
|
89
|
+
|
90
|
+
writer.override_timestamp = 3.0
|
91
|
+
e.puts "sleep with :transcribe=>true should output nothing to the transcript"
|
92
|
+
e.sleep(0.1, :transcribe=>true)
|
93
|
+
e.sleep(0.1, :transcribe=>true)
|
94
|
+
e.sleep(0.1, :transcribe=>true)
|
95
|
+
|
96
|
+
expected = <<-'EOF'.strip.split("\n").map{|line| line.strip}.join("\n") + "\n"
|
97
|
+
[1.000] * "puts" "Normal sleep should output transcript records"
|
98
|
+
[1.000] * "Script executing command" "sleep" "0.1"
|
99
|
+
[1.000] * "Script executing command" "sleep" "0.1"
|
100
|
+
[1.000] * "Script executing command" "sleep" "0.1"
|
101
|
+
[2.000] * "puts" "sleep with :transcribe=>false should output nothing to the transcript"
|
102
|
+
[3.000] * "puts" "sleep with :transcribe=>true should output nothing to the transcript"
|
103
|
+
[3.000] * "Script executing command" "sleep" "0.1"
|
104
|
+
[3.000] * "Script executing command" "sleep" "0.1"
|
105
|
+
[3.000] * "Script executing command" "sleep" "0.1"
|
106
|
+
EOF
|
107
|
+
assert_equal expected, sio.string
|
108
|
+
end
|
68
109
|
end
|
69
110
|
end
|
@@ -17,6 +17,8 @@
|
|
17
17
|
# along with ScripTTY. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
require File.dirname(__FILE__) + "/test_helper.rb"
|
19
19
|
require 'scriptty/request_dispatcher'
|
20
|
+
require 'scriptty/util/transcript/writer'
|
21
|
+
require 'stringio'
|
20
22
|
|
21
23
|
class RequestDispatcherTest < Test::Unit::TestCase
|
22
24
|
|
@@ -71,6 +73,18 @@ class RequestDispatcherTest < Test::Unit::TestCase
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
76
|
+
def test_idle_does_not_write_to_transcript
|
77
|
+
sio = StringIO.new
|
78
|
+
@r.after_init {
|
79
|
+
self.transcript_writer = ScripTTY::Util::Transcript::Writer.new(sio)
|
80
|
+
self.transcript_writer.override_timestamp = 88.0
|
81
|
+
}
|
82
|
+
@r.start
|
83
|
+
sleep 0.5
|
84
|
+
@r.finish
|
85
|
+
assert_equal sio.string, %Q([88.000] * "Script executing command" "exit"\n)
|
86
|
+
end
|
87
|
+
|
74
88
|
end
|
75
89
|
end
|
76
90
|
|
metadata
CHANGED
@@ -1,46 +1,51 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scriptty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 1.
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
10
11
|
platform: java
|
11
12
|
authors:
|
12
|
-
|
13
|
+
- Dwayne Litzenberger
|
13
14
|
autorequire:
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-12-07 00:00:00 -05:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: treetop
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: multibyte
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
44
49
|
description: |
|
45
50
|
ScripTTY is a JRuby application and library that lets you control full-screen
|
46
51
|
terminal applications using an expect-like scripting language and a full-screen
|
@@ -48,144 +53,147 @@ description: |
|
|
48
53
|
|
49
54
|
email: dlitz@infonium.ca
|
50
55
|
executables:
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
- scriptty-dump-screens
|
57
|
+
- scriptty-capture
|
58
|
+
- scriptty-transcript-parse
|
59
|
+
- scriptty-replay
|
60
|
+
- scriptty-term-test
|
56
61
|
extensions: []
|
57
62
|
|
58
63
|
extra_rdoc_files:
|
59
|
-
|
64
|
+
- README.rdoc
|
60
65
|
files:
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
- test/util/transcript/writer_test.rb
|
66
|
+
- .gitattributes
|
67
|
+
- COPYING
|
68
|
+
- COPYING.LESSER
|
69
|
+
- README.rdoc
|
70
|
+
- Rakefile
|
71
|
+
- VERSION
|
72
|
+
- bin/scriptty-capture
|
73
|
+
- bin/scriptty-dump-screens
|
74
|
+
- bin/scriptty-replay
|
75
|
+
- bin/scriptty-term-test
|
76
|
+
- bin/scriptty-transcript-parse
|
77
|
+
- examples/captures/xterm-overlong-line-prompt.bin
|
78
|
+
- examples/captures/xterm-vim-session.bin
|
79
|
+
- examples/demo-capture.rb
|
80
|
+
- examples/demo-telnet-session-screens.txt
|
81
|
+
- examples/demo-telnet-session.rb
|
82
|
+
- examples/rdispatch/demo-request-dispatcher.rb
|
83
|
+
- examples/rdispatch/done_screen.txt
|
84
|
+
- examples/rdispatch/login.rb
|
85
|
+
- examples/rdispatch/start_screen.txt
|
86
|
+
- examples/rdispatch/vim_screen.txt
|
87
|
+
- examples/telnet-nego.rb
|
88
|
+
- lib/scriptty/apps/capture_app.rb
|
89
|
+
- lib/scriptty/apps/dump_screens_app.rb
|
90
|
+
- lib/scriptty/apps/replay_app.rb
|
91
|
+
- lib/scriptty/apps/term_test_app.rb
|
92
|
+
- lib/scriptty/apps/transcript_parse_app.rb
|
93
|
+
- lib/scriptty/cursor.rb
|
94
|
+
- lib/scriptty/exception.rb
|
95
|
+
- lib/scriptty/expect.rb
|
96
|
+
- lib/scriptty/multiline_buffer.rb
|
97
|
+
- lib/scriptty/net/console.rb
|
98
|
+
- lib/scriptty/net/event_loop.rb
|
99
|
+
- lib/scriptty/net/password_prompt.rb
|
100
|
+
- lib/scriptty/request_dispatcher.rb
|
101
|
+
- lib/scriptty/screen_pattern.rb
|
102
|
+
- lib/scriptty/screen_pattern/generator.rb
|
103
|
+
- lib/scriptty/screen_pattern/parser.rb
|
104
|
+
- lib/scriptty/term.rb
|
105
|
+
- lib/scriptty/term/dg410.rb
|
106
|
+
- lib/scriptty/term/dg410/dg410-client-escapes.txt
|
107
|
+
- lib/scriptty/term/dg410/dg410-escapes.txt
|
108
|
+
- lib/scriptty/term/dg410/parser.rb
|
109
|
+
- lib/scriptty/term/xterm.rb
|
110
|
+
- lib/scriptty/term/xterm/xterm-escapes.txt
|
111
|
+
- lib/scriptty/util/fsm.rb
|
112
|
+
- lib/scriptty/util/fsm/definition_parser.rb
|
113
|
+
- lib/scriptty/util/fsm/scriptty_fsm_definition.treetop
|
114
|
+
- lib/scriptty/util/transcript/reader.rb
|
115
|
+
- lib/scriptty/util/transcript/writer.rb
|
116
|
+
- test.watchr
|
117
|
+
- test/apps/capture_app_test.rb
|
118
|
+
- test/apps/transcript_parse_app_test.rb
|
119
|
+
- test/cursor_test.rb
|
120
|
+
- test/expect/screens.txt
|
121
|
+
- test/expect_test.rb
|
122
|
+
- test/fsm_definition_parser_test.rb
|
123
|
+
- test/fsm_test.rb
|
124
|
+
- test/multiline_buffer_test.rb
|
125
|
+
- test/net/event_loop_test.rb
|
126
|
+
- test/request_dispatcher_test.rb
|
127
|
+
- test/screen_pattern/generator_test.rb
|
128
|
+
- test/screen_pattern/parser_test.rb
|
129
|
+
- test/screen_pattern/parser_test/explicit_cursor_pattern.txt
|
130
|
+
- test/screen_pattern/parser_test/explicit_fields.txt
|
131
|
+
- test/screen_pattern/parser_test/multiple_patterns.txt
|
132
|
+
- test/screen_pattern/parser_test/simple_pattern.txt
|
133
|
+
- test/screen_pattern/parser_test/truncated_heredoc.txt
|
134
|
+
- test/screen_pattern/parser_test/utf16bebom_pattern.bin
|
135
|
+
- test/screen_pattern/parser_test/utf16lebom_pattern.bin
|
136
|
+
- test/screen_pattern/parser_test/utf8_pattern.bin
|
137
|
+
- test/screen_pattern/parser_test/utf8_unix_pattern.bin
|
138
|
+
- test/screen_pattern/parser_test/utf8bom_pattern.bin
|
139
|
+
- test/term/dg410/parser_test.rb
|
140
|
+
- test/term/xterm_test.rb
|
141
|
+
- test/test_helper.rb
|
142
|
+
- test/util/transcript/reader_test.rb
|
143
|
+
- test/util/transcript/writer_test.rb
|
140
144
|
has_rdoc: true
|
141
145
|
homepage: http://github.com/infonium/scriptty
|
142
146
|
licenses: []
|
143
147
|
|
144
148
|
post_install_message:
|
145
|
-
rdoc_options:
|
146
|
-
|
149
|
+
rdoc_options: []
|
150
|
+
|
147
151
|
require_paths:
|
148
|
-
|
152
|
+
- lib
|
149
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
150
155
|
requirements:
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
156
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
157
164
|
requirements:
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
hash: 3
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
version: "0"
|
163
171
|
requirements: []
|
164
172
|
|
165
173
|
rubyforge_project:
|
166
|
-
rubygems_version: 1.3.
|
174
|
+
rubygems_version: 1.3.7
|
167
175
|
signing_key:
|
168
176
|
specification_version: 3
|
169
177
|
summary: write expect-like script to control full-screen terminal-based applications
|
170
178
|
test_files:
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
179
|
+
- examples/demo-capture.rb
|
180
|
+
- examples/demo-telnet-session.rb
|
181
|
+
- examples/rdispatch/demo-request-dispatcher.rb
|
182
|
+
- examples/rdispatch/login.rb
|
183
|
+
- examples/telnet-nego.rb
|
184
|
+
- test/apps/capture_app_test.rb
|
185
|
+
- test/apps/transcript_parse_app_test.rb
|
186
|
+
- test/cursor_test.rb
|
187
|
+
- test/expect_test.rb
|
188
|
+
- test/fsm_definition_parser_test.rb
|
189
|
+
- test/fsm_test.rb
|
190
|
+
- test/multiline_buffer_test.rb
|
191
|
+
- test/net/event_loop_test.rb
|
192
|
+
- test/request_dispatcher_test.rb
|
193
|
+
- test/screen_pattern/generator_test.rb
|
194
|
+
- test/screen_pattern/parser_test.rb
|
195
|
+
- test/term/dg410/parser_test.rb
|
196
|
+
- test/term/xterm_test.rb
|
197
|
+
- test/test_helper.rb
|
198
|
+
- test/util/transcript/reader_test.rb
|
199
|
+
- test/util/transcript/writer_test.rb
|
data/.gitignore
DELETED