Class: Ronin::PostEx::RemoteProcess
- Includes:
- Enumerable, FakeIO
- Defined in:
- lib/ronin/post_ex/remote_process.rb
Overview
The RemoteProcess class represents a command being executed on a remote
system. The RemoteProcess class wraps around the process_popen
and
process_read
, process_write
, and process_close
methods defined in
the API object.
Instance Attribute Summary collapse
-
#command ⇒ String
readonly
The command string.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(session, command) ⇒ RemoteProcess
constructor
Creates a new remote process.
-
#inspect ⇒ String
Inspects the command.
-
#reopen(command) ⇒ RemoteProcess
Reopens the command.
-
#to_s ⇒ String
Converts the command to a
String
.
Methods inherited from Resource
#interact, #supports, #supports?
Constructor Details
#initialize(session, command) ⇒ RemoteProcess
Creates a new remote process.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ronin/post_ex/remote_process.rb', line 55 def initialize(session,command) unless session.respond_to?(:process_popen) raise(NotImplementedError,"#{session.inspect} must define #process_popen for #{self.class}") end @session = session @command = command super() end |
Instance Attribute Details
#command ⇒ String (readonly)
The command string.
41 42 43 |
# File 'lib/ronin/post_ex/remote_process.rb', line 41 def command @command end |
Instance Method Details
#inspect ⇒ String
Inspects the command.
100 101 102 |
# File 'lib/ronin/post_ex/remote_process.rb', line 100 def inspect "#<#{self.class}: #{self}>" end |
#reopen(command) ⇒ RemoteProcess
Reopens the command.
75 76 77 78 79 80 81 |
# File 'lib/ronin/post_ex/remote_process.rb', line 75 def reopen(command) close @command = command return open end |
#to_s ⇒ String
Converts the command to a String
.
90 91 92 |
# File 'lib/ronin/post_ex/remote_process.rb', line 90 def to_s @command end |