scriptty 0.9.0-java → 1.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/examples/rdispatch/demo-request-dispatcher.rb +138 -0
- data/examples/rdispatch/done_screen.txt +33 -0
- data/examples/rdispatch/login.rb +8 -0
- data/examples/rdispatch/start_screen.txt +33 -0
- data/examples/rdispatch/vim_screen.txt +34 -0
- data/lib/scriptty/expect.rb +3 -1
- data/lib/scriptty/request_dispatcher.rb +241 -0
- metadata +146 -138
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
@@ -0,0 +1,138 @@
|
|
1
|
+
begin
|
2
|
+
require 'sinatra/base'
|
3
|
+
require 'scriptty/request_dispatcher'
|
4
|
+
require 'scriptty/util/transcript/writer'
|
5
|
+
require 'optparse'
|
6
|
+
rescue LoadError
|
7
|
+
retry if require 'rubygems' # try loading rubygems (only once) if necessary
|
8
|
+
raise
|
9
|
+
end
|
10
|
+
|
11
|
+
##
|
12
|
+
## Parse command line
|
13
|
+
##
|
14
|
+
|
15
|
+
options = {}
|
16
|
+
OptionParser.new do |opts|
|
17
|
+
opts.banner = "#{opts.program_name} [options] HOST [PORT]"
|
18
|
+
opts.separator "RequestDispatcher demo"
|
19
|
+
opts.separator ""
|
20
|
+
opts.on("-u", "--user NAME", "Set login username") do |optarg|
|
21
|
+
options[:user] = optarg
|
22
|
+
end
|
23
|
+
opts.on("-p", "--password PASSWORD", "Set login password") do |optarg|
|
24
|
+
options[:password] = optarg
|
25
|
+
end
|
26
|
+
opts.on("--password-file FILE", "Read password from FILE") do |optarg|
|
27
|
+
options[:password] = File.read(optarg).strip.split("\n").first.strip
|
28
|
+
end
|
29
|
+
opts.on("-o", "--output FILE", "Write transcript to FILE") do |optarg|
|
30
|
+
options[:output] = optarg
|
31
|
+
end
|
32
|
+
opts.on("-a", "--append", "Append to transcript instead of overwriting") do |optarg|
|
33
|
+
options[:append] = optarg
|
34
|
+
end
|
35
|
+
end.parse!
|
36
|
+
|
37
|
+
host, port = ARGV
|
38
|
+
unless host
|
39
|
+
$stderr.puts "error: No host specified"
|
40
|
+
exit 1
|
41
|
+
end
|
42
|
+
port ||= 23 # Default port 23
|
43
|
+
|
44
|
+
##
|
45
|
+
## Set up dispatcher
|
46
|
+
##
|
47
|
+
t_writer = options[:output] && ScripTTY::Util::Transcript::Writer.new(File.open(options[:output], options[:append] ? "a" : "w"))
|
48
|
+
DISPATCHER = ScripTTY::RequestDispatcher.new
|
49
|
+
DISPATCHER.after_init(:call) do |e|
|
50
|
+
e.transcript_writer_autoclose = false
|
51
|
+
e.transcript_writer = t_writer
|
52
|
+
e[:username] = options[:user]
|
53
|
+
e[:password] = options[:password]
|
54
|
+
end
|
55
|
+
DISPATCHER.after_init do
|
56
|
+
load_screens "start_screen.txt"
|
57
|
+
load_screens "done_screen.txt"
|
58
|
+
load_screens "vim_screen.txt"
|
59
|
+
init_term "xterm"
|
60
|
+
set_timeout 5.0
|
61
|
+
connect [host, port]
|
62
|
+
eval_script_file "../telnet-nego.rb"
|
63
|
+
eval_script_file "login.rb"
|
64
|
+
end
|
65
|
+
DISPATCHER.before_each_request do
|
66
|
+
# Set the prompt to place "START" in the bottom-right corner of the screen,
|
67
|
+
# and clear the screen.
|
68
|
+
send("PS1=$'\\033[24;75HSTART'; clear\n")
|
69
|
+
|
70
|
+
# Wait for the start screen, then ready the prompt to place "DONE" in the
|
71
|
+
# bottom-right corner of the screen after the next command executes.
|
72
|
+
expect screen(:start_screen)
|
73
|
+
send("PS1=$'\\033[24;76HDONE' ; ")
|
74
|
+
end
|
75
|
+
|
76
|
+
# Start the dispatcher thread
|
77
|
+
DISPATCHER.start
|
78
|
+
|
79
|
+
##
|
80
|
+
## Sinatra webserver configuration
|
81
|
+
##
|
82
|
+
|
83
|
+
class DemoWebServer < Sinatra::Base
|
84
|
+
# Show the version of vim installed
|
85
|
+
get '/vim/version' do
|
86
|
+
version = DISPATCHER.request do
|
87
|
+
send("vim\n")
|
88
|
+
expect screen(:vim_screen)
|
89
|
+
send(":q\n")
|
90
|
+
capture["version"].strip
|
91
|
+
end
|
92
|
+
"Vim version #{version} is installed."
|
93
|
+
end
|
94
|
+
|
95
|
+
# Show the vim splash screen
|
96
|
+
get '/vim/splash' do
|
97
|
+
splash = nil
|
98
|
+
DISPATCHER.request do
|
99
|
+
send("vim\n")
|
100
|
+
expect screen(:vim_screen)
|
101
|
+
splash = term.text
|
102
|
+
send(":q\n")
|
103
|
+
end
|
104
|
+
content_type "text/plain", :charset => "UTF-8"
|
105
|
+
splash.join("\n")
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show the logged in users
|
109
|
+
get '/w' do
|
110
|
+
screen_lines = nil
|
111
|
+
DISPATCHER.request do
|
112
|
+
send("clear ; w\n") # Clear the screen and execute the "w" command
|
113
|
+
expect screen(:done_screen)
|
114
|
+
screen_lines = term.text # Capture the screen lines
|
115
|
+
end
|
116
|
+
content_type "text/plain", :charset => "UTF-8"
|
117
|
+
screen_lines.join("\n")
|
118
|
+
end
|
119
|
+
|
120
|
+
# Index page with links
|
121
|
+
get '/' do
|
122
|
+
<<EOF
|
123
|
+
<html>
|
124
|
+
<head><title>RequestDispatcher demo</title></head>
|
125
|
+
<body>
|
126
|
+
<h1>RequestDispatcher demo</h1>
|
127
|
+
<ul>
|
128
|
+
<li><a href="/vim/version">Vim version</a></li>
|
129
|
+
<li><a href="/vim/splash">Vim splash screen</a></li>
|
130
|
+
<li><a href="/w">Logged in users</a></li>
|
131
|
+
</ul>
|
132
|
+
</body>
|
133
|
+
</html>
|
134
|
+
EOF
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
DemoWebServer.run!
|
@@ -0,0 +1,33 @@
|
|
1
|
+
[done_screen]
|
2
|
+
size: (24, 80)
|
3
|
+
char_cursor: "@"
|
4
|
+
char_ignore: " "
|
5
|
+
text: <<END
|
6
|
+
+--------------------------------------------------------------------------------+
|
7
|
+
| |
|
8
|
+
| |
|
9
|
+
| |
|
10
|
+
| |
|
11
|
+
| |
|
12
|
+
| |
|
13
|
+
| |
|
14
|
+
| |
|
15
|
+
| |
|
16
|
+
| |
|
17
|
+
| |
|
18
|
+
| |
|
19
|
+
| |
|
20
|
+
| |
|
21
|
+
| |
|
22
|
+
| |
|
23
|
+
| |
|
24
|
+
| |
|
25
|
+
| |
|
26
|
+
| |
|
27
|
+
| |
|
28
|
+
| |
|
29
|
+
| |
|
30
|
+
| DONE@|
|
31
|
+
+--------------------------------------------------------------------------------+
|
32
|
+
|
33
|
+
END
|
@@ -0,0 +1,33 @@
|
|
1
|
+
[start_screen]
|
2
|
+
size: (24, 80)
|
3
|
+
char_cursor: "@"
|
4
|
+
char_ignore: "?"
|
5
|
+
text: <<END
|
6
|
+
+--------------------------------------------------------------------------------+
|
7
|
+
| |
|
8
|
+
| |
|
9
|
+
| |
|
10
|
+
| |
|
11
|
+
| |
|
12
|
+
| |
|
13
|
+
| |
|
14
|
+
| |
|
15
|
+
| |
|
16
|
+
| |
|
17
|
+
| |
|
18
|
+
| |
|
19
|
+
| |
|
20
|
+
| |
|
21
|
+
| |
|
22
|
+
| |
|
23
|
+
| |
|
24
|
+
| |
|
25
|
+
| |
|
26
|
+
| |
|
27
|
+
| |
|
28
|
+
| |
|
29
|
+
| |
|
30
|
+
| START@|
|
31
|
+
+--------------------------------------------------------------------------------+
|
32
|
+
|
33
|
+
END
|
@@ -0,0 +1,34 @@
|
|
1
|
+
[vim_screen]
|
2
|
+
size: (24, 80)
|
3
|
+
cursor_pos: (0, 0)
|
4
|
+
char_ignore: "?"
|
5
|
+
char_field: "#"
|
6
|
+
text: <<END
|
7
|
+
+--------------------------------------------------------------------------------+
|
8
|
+
| |
|
9
|
+
|~ |
|
10
|
+
|~ |
|
11
|
+
|~ |
|
12
|
+
|~ |
|
13
|
+
|~ |
|
14
|
+
|~ VIM - Vi IMproved |
|
15
|
+
|~ |
|
16
|
+
|~ version ############# | ("version")
|
17
|
+
|~ by Bram Moolenaar et al. |
|
18
|
+
|~ Vim is open source and freely distributable |
|
19
|
+
|~ |
|
20
|
+
|~ ??????????????????????????????????????????????? |
|
21
|
+
|~ ??????????????????????????????????????????????? |
|
22
|
+
|~ ??????????????????????????????????????????????? |
|
23
|
+
|~ ??????????????????????????????????????????????? |
|
24
|
+
|~ ??????????????????????????????????????????????? |
|
25
|
+
|~ ??????????????????????????????????????????????? |
|
26
|
+
|~ ??????????????????????????????????????????????? |
|
27
|
+
|~ ??????????????????????????????????????????????? |
|
28
|
+
|~ |
|
29
|
+
|~ |
|
30
|
+
|~ |
|
31
|
+
| 0,0-1 All |
|
32
|
+
+--------------------------------------------------------------------------------+
|
33
|
+
|
34
|
+
END
|
data/lib/scriptty/expect.rb
CHANGED
@@ -36,6 +36,7 @@ module ScripTTY
|
|
36
36
|
alias match capture # "match" is the deprecated name for "capture"
|
37
37
|
|
38
38
|
attr_accessor :transcript_writer # Set this to an instance of ScripTTY::Util::Transcript::Writer
|
39
|
+
attr_accessor :transcript_writer_autoclose # Set this to false to disable closing transcript_writer on exit
|
39
40
|
|
40
41
|
# Initialize the Expect object.
|
41
42
|
def initialize(options={})
|
@@ -51,6 +52,7 @@ module ScripTTY
|
|
51
52
|
@timeout = nil
|
52
53
|
@timeout_timer = nil
|
53
54
|
@transcript_writer = options[:transcript_writer]
|
55
|
+
@transcript_writer_autoclose = options[:transcript_writer_autoclose].nil? ? true : options[:transcript_writer_autoclose]
|
54
56
|
@screen_patterns = {}
|
55
57
|
end
|
56
58
|
|
@@ -271,7 +273,7 @@ module ScripTTY
|
|
271
273
|
@transcript_writer.info("Script executing command", "exit") if @transcript_writer
|
272
274
|
@net.exit
|
273
275
|
dispatch until @net.done?
|
274
|
-
@transcript_writer.close if @transcript_writer
|
276
|
+
@transcript_writer.close if @transcript_writer && @transcript_writer_autoclose
|
275
277
|
end
|
276
278
|
|
277
279
|
# Generate a ScreenPattern from the current terminal state, and optionally
|
@@ -0,0 +1,241 @@
|
|
1
|
+
# = Request dispatcher
|
2
|
+
# Copyright (C) 2010 Infonium Inc.
|
3
|
+
#
|
4
|
+
# This file is part of ScripTTY.
|
5
|
+
#
|
6
|
+
# ScripTTY is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Lesser General Public License as published
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# ScripTTY is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Lesser General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License
|
17
|
+
# along with ScripTTY. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#
|
19
|
+
# = Documentation
|
20
|
+
# See the documentation for the RequestDispatcher for more information.
|
21
|
+
|
22
|
+
require 'scriptty/expect'
|
23
|
+
require 'thread'
|
24
|
+
|
25
|
+
module ScripTTY
|
26
|
+
|
27
|
+
# Request dispatcher thread
|
28
|
+
#
|
29
|
+
# RequestDispatcher allows a single ScripTTY instance to maintain a
|
30
|
+
# single, persistent connection to a remote host while multiple threads
|
31
|
+
# perform requests via that connection.
|
32
|
+
#
|
33
|
+
# RequestDispatcher can be used, for example, to provide an HTTP interface to
|
34
|
+
# functions of a screen-scraped terminal.
|
35
|
+
class RequestDispatcher
|
36
|
+
def initialize
|
37
|
+
# Graceful shutdown flag
|
38
|
+
@finishing_lock = Mutex.new
|
39
|
+
@finishing = false
|
40
|
+
|
41
|
+
# Request queue
|
42
|
+
@queue_lock = Mutex.new
|
43
|
+
@queue = []
|
44
|
+
|
45
|
+
# Hooks
|
46
|
+
@hooks_lock = Mutex.new
|
47
|
+
@hooks = {}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Specify a block that will be called every time a new ScripTTY::Expect object is initialized.
|
51
|
+
#
|
52
|
+
# This can be used to specify a transcript_writer or to execute a login script.
|
53
|
+
#
|
54
|
+
# See the add_hook method for a descripton of how the arguments are interpreted.
|
55
|
+
def after_init(how=nil, &block)
|
56
|
+
add_hook(:after_init, how, &block)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Add a block that will be called just before finally disconnecting, when the finish method is called.
|
60
|
+
#
|
61
|
+
# See the add_hook method for a descripton of how the arguments are interpreted.
|
62
|
+
def before_finish(how=nil, &block)
|
63
|
+
add_hook(:before_finish, how, &block)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Add a block that will be called before each request is performed.
|
67
|
+
#
|
68
|
+
# See the add_hook method for a descripton of how the arguments are interpreted.
|
69
|
+
def before_each_request(how=nil, &block)
|
70
|
+
add_hook(:before_each_request, how, &block)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Add a block that will be called before each request is performed.
|
74
|
+
#
|
75
|
+
# See the add_hook method for a descripton of how the arguments are interpreted.
|
76
|
+
def after_each_request(how=nil, &block)
|
77
|
+
add_hook(:after_each_request, how, &block)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Start the dispatcher thread
|
81
|
+
def start
|
82
|
+
raise ArgumentError.new("Already started") if @thread
|
83
|
+
@thread = Thread.new{ main }
|
84
|
+
nil
|
85
|
+
end
|
86
|
+
|
87
|
+
# Stop the dispatcher thread
|
88
|
+
def finish
|
89
|
+
@finishing_lock.synchronize{ @finishing = true }
|
90
|
+
@thread.join
|
91
|
+
nil
|
92
|
+
end
|
93
|
+
|
94
|
+
# Queue a request and wait for it to complete
|
95
|
+
def request(how=nil, &block)
|
96
|
+
cv_mutex = Mutex.new
|
97
|
+
cv = ConditionVariable.new
|
98
|
+
|
99
|
+
# Build the request
|
100
|
+
request = {:block => block, :cv_mutex => cv_mutex, :cv => cv }
|
101
|
+
|
102
|
+
# Queue the request
|
103
|
+
@queue_lock.synchronize{ @queue << request }
|
104
|
+
|
105
|
+
# Wait for the request to complete
|
106
|
+
cv_mutex.synchronize{ cv.wait(cv_mutex) }
|
107
|
+
|
108
|
+
# Raise an exception if there was any.
|
109
|
+
raise request[:exception] if request[:exception]
|
110
|
+
|
111
|
+
# Return the result
|
112
|
+
request[:result]
|
113
|
+
end
|
114
|
+
|
115
|
+
protected
|
116
|
+
|
117
|
+
def main
|
118
|
+
loop do
|
119
|
+
break if finishing?
|
120
|
+
begin
|
121
|
+
handle_one_request
|
122
|
+
rescue => exc
|
123
|
+
# Log & swallow exception
|
124
|
+
show_exception(exc)
|
125
|
+
close_expect rescue nil # Ignore errors while closing the connection
|
126
|
+
sleep 0.5 # Delay just a tiny bit to keep an exception loop from consuming all available resources.
|
127
|
+
end
|
128
|
+
end
|
129
|
+
execute_hooks(:before_finish)
|
130
|
+
ensure
|
131
|
+
close_expect
|
132
|
+
end
|
133
|
+
|
134
|
+
def handle_one_request
|
135
|
+
ensure_expect_alive
|
136
|
+
until (request = dequeue)
|
137
|
+
return if finishing?
|
138
|
+
idle
|
139
|
+
end
|
140
|
+
|
141
|
+
# Run the before_each_request hooks. If an exception is raised,
|
142
|
+
# put the request back on the queue before re-raising the error.
|
143
|
+
begin
|
144
|
+
execute_hooks(:before_each_request)
|
145
|
+
rescue
|
146
|
+
requeue(request)
|
147
|
+
raise
|
148
|
+
end
|
149
|
+
|
150
|
+
# Execute the request
|
151
|
+
begin
|
152
|
+
request[:result] = block_eval(request[:block_how], &request[:block])
|
153
|
+
rescue => exc
|
154
|
+
show_exception(exc, "in request")
|
155
|
+
request[:exception] = exc
|
156
|
+
close_expect rescue nil
|
157
|
+
end
|
158
|
+
request[:cv_mutex].synchronize { request[:cv].signal }
|
159
|
+
|
160
|
+
# Execute the after_each_request hooks.
|
161
|
+
execute_hooks(:after_each_request)
|
162
|
+
end
|
163
|
+
|
164
|
+
def dequeue
|
165
|
+
@queue_lock.synchronize { @queue.shift }
|
166
|
+
end
|
167
|
+
|
168
|
+
def requeue(request)
|
169
|
+
@queue_lock.synchronize { @queue.unshift(request) }
|
170
|
+
end
|
171
|
+
|
172
|
+
def ensure_expect_alive
|
173
|
+
return if @expect
|
174
|
+
@expect = construct_expect
|
175
|
+
execute_hooks(:after_init)
|
176
|
+
nil
|
177
|
+
end
|
178
|
+
|
179
|
+
def close_expect
|
180
|
+
return unless @expect
|
181
|
+
@expect.exit
|
182
|
+
ensure
|
183
|
+
@expect = nil
|
184
|
+
end
|
185
|
+
|
186
|
+
def finishing?
|
187
|
+
@finishing_lock.synchronize { @finishing }
|
188
|
+
end
|
189
|
+
|
190
|
+
# Add a new hook of the specified type.
|
191
|
+
#
|
192
|
+
# The how argument determines how the block is called:
|
193
|
+
# [:instance_eval]
|
194
|
+
# The block is passed to Expect#instance_eval
|
195
|
+
# [:call]
|
196
|
+
# The block is called normally, and the Expect object is passed as its
|
197
|
+
# first argument.
|
198
|
+
#
|
199
|
+
# Hooks are executed in the order that they are set.
|
200
|
+
def add_hook(type, how, &block)
|
201
|
+
@hooks_lock.synchronize{
|
202
|
+
@hooks[type] ||= []
|
203
|
+
@hooks[type] << [how, block]
|
204
|
+
}
|
205
|
+
nil
|
206
|
+
end
|
207
|
+
|
208
|
+
def execute_hooks(type)
|
209
|
+
@hooks_lock.synchronize{ (@hooks[type] || []).dup }.each do |how, block|
|
210
|
+
block_eval(how, &block)
|
211
|
+
end
|
212
|
+
nil
|
213
|
+
end
|
214
|
+
|
215
|
+
def block_eval(how, &block)
|
216
|
+
case how # how specifies how the block will be called.
|
217
|
+
when :instance_eval, nil
|
218
|
+
@expect.instance_eval(&block)
|
219
|
+
when :call
|
220
|
+
block.call(@expect)
|
221
|
+
else
|
222
|
+
raise ArgumentError.new("Unsupported how: #{how.inspect}")
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def construct_expect
|
227
|
+
ScripTTY::Expect.new
|
228
|
+
end
|
229
|
+
|
230
|
+
def idle
|
231
|
+
@expect.sleep(0.1)
|
232
|
+
end
|
233
|
+
|
234
|
+
def show_exception(exc, context=nil)
|
235
|
+
output = ["Exception #{context || "in #{self}"}: #{exc} (#{exc.class.name})"]
|
236
|
+
output += exc.backtrace.map { |line| " #{line}" }
|
237
|
+
$stderr.puts output.join("\n")
|
238
|
+
true # true means to re-raise the exception
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
metadata
CHANGED
@@ -3,44 +3,44 @@ name: scriptty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 0.
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
10
|
platform: java
|
11
11
|
authors:
|
12
|
-
|
12
|
+
- Dwayne Litzenberger
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-13 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
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
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: treetop
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: multibyte
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
44
44
|
description: |
|
45
45
|
ScripTTY is a JRuby application and library that lets you control full-screen
|
46
46
|
terminal applications using an expect-like scripting language and a full-screen
|
@@ -48,111 +48,117 @@ description: |
|
|
48
48
|
|
49
49
|
email: dlitz@infonium.ca
|
50
50
|
executables:
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
- scriptty-capture
|
52
|
+
- scriptty-dump-screens
|
53
|
+
- scriptty-replay
|
54
|
+
- scriptty-term-test
|
55
|
+
- scriptty-transcript-parse
|
56
56
|
extensions: []
|
57
57
|
|
58
58
|
extra_rdoc_files:
|
59
|
-
|
59
|
+
- README.rdoc
|
60
60
|
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
|
-
|
61
|
+
- .gitattributes
|
62
|
+
- .gitignore
|
63
|
+
- COPYING
|
64
|
+
- COPYING.LESSER
|
65
|
+
- README.rdoc
|
66
|
+
- Rakefile
|
67
|
+
- VERSION
|
68
|
+
- bin/scriptty-capture
|
69
|
+
- bin/scriptty-dump-screens
|
70
|
+
- bin/scriptty-replay
|
71
|
+
- bin/scriptty-term-test
|
72
|
+
- bin/scriptty-transcript-parse
|
73
|
+
- examples/captures/xterm-overlong-line-prompt.bin
|
74
|
+
- examples/captures/xterm-vim-session.bin
|
75
|
+
- examples/demo-capture.rb
|
76
|
+
- examples/demo-telnet-session-screens.txt
|
77
|
+
- examples/demo-telnet-session.rb
|
78
|
+
- examples/rdispatch/demo-request-dispatcher.rb
|
79
|
+
- examples/rdispatch/done_screen.txt
|
80
|
+
- examples/rdispatch/login.rb
|
81
|
+
- examples/rdispatch/start_screen.txt
|
82
|
+
- examples/rdispatch/vim_screen.txt
|
83
|
+
- examples/telnet-nego.rb
|
84
|
+
- lib/scriptty/apps/capture_app.rb
|
85
|
+
- lib/scriptty/apps/dump_screens_app.rb
|
86
|
+
- lib/scriptty/apps/replay_app.rb
|
87
|
+
- lib/scriptty/apps/term_test_app.rb
|
88
|
+
- lib/scriptty/apps/transcript_parse_app.rb
|
89
|
+
- lib/scriptty/cursor.rb
|
90
|
+
- lib/scriptty/exception.rb
|
91
|
+
- lib/scriptty/expect.rb
|
92
|
+
- lib/scriptty/multiline_buffer.rb
|
93
|
+
- lib/scriptty/net/console.rb
|
94
|
+
- lib/scriptty/net/event_loop.rb
|
95
|
+
- lib/scriptty/net/password_prompt.rb
|
96
|
+
- lib/scriptty/request_dispatcher.rb
|
97
|
+
- lib/scriptty/screen_pattern.rb
|
98
|
+
- lib/scriptty/screen_pattern/generator.rb
|
99
|
+
- lib/scriptty/screen_pattern/parser.rb
|
100
|
+
- lib/scriptty/term.rb
|
101
|
+
- lib/scriptty/term/dg410.rb
|
102
|
+
- lib/scriptty/term/dg410/dg410-client-escapes.txt
|
103
|
+
- lib/scriptty/term/dg410/dg410-escapes.txt
|
104
|
+
- lib/scriptty/term/dg410/parser.rb
|
105
|
+
- lib/scriptty/term/xterm.rb
|
106
|
+
- lib/scriptty/term/xterm/xterm-escapes.txt
|
107
|
+
- lib/scriptty/util/fsm.rb
|
108
|
+
- lib/scriptty/util/fsm/definition_parser.rb
|
109
|
+
- lib/scriptty/util/fsm/scriptty_fsm_definition.treetop
|
110
|
+
- lib/scriptty/util/transcript/reader.rb
|
111
|
+
- lib/scriptty/util/transcript/writer.rb
|
112
|
+
- test.watchr
|
113
|
+
- test/apps/capture_app_test.rb
|
114
|
+
- test/apps/transcript_parse_app_test.rb
|
115
|
+
- test/cursor_test.rb
|
116
|
+
- test/expect/screens.txt
|
117
|
+
- test/expect_test.rb
|
118
|
+
- test/fsm_definition_parser_test.rb
|
119
|
+
- test/fsm_test.rb
|
120
|
+
- test/multiline_buffer_test.rb
|
121
|
+
- test/net/event_loop_test.rb
|
122
|
+
- test/screen_pattern/generator_test.rb
|
123
|
+
- test/screen_pattern/parser_test.rb
|
124
|
+
- test/screen_pattern/parser_test/explicit_cursor_pattern.txt
|
125
|
+
- test/screen_pattern/parser_test/explicit_fields.txt
|
126
|
+
- test/screen_pattern/parser_test/multiple_patterns.txt
|
127
|
+
- test/screen_pattern/parser_test/simple_pattern.txt
|
128
|
+
- test/screen_pattern/parser_test/truncated_heredoc.txt
|
129
|
+
- test/screen_pattern/parser_test/utf16bebom_pattern.bin
|
130
|
+
- test/screen_pattern/parser_test/utf16lebom_pattern.bin
|
131
|
+
- test/screen_pattern/parser_test/utf8_pattern.bin
|
132
|
+
- test/screen_pattern/parser_test/utf8_unix_pattern.bin
|
133
|
+
- test/screen_pattern/parser_test/utf8bom_pattern.bin
|
134
|
+
- test/term/dg410/parser_test.rb
|
135
|
+
- test/term/xterm_test.rb
|
136
|
+
- test/test_helper.rb
|
137
|
+
- test/util/transcript/reader_test.rb
|
138
|
+
- test/util/transcript/writer_test.rb
|
133
139
|
has_rdoc: true
|
134
140
|
homepage: http://github.com/infonium/scriptty
|
135
141
|
licenses: []
|
136
142
|
|
137
143
|
post_install_message:
|
138
144
|
rdoc_options:
|
139
|
-
|
145
|
+
- --charset=UTF-8
|
140
146
|
require_paths:
|
141
|
-
|
147
|
+
- lib
|
142
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
143
149
|
requirements:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
segments:
|
153
|
+
- 0
|
154
|
+
version: "0"
|
149
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
156
|
requirements:
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
156
162
|
requirements: []
|
157
163
|
|
158
164
|
rubyforge_project:
|
@@ -161,21 +167,23 @@ signing_key:
|
|
161
167
|
specification_version: 3
|
162
168
|
summary: write expect-like script to control full-screen terminal-based applications
|
163
169
|
test_files:
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
170
|
+
- test/apps/capture_app_test.rb
|
171
|
+
- test/apps/transcript_parse_app_test.rb
|
172
|
+
- test/cursor_test.rb
|
173
|
+
- test/expect_test.rb
|
174
|
+
- test/fsm_definition_parser_test.rb
|
175
|
+
- test/fsm_test.rb
|
176
|
+
- test/multiline_buffer_test.rb
|
177
|
+
- test/net/event_loop_test.rb
|
178
|
+
- test/screen_pattern/generator_test.rb
|
179
|
+
- test/screen_pattern/parser_test.rb
|
180
|
+
- test/term/dg410/parser_test.rb
|
181
|
+
- test/term/xterm_test.rb
|
182
|
+
- test/test_helper.rb
|
183
|
+
- test/util/transcript/reader_test.rb
|
184
|
+
- test/util/transcript/writer_test.rb
|
185
|
+
- examples/demo-capture.rb
|
186
|
+
- examples/demo-telnet-session.rb
|
187
|
+
- examples/rdispatch/demo-request-dispatcher.rb
|
188
|
+
- examples/rdispatch/login.rb
|
189
|
+
- examples/telnet-nego.rb
|