drover 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2fbd43f6fe7a08acf55e3a79d9c30fb7f236f0b2
4
+ data.tar.gz: ff508c196db45375fb90a2b3d54933b929e0a5c7
5
+ SHA512:
6
+ metadata.gz: 1f7e4cd5434223808eec3589b349efeae4dba75f6435240a5e3c665347053467a5768297bfac8120b71a4e704bd1247a542b71895a632046220e8ae2ce030528
7
+ data.tar.gz: 4304350ef2ad20eb85dc4a86e0b446e0ccfd7cd2de15399ea1582b18ade342c9784f76922b4e6565bce868b245f23cadf22c9d7bd2bd414c2d82586f12932ccd
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ drover (0.0.1)
5
+ activesupport (~> 5)
6
+ json (~> 2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (5.1.4)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (~> 0.7)
14
+ minitest (~> 5.1)
15
+ tzinfo (~> 1.1)
16
+ concurrent-ruby (1.0.5)
17
+ diff-lcs (1.3)
18
+ i18n (0.9.1)
19
+ concurrent-ruby (~> 1.0)
20
+ json (2.1.0)
21
+ minitest (5.10.3)
22
+ rake (12.3.0)
23
+ rspec (3.7.0)
24
+ rspec-core (~> 3.7.0)
25
+ rspec-expectations (~> 3.7.0)
26
+ rspec-mocks (~> 3.7.0)
27
+ rspec-core (3.7.0)
28
+ rspec-support (~> 3.7.0)
29
+ rspec-expectations (3.7.0)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.7.0)
32
+ rspec-mocks (3.7.0)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.7.0)
35
+ rspec-support (3.7.0)
36
+ thread_safe (0.3.6)
37
+ tzinfo (1.2.4)
38
+ thread_safe (~> 0.1)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ bundler (~> 1)
45
+ drover!
46
+ rake (~> 12)
47
+ rspec (~> 3)
48
+
49
+ BUNDLED WITH
50
+ 1.16.0.pre.3
data/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # drover
2
+
3
+ Drover API as a gem
4
+
5
+ `gem install drover` or `gem 'drover'` in your `Gemfile`
6
+
7
+ ## `Drover.search_vehicles_results(params)`
8
+
9
+ Example:
10
+
11
+ ```ruby
12
+ Drover.search_vehicles_results(
13
+ number_of_weeks: 12,
14
+ start_date: "20/11/2018",
15
+ vehicle_type: "PCO",
16
+ sub_type: "UberX",
17
+ location: "Londres, Royaume-Uni"
18
+ )
19
+ ```
20
+
21
+ Params:
22
+
23
+ - `number_of_weeks`
24
+ - `start_date`
25
+ - `vehicle_type`
26
+ - `sub_type`
27
+ - `vehicle_make`
28
+ - `transmission`
29
+ - `location`
30
+
31
+ ### Response
32
+
33
+ - `vehicles`
34
+ - `approved`
35
+ - `auto_renew`
36
+ - `bookable_for_long_bookings`
37
+ - `bookable_for_max_years`
38
+ - `discount_price_schedule`
39
+ - `distance_miles`
40
+ - `driver_price_pence`
41
+ - `fuel_type`
42
+ - `id`
43
+ - `images`
44
+ - `default`
45
+ - `description`
46
+ - `id`
47
+ - `image_url`
48
+ - `imageable_id`
49
+ - `imageable_type`
50
+ - `latitude`
51
+ - `licence_plate`
52
+ - `longitude`
53
+ - `mpg`
54
+ - `on_default_discount_schedule`
55
+ - `postcode`
56
+ - `state`
57
+ - `sub_type`
58
+ - `transmission`
59
+ - `unavailable`
60
+ - `vehicle_make`
61
+ - `vehicle_model`
62
+ - `vehicle_type`
63
+ - `year`
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/drover.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'drover'
7
+ s.version = '0.0.1'
8
+ s.date = '2017-11-19'
9
+ s.summary = 'Drover API'
10
+ s.description = 'Drover public endpoints'
11
+ s.authors = ['Dorian Marié']
12
+ s.email = 'dorian@doma.io'
13
+ s.files = ['lib/drover.rb']
14
+ s.homepage = 'https://github.com/Dorian/drover'
15
+ s.license = 'MIT'
16
+
17
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+
21
+ s.require_paths = ['lib']
22
+ s.add_runtime_dependency 'json', '~> 2'
23
+ s.add_runtime_dependency 'activesupport', '~> 5'
24
+ s.add_development_dependency 'bundler', '~> 1'
25
+ s.add_development_dependency 'rake', '~> 12'
26
+ s.add_development_dependency 'rspec', '~> 3'
27
+ end
28
+
data/lib/drover.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+ require 'json'
4
+ require 'active_support/all'
5
+
6
+ class Drover
7
+ BASE_URL = "https://www.joindrover.com/"
8
+
9
+ SEARCH_VEHICLES_RESULTS_URL =
10
+ BASE_URL + "partners/vehicles/search_vehicles_results"
11
+
12
+ def self.search_vehicles_results(params = {})
13
+ uri = URI.parse(SEARCH_VEHICLES_RESULTS_URL)
14
+ response = Net::HTTP.post(uri, params.to_query)
15
+
16
+ JSON.load(response.body)
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: drover
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dorian Marié
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '12'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
83
+ description: Drover public endpoints
84
+ email: dorian@doma.io
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".gitignore"
90
+ - Gemfile
91
+ - Gemfile.lock
92
+ - README.md
93
+ - Rakefile
94
+ - drover.gemspec
95
+ - lib/drover.rb
96
+ homepage: https://github.com/Dorian/drover
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.6.11
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Drover API
120
+ test_files: []
121
+ has_rdoc: