Class: Arachni::State::Framework::RPC
- Defined in:
- lib/arachni/state/framework/rpc.rb
Overview
State information for RPC::Server::Framework.
Instance Attribute Summary collapse
- #distributed_elements ⇒ Set readonly
- #distributed_pages ⇒ Support::LookUp::HashSet readonly
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ Object
- #dump(directory) ⇒ Object
-
#initialize ⇒ RPC
constructor
A new instance of RPC.
- #statistics ⇒ Object
Constructor Details
Instance Attribute Details
#distributed_elements ⇒ Set (readonly)
22 23 24 |
# File 'lib/arachni/state/framework/rpc.rb', line 22 def distributed_elements @distributed_elements end |
#distributed_pages ⇒ Support::LookUp::HashSet (readonly)
19 20 21 |
# File 'lib/arachni/state/framework/rpc.rb', line 19 def distributed_pages @distributed_pages end |
Class Method Details
.load(directory) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/arachni/state/framework/rpc.rb', line 44 def self.load( directory ) rpc = new rpc.distributed_elements.merge Marshal.load( IO.binread( "#{directory}/distributed_elements" ) ) rpc.distributed_pages.merge Marshal.load( IO.binread( "#{directory}/distributed_pages" ) ) rpc end |
Instance Method Details
#clear ⇒ Object
53 54 55 56 |
# File 'lib/arachni/state/framework/rpc.rb', line 53 def clear @distributed_pages.clear @distributed_elements.clear end |
#dump(directory) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/arachni/state/framework/rpc.rb', line 36 def dump( directory ) FileUtils.mkdir_p( directory ) %w(distributed_pages distributed_elements).each do |attribute| IO.binwrite( "#{directory}/#{attribute}", Marshal.dump( send(attribute) ) ) end end |
#statistics ⇒ Object
29 30 31 32 33 34 |
# File 'lib/arachni/state/framework/rpc.rb', line 29 def statistics { distributed_pages: @distributed_pages.size, distributed_elements: @distributed_elements.size } end |