Class: VertxShell::CommandProcess
- Inherits:
-
Tty
- Object
- Tty
- VertxShell::CommandProcess
show all
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb
Overview
The command process provides interaction with the process of the command provided by Vert.x Shell.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
-
- (Array<String>) args
The actual string arguments of the command.
-
- (Array<::VertxShell::CliToken>) argsTokens
The unparsed arguments tokens.
-
- (self) backgroundHandler(handler) { ... }
Set a background handler, this handler is called when the command is running and put to background.
-
- (::Vertx::CommandLine) commandLine
The command line object or null.
-
- (void) end(*args)
End the process.
-
- (self) endHandler(handler) { ... }
Set an end handler, this handler is called when the command is ended, for instance the command is running and the shell closes.
-
- (true, false) isForeground
True if the command is running in foreground.
-
- (self) foregroundHandler(handler) { ... }
Set a foreground handler, this handler is called when the command is running and put to foreground.
-
- (self) interruptHandler(handler) { ... }
Set an interrupt handler, this handler is called when the command is interrupted, for instance user press Ctrl-C.
-
- (self) resizehandler(handler) { ... }
-
- (self) resumeHandler(handler) { ... }
Set a resume handler, this handler is called when the command is resumed, for instance user types bg or fg to resume the command.
-
- (::VertxShell::Session) session
The shell session.
-
- (self) stdinHandler(handler) { ... }
-
- (self) suspendHandler(handler) { ... }
Set a suspend handler, this handler is called when the command is suspended, for instance user press Ctrl-Z.
-
- (::Vertx::Vertx) vertx
The current Vert.x instance.
-
- (self) write(data)
Write some text to the standard output.
Methods inherited from Tty
#height, #type, #width
Class Method Details
+ (Boolean) accept?(obj)
24
25
26
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 24
def @@j_api_type.accept?(obj)
obj.class == CommandProcess
end
|
+ (Object) j_api_type
33
34
35
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 33
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
36
37
38
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 36
def self.j_class
Java::IoVertxExtShellCommand::CommandProcess.java_class
end
|
+ (Object) unwrap(obj)
30
31
32
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 30
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
27
28
29
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 27
def @@j_api_type.wrap(obj)
CommandProcess.new(obj)
end
|
Instance Method Details
- (Array<String>) args
Returns the actual string arguments of the command
109
110
111
112
113
114
115
116
117
118
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 109
def args
if !block_given?
return @j_del.java_method(:args, []).call().to_a.map { |elt| elt }
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling args()"
end
end
|
Returns the unparsed arguments tokens
97
98
99
100
101
102
103
104
105
106
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 97
def args_tokens
if !block_given?
return @j_del.java_method(:argsTokens, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxShell::CliToken) }
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling args_tokens()"
end
end
|
- (self) backgroundHandler(handler) { ... }
Set a background handler, this handler is called when the command is running and put to background.
123
124
125
126
127
128
129
130
131
132
133
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 123
def background_handler
if true
@j_del.java_method(:backgroundHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling background_handler()"
end
end
|
Returns the command line object or null
214
215
216
217
218
219
220
221
222
223
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 214
def command_line
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:commandLine, []).call(),::Vertx::CommandLine)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling command_line()"
end
end
|
- (void) end
- (void) end(status)
This method returns an undefined value.
End the process.
200
201
202
203
204
205
206
207
208
209
210
211
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 200
def end(*args)
if !block_given? && args[0] == nil
return @j_del.java_method(:end, []).call()
elsif args[0].class == Fixnum && !block_given?
return @j_del.java_method(:end, [Java::int.java_class]).call(args[0])
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling end(#{args[0]})"
end
end
|
- (self) endHandler(handler) { ... }
Set an end handler, this handler is called when the command is ended, for instance the command is running
and the shell closes.
154
155
156
157
158
159
160
161
162
163
164
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 154
def end_handler
if true
@j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling end_handler()"
end
end
|
- (true, false) isForeground
Returns true if the command is running in foreground
241
242
243
244
245
246
247
248
249
250
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 241
def foreground?
if !block_given?
return @j_del.java_method(:isForeground, []).call()
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling foreground?()"
end
end
|
- (self) foregroundHandler(handler) { ... }
Set a foreground handler, this handler is called when the command is running and put to foreground.
138
139
140
141
142
143
144
145
146
147
148
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 138
def foreground_handler
if true
@j_del.java_method(:foregroundHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling foreground_handler()"
end
end
|
- (self) interruptHandler(handler) { ... }
Set an interrupt handler, this handler is called when the command is interrupted, for instance user
press Ctrl-C
.
84
85
86
87
88
89
90
91
92
93
94
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 84
def interrupt_handler
if true
@j_del.java_method(:interruptHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling interrupt_handler()"
end
end
|
- (self) resizehandler(handler) { ... }
254
255
256
257
258
259
260
261
262
263
264
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 254
def resizehandler
if true
@j_del.java_method(:resizehandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling resizehandler()"
end
end
|
- (self) resumeHandler(handler) { ... }
Set a resume handler, this handler is called when the command is resumed, for instance user
types bg
or fg
to resume the command.
56
57
58
59
60
61
62
63
64
65
66
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 56
def resume_handler
if true
@j_del.java_method(:resumeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling resume_handler()"
end
end
|
Returns the shell session
41
42
43
44
45
46
47
48
49
50
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 41
def session
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:session, []).call(),::VertxShell::Session)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling session()"
end
end
|
- (self) stdinHandler(handler) { ... }
184
185
186
187
188
189
190
191
192
193
194
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 184
def stdin_handler
if true
@j_del.java_method(:stdinHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling stdin_handler()"
end
end
|
- (self) suspendHandler(handler) { ... }
Set a suspend handler, this handler is called when the command is suspended, for instance user
press Ctrl-Z
.
170
171
172
173
174
175
176
177
178
179
180
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 170
def suspend_handler
if true
@j_del.java_method(:suspendHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling suspend_handler()"
end
end
|
Returns the current Vert.x instance
69
70
71
72
73
74
75
76
77
78
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 69
def vertx
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:vertx, []).call(),::Vertx::Vertx)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling vertx()"
end
end
|
- (self) write(data)
Write some text to the standard output.
228
229
230
231
232
233
234
235
236
237
238
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_process.rb', line 228
def write(*args)
if args[0].class == String && !block_given?
@j_del.java_method(:write, [Java::java.lang.String.java_class]).call(args[0])
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling write(#{args[0]})"
end
end
|