Module: Cheri::Explorer

Defined in:
lib/cheri/explorer/explorer.rb

Overview

WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Classes: ConstRec, MethodRec, NameTypeValue, NameValue, ObjectRec, RubyExplorer, SearchArgs, SearchNameValue, SearchResults, ValueType

Class Method Summary collapse

Class Method Details

.start(port) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/cheri/explorer/explorer.rb', line 48

def self.start(port)
  if (server = @server)
    raise "server active -- call stop first" if server.alive?
    server.stop_service rescue nil
    server.thread.kill rescue nil
  end
  @explorer = RubyExplorer.new
  @server = DRb::DRbServer.new("druby://localhost:#{port}",@explorer)
  puts "Cheri::Explorer started on port #{port}\n"
  STDERR.puts %{
 WARNING! This server can expose sensitive information about the Ruby instance
 in which it runs, including file/directory paths, configuration information,
 and, if ObjectSpace is enabled, any object that has not been garbage-collected.
 If you have not taken adequate precautions to secure this installation, such as,
 but not limited to, firewalls, secure network access, and access control lists,
 you should terminate this application now by entering the following command:

 Cheri::Explorer.thread.kill

}   
end

.stopObject



69
70
71
72
73
74
75
76
# File 'lib/cheri/explorer/explorer.rb', line 69

def self.stop
  if (server = @server)
    server.stop_service rescue nil
    server.thread.kill rescue nil
    @explorer = nil
    @server = nil
  end
end

.threadObject



77
78
79
# File 'lib/cheri/explorer/explorer.rb', line 77

def self.thread
  @server.thread if @server  
end