Useless code removed

Options given to the Browser initializator improved
This commit is contained in:
Erwan
2012-08-30 18:01:12 +02:00
parent 6d3eb2a3a1
commit 336473d912
2 changed files with 3 additions and 8 deletions

View File

@@ -197,9 +197,9 @@ class Browser
# Override with the options if they are set # Override with the options if they are set
def override_config_with_options(options) def override_config_with_options(options)
options.each do |option, value| options.each do |option, value|
#if ACCESSOR_OPTIONS.include?(option) if ACCESSOR_OPTIONS.include?(option)
self.send(:"#{option}=", value) self.send(:"#{option}=", value)
#end end
end end
end end

View File

@@ -33,17 +33,12 @@ class WpTarget
attr_reader :uri, :verbose attr_reader :uri, :verbose
def initialize(target_url, options = {}) def initialize(target_url, options = {})
raise "Empty URL" if !target_url
@uri = URI.parse(add_http_protocol(target_url)) @uri = URI.parse(add_http_protocol(target_url))
@verbose = options[:verbose] @verbose = options[:verbose]
@wp_content_dir = options[:wp_content_dir] @wp_content_dir = options[:wp_content_dir]
@wp_plugins_dir = options[:wp_plugins_dir] @wp_plugins_dir = options[:wp_plugins_dir]
Browser.instance(#options.merge(:max_threads => options[:threads])) Browser.instance(options.merge(:max_threads => options[:threads]))
:proxy => options[:proxy],
:max_threads => options[:threads]
)
end end
# Alias of @uri.to_s # Alias of @uri.to_s