lib/buby.rb in emonti-buby-1.0.0 vs lib/buby.rb in emonti-buby-1.0.1
- old
+ new
@@ -52,15 +52,29 @@
# Buby-namer.
#
class Buby
# :stopdoc:
- VERSION = '1.0.0'
+ VERSION = '1.0.1'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
# :startdoc:
+ def initialize(other=nil)
+ if other
+ raise "arg 0 must be another kind of Buby" unless other.is_a? Buby
+ @burp_extender = other.burp_extender
+ @burp_callbacks = other.burp_callbacks
+ end
+ end
+
+ # Makes this handler the active Ruby handler object for the BurpExtender
+ # Java runtime. (there can be only one!)
+ def activate!
+ BurpExtender.set_handler(self)
+ end
+
# Returns the internal reference to the BurpExtender instance. This
# reference gets set from Java through the evt_extender_init method.
def burp_extender; @burp_extender; end
# Returns the internal reference to the IBupExtenderCallbacks instance.
@@ -372,12 +386,12 @@
pp([:got_app_close]) if $DEBUG
end
# Prepares the java BurpExtender implementation with a reference
# to self as the module handler and launches burp suite.
- def start(args=[])
- BurpExtender.set_handler(self)
+ def start_burp(args=[])
+ activate!()
Java::Burp::StartBurp.main(args.to_java(:string))
return self
end
# Starts burp using a supplied handler class,
@@ -388,10 +402,10 @@
# Returns the handler instance
def self.start_burp(h_class=nil, init_args=nil, args=nil)
h_class ||= self
init_args ||= []
args ||= []
- h_class.new(*init_args).start(args)
+ h_class.new(*init_args).start_burp(args)
end
# Attempts to load burp with require and confirm it provides the required
# class in the Java namespace.
#