vinquery 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vinquery (0.3.8)
4
+ vinquery (0.4.0)
5
5
  nokogiri (>= 1.4.4)
6
6
 
7
7
  GEM
@@ -1,6 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'nokogiri'
3
- require 'Logger'
3
+ require 'logger'
4
4
 
5
5
  class Vinquery
6
6
  attr_reader :attributes, :errors, :result
@@ -12,10 +12,11 @@ class Vinquery
12
12
  request
13
13
  end
14
14
 
15
- def initialize(url, access_code, report_type, log = Logger.new(nil))
15
+ def initialize(url, access_code, report_type, log = nil)
16
16
  @url = url
17
17
  @access_code = access_code
18
18
  @report_type = report_type
19
+ log ||= Logger.new(nil)
19
20
  @log = log
20
21
  end
21
22
 
@@ -67,7 +68,7 @@ class Vinquery
67
68
  @errors = []
68
69
  @valid = doc.css('vin').first.attributes['status'].value == "SUCCESS"
69
70
  doc.css('message').each{|msg| @errors << {msg.attributes['key'].value => msg.attributes['value'].value} } unless valid?
70
- @errors.each{|msg| @log.error{"Vinquery#set_errors_hash - error: #{msg.to_s}"}} unless @errors.empty
71
+ @errors.each{|msg| @log.error{"Vinquery#set_errors_hash - error: #{msg.to_s}"}} unless @errors.empty?
71
72
  end
72
73
 
73
74
  def valid?
@@ -1,3 +1,3 @@
1
1
  class Vinquery
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vinquery
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jake Mallory