lib/pupa/runner.rb in pupa-0.2.2 vs lib/pupa/runner.rb in pupa-0.2.3
- old
+ new
@@ -21,10 +21,11 @@
memcached_username: nil,
memcached_password: nil,
database_url: 'mongodb://localhost:27017/pupa',
validate: true,
level: 'INFO',
+ faraday_options: {},
dry_run: false,
}.merge(defaults))
@actions = {
'scrape' => 'Scrapes data from online sources',
@@ -80,10 +81,13 @@
options.pipelined = v
end
opts.on('-c', '--cache_dir PATH', 'The directory or Memcached address (e.g. memcached://localhost:11211) in which to cache HTTP requests') do |v|
options.cache_dir = v
end
+ opts.on('--no-cache', 'Disable HTTP request caching') do |v|
+ options.cache_dir = nil
+ end
opts.on('-e', '--expires_in SECONDS', "The cache's expiration time in seconds") do |v|
options.expires_in = v
end
opts.on('--value_max_bytes BYTES', "The maximum Memcached item size") do |v|
options.value_max_bytes = v
@@ -158,9 +162,10 @@
memcached_username: options.memcached_username,
memcached_password: options.memcached_password,
database_url: options.database_url,
validate: options.validate,
level: options.level,
+ faraday_options: options.faraday_options,
options: Hash[*rest])
options.actions.each do |action|
unless action == 'scrape' || processor.respond_to?(action)
abort %(`#{action}` is not a #{opts.program_name} action. See `#{opts.program_name} --help` for a list of available actions.)