kelredd-resourceful 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,15 +5,16 @@ module Resourceful
5
5
  module Agent
6
6
  class Mechanize < Resourceful::Agent::Base
7
7
 
8
- ATTRS = [:agent_alias]
8
+ ATTRS = [:agent_alias, :verbose]
9
9
  ATTRS.each { |a| attr_reader a }
10
10
 
11
11
  def initialize(args={})
12
- ATTRS.each { |a| instance_variable_set("@#{a.to_s}", args.delete(a)) }
12
+ @verbose ||= false
13
+ ATTRS.each { |a| instance_variable_set("@#{a.to_s}", args.delete(a)) if args[a] }
13
14
  super(args)
14
15
  self.log = yield if block_given?
15
16
  @mechanize = ::WWW::Mechanize.new do |obj|
16
- obj.log = @logger
17
+ obj.log = @logger && @verbose ? @logger : nil
17
18
  obj.user_agent_alias = @agent_alias unless @agent_alias.nil?
18
19
  end
19
20
  end
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 5
6
- TINY = 5
6
+ TINY = 6
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-resourceful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-13 00:00:00 -07:00
12
+ date: 2009-08-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency