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 +4 -4
- data/.travis.yml +7 -0
- data/README.md +8 -2
- data/dvla.gemspec +2 -0
- data/lib/vehicle_details/data_extractor.rb +10 -10
- data/lib/version.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/vehicle_details/data_extractor_spec.rb +1 -2
- data/spec/vehicle_details/vehicle_details_scraper_spec.rb +1 -2
- data/spec/vehicle_details_spec.rb +1 -2
- metadata +32 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 553f2cadae8cc3b1c8fd7d25d92df0b1e2006de2
|
4
|
+
data.tar.gz: b3fe72fa828fa3fdf4564a7cd4e5af713e37ccce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c27f268ea59aaa1f2f324d32a9bfd43b3c2d1e1d7871643f47d7ee274784b8675320c06e99885d53466f7374ab11e90211bc5eaaf9b7a4a15ee6feabe250f93
|
7
|
+
data.tar.gz: 6a9eecc86962bb35655068d8badff9d5c4f6fd4581e98dd7e0900b1d00f3ef45a69fada1ba707951b3e6a68b5621b3b6f8d25c3aa674b73ddc4e198336a0d4ce
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
|
1
|
+
## DVLA Data Extractor
|
2
2
|
|
3
|
-
|
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
|
|
data/dvla.gemspec
CHANGED
@@ -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
|
-
|
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
|
-
|
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",
|
data/lib/version.rb
CHANGED
data/spec/spec_helper.rb
ADDED
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.
|
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
|