dvla 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4065a5d4c5e0dfee3fea4be8ade028c0dd5cc74b
4
- data.tar.gz: 17d898855306b75c8be577efc2a25d7822e7e53a
3
+ metadata.gz: 553f2cadae8cc3b1c8fd7d25d92df0b1e2006de2
4
+ data.tar.gz: b3fe72fa828fa3fdf4564a7cd4e5af713e37ccce
5
5
  SHA512:
6
- metadata.gz: 6a13406d446dcaaccf2599a9d31e8771e75ff4b4dd1ccef50bd595b35232480811816efc56cee584e62c953cf327d7d4bdaf4399672f519672088fa59196b6d6
7
- data.tar.gz: 3cf326273b1c254e7e214e607e79da0a4784d7a9556a2b4a50249321e49102ddbd53b06f6dd72f79c659c8ed95cabfce875c8ab4f92cf6ddefb5a1d025da919e
6
+ metadata.gz: 8c27f268ea59aaa1f2f324d32a9bfd43b3c2d1e1d7871643f47d7ee274784b8675320c06e99885d53466f7374ab11e90211bc5eaaf9b7a4a15ee6feabe250f93
7
+ data.tar.gz: 6a9eecc86962bb35655068d8badff9d5c4f6fd4581e98dd7e0900b1d00f3ef45a69fada1ba707951b3e6a68b5621b3b6f8d25c3aa674b73ddc4e198336a0d4ce
@@ -0,0 +1,7 @@
1
+ before_install:
2
+ - "export DISPLAY=:99.0"
3
+ - "sh -e /etc/init.d/xvfb start"
4
+ language: ruby
5
+ rvm:
6
+ - 1.9.3
7
+ script: bundle exec rspec spec
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
- # DVLA Data Extractor
1
+ ## DVLA Data Extractor
2
2
 
3
- This gem is a present for Simon Jenner. It allows you to extract data from the DVLA. It currently supports retrieving data for vehicle details.
3
+ [![Travis CI](https://travis-ci.org/iHiD/dvla.png)](http://travis-ci.org/iHiD/dvla)
4
+ [![Code Climate](https://codeclimate.com/github/iHiD/dvla.png)](https://codeclimate.com/github/iHiD/dvla)
5
+ [![Dependency Status](https://gemnasium.com/iHiD/dvla.png)](https://gemnasium.com/iHiD/dvla)
6
+
7
+ This is a present for Simon Jenner :kissing_heart:
8
+
9
+ It allows you to extract data from the DVLA. It currently supports retrieving data for vehicle details.
4
10
 
5
11
  ## Installation
6
12
 
@@ -18,8 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(spec)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "capybara", '2.0.3'
21
22
  spec.add_dependency "capybara-webkit"
22
23
  spec.add_development_dependency "bundler", "~> 1.3"
23
24
  spec.add_development_dependency "rake"
24
25
  spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "coveralls"
25
27
  end
@@ -9,19 +9,11 @@ module Dvla
9
9
  end
10
10
 
11
11
  def car_data
12
- data = {}
13
- car_table.css(".vehicledetailstableright .bodytext").each_with_index do |elem, i|
14
- data[car_data_titles[i]] = elem.text
15
- end
16
- data
12
+ get_data(car_table, car_data_titles)
17
13
  end
18
14
 
19
15
  def tax_data
20
- data = {}
21
- tax_table.css(".vehicledetailstableright .bodytext").each_with_index do |elem, i|
22
- data[tax_data_titles[i]] = elem.text
23
- end
24
- data
16
+ get_data(tax_table, tax_data_titles)
25
17
  end
26
18
 
27
19
  private
@@ -42,6 +34,14 @@ module Dvla
42
34
  @tax_table ||= tables[1]
43
35
  end
44
36
 
37
+ def get_data(table, titles)
38
+ data = {}
39
+ table.css(".vehicledetailstableright .bodytext").each_with_index do |elem, i|
40
+ data[titles[i]] = elem.text
41
+ end
42
+ data
43
+ end
44
+
45
45
  def car_data_titles
46
46
  ["Date of Liability",
47
47
  "Date of First Registration",
@@ -1,3 +1,3 @@
1
1
  module Dvla
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,5 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ require 'rspec'
5
+ require_relative '../lib/vehicle_details'
@@ -1,6 +1,5 @@
1
1
  # encoding: UTF-8
2
- require 'rspec'
3
- require_relative '../../lib/vehicle_details/data_extractor'
2
+ require 'spec_helper'
4
3
 
5
4
  module Dvla::VehicleDetails
6
5
  describe DataExtractor do
@@ -1,6 +1,5 @@
1
1
  # encoding: UTF-8
2
- require 'rspec'
3
- require_relative '../../lib/vehicle_details/scraper'
2
+ require 'spec_helper'
4
3
 
5
4
  module Dvla::VehicleDetails
6
5
  describe Scraper do
@@ -1,6 +1,5 @@
1
1
  # encoding: UTF-8
2
- require 'rspec'
3
- require_relative '../lib/vehicle_details'
2
+ require 'spec_helper'
4
3
 
5
4
  module Dvla
6
5
  describe VehicleDetails do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dvla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2013-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capybara
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.3
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: capybara-webkit
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - '>='
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: A scraper to extract data from the DVLA
70
98
  email:
71
99
  - jez.walker@gmail.com
@@ -74,6 +102,7 @@ extensions: []
74
102
  extra_rdoc_files: []
75
103
  files:
76
104
  - .gitignore
105
+ - .travis.yml
77
106
  - Gemfile
78
107
  - Gemfile.lock
79
108
  - LICENSE.txt
@@ -86,6 +115,7 @@ files:
86
115
  - lib/vehicle_details/scraper.rb
87
116
  - lib/version.rb
88
117
  - scrape.rb
118
+ - spec/spec_helper.rb
89
119
  - spec/vehicle_details/data_extractor_spec.rb
90
120
  - spec/vehicle_details/vehicle_details_scraper_spec.rb
91
121
  - spec/vehicle_details_spec.rb
@@ -114,6 +144,7 @@ signing_key:
114
144
  specification_version: 4
115
145
  summary: A scraper to extract data from the DVLA
116
146
  test_files:
147
+ - spec/spec_helper.rb
117
148
  - spec/vehicle_details/data_extractor_spec.rb
118
149
  - spec/vehicle_details/vehicle_details_scraper_spec.rb
119
150
  - spec/vehicle_details_spec.rb