carquery 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/Gemfile +3 -3
- data/carquery.gemspec +1 -0
- data/lib/carquery/resources/trim.rb +8 -4
- data/lib/carquery/version.rb +1 -1
- data/spec/resources/car_model_spec.rb +2 -1
- data/spec/resources/make_spec.rb +2 -1
- data/spec/resources/trim_spec.rb +7 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0094d92f9ffd94f2481306769ce3e4ba0756cb8
|
4
|
+
data.tar.gz: 5667b59440e7b4ff2fc6e238af0242fcfdbe5ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a17a0e0b30e3fd14980eb011ff62d7f5212e3f6f6dc19c3e70005771db27a9e83112f8ce43cb5c169a663fe62532586ec1d6d21a3c995914a07a13dec5dd3857
|
7
|
+
data.tar.gz: 420e8b302fbf022d9638e012fbae93544c863018cd35d17795ce438b79b4a8c7b44aba0fa9f0cab83f67bd696e1ee96edb3bf1d0012c41dc97124280fc9c6721
|
data/Gemfile
CHANGED
data/carquery.gemspec
CHANGED
@@ -5,7 +5,8 @@ module Carquery
|
|
5
5
|
:engine_bore_mm, :engine_stroke_mm, :engine_compression, :engine_fuel,
|
6
6
|
:top_speed_kph, :speedup_0_to_100_kph, :drive, :transmission_type,
|
7
7
|
:seats, :doors, :weight_kg, :length_mm, :width_mm, :height_mm,
|
8
|
-
:wheelbase_mm, :lkm_hwy, :lkm_mixed, :lkm_city, :fuel_cap_l,
|
8
|
+
:wheelbase_mm, :lkm_hwy, :lkm_mixed, :lkm_city, :fuel_cap_l,
|
9
|
+
:mpg_city, :mpg_hwy, :mpg_mixed, :fuel_cap_g, :sold_in_us,
|
9
10
|
:co2, :make_title, :make_country do
|
10
11
|
|
11
12
|
def self.build raw
|
@@ -43,6 +44,10 @@ module Carquery
|
|
43
44
|
lkm_mixed = get_f raw["model_lkm_mixed"]
|
44
45
|
lkm_city = get_f raw["model_lkm_city"]
|
45
46
|
fuel_cap_l = get_i raw["model_fuel_cap_l"]
|
47
|
+
mpg_hwy = get_f raw["model_mpg_hwy"]
|
48
|
+
mpg_city = get_f raw["model_mpg_city"]
|
49
|
+
mpg_mixed = get_f raw["model_mpg_mixed"]
|
50
|
+
fuel_cap_g = get_f raw["model_fuel_cap_g"]
|
46
51
|
sold_in_us = get_boolean raw["model_sold_in_us"]
|
47
52
|
co2 = get_i raw["model_co2"]
|
48
53
|
make_title = get_str raw["make_display"]
|
@@ -54,9 +59,8 @@ module Carquery
|
|
54
59
|
engine_stroke_mm, engine_compression, engine_fuel, top_speed_kph,
|
55
60
|
speedup_0_to_100_kph, drive, transmission_type, seats, doors, weight_kg,
|
56
61
|
length_mm, width_mm, height_mm, wheelbase_mm, lkm_hwy, lkm_mixed, lkm_city,
|
57
|
-
fuel_cap_l,
|
62
|
+
fuel_cap_l, mpg_city, mpg_hwy, mpg_mixed, fuel_cap_g, sold_in_us, co2,
|
63
|
+
make_title, make_country
|
58
64
|
end
|
59
65
|
end
|
60
66
|
end
|
61
|
-
|
62
|
-
|
data/lib/carquery/version.rb
CHANGED
data/spec/resources/make_spec.rb
CHANGED
data/spec/resources/trim_spec.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'rspec/its'
|
2
3
|
|
3
4
|
describe Carquery::Trim do
|
4
5
|
describe '.build' do
|
5
6
|
subject { described_class.build data }
|
6
7
|
|
7
8
|
context "when valid data provided" do
|
8
|
-
let(:data) { {"model_id"=>"57610", "model_make_id"=>"acura", "model_name"=>"ILX", "model_trim"=>" Hybrid", "model_year"=>"2013", "model_body"=>"Sedan", "model_engine_position"=>"Front", "model_engine_cc"=>"1500", "model_engine_cyl"=>"4", "model_engine_type"=>"in-line", "model_engine_valves_per_cyl"=>"8", "model_engine_power_ps"=>"111", "model_engine_power_rpm"=>"5500", "model_engine_torque_nm"=>"172", "model_engine_torque_rpm"=>"3500", "model_engine_bore_mm"=>"73.0", "model_engine_stroke_mm"=>"89.0", "model_engine_compression"=>"10.8", "model_engine_fuel"=>"Gasoline", "model_top_speed_kph"=>nil, "model_0_to_100_kph"=>nil, "model_drive"=>"Front", "model_transmission_type"=>"CVT ", "model_seats"=>"5", "model_doors"=>"4", "model_weight_kg"=>"1356", "model_length_mm"=>"4550", "model_width_mm"=>"1794", "model_height_mm"=>"1412", "model_wheelbase_mm"=>"2670", "model_lkm_hwy"=>"4.8", "model_lkm_mixed"=>nil, "model_lkm_city"=>"5.0", "model_fuel_cap_l"=>"50", "model_sold_in_us"=>"1", "model_co2"=>nil, "model_make_display"=>nil, "make_display"=>"Acura", "make_country"=>"USA"} }
|
9
|
+
let(:data) { {"model_id"=>"57610", "model_make_id"=>"acura", "model_name"=>"ILX", "model_trim"=>" Hybrid", "model_year"=>"2013", "model_body"=>"Sedan", "model_engine_position"=>"Front", "model_engine_cc"=>"1500", "model_engine_cyl"=>"4", "model_engine_type"=>"in-line", "model_engine_valves_per_cyl"=>"8", "model_engine_power_ps"=>"111", "model_engine_power_rpm"=>"5500", "model_engine_torque_nm"=>"172", "model_engine_torque_rpm"=>"3500", "model_engine_bore_mm"=>"73.0", "model_engine_stroke_mm"=>"89.0", "model_engine_compression"=>"10.8", "model_engine_fuel"=>"Gasoline", "model_top_speed_kph"=>nil, "model_0_to_100_kph"=>nil, "model_drive"=>"Front", "model_transmission_type"=>"CVT ", "model_seats"=>"5", "model_doors"=>"4", "model_weight_kg"=>"1356", "model_length_mm"=>"4550", "model_width_mm"=>"1794", "model_height_mm"=>"1412", "model_wheelbase_mm"=>"2670", "model_lkm_hwy"=>"4.8", "model_lkm_mixed"=>nil, "model_fuel_cap_g"=>"13.2", "model_lkm_city"=>"5.0", "model_fuel_cap_l"=>"50", "model_mpg_hwy"=>"49", "model_mpg_city"=>"47", "model_mpg_mixed"=>nil, "model_sold_in_us"=>"1", "model_co2"=>nil, "model_make_display"=>nil, "make_display"=>"Acura", "make_country"=>"USA"} }
|
9
10
|
|
10
11
|
it { should be_a described_class }
|
11
12
|
|
@@ -43,6 +44,10 @@ describe Carquery::Trim do
|
|
43
44
|
its(:lkm_mixed) { should be_nil }
|
44
45
|
its(:lkm_city) { should eq 5.0 }
|
45
46
|
its(:fuel_cap_l) { should eq 50 }
|
47
|
+
its(:fuel_cap_g) { should eq 13.2 }
|
48
|
+
its(:mpg_city) { should eq 47 }
|
49
|
+
its(:mpg_hwy) { should eq 49}
|
50
|
+
its(:mpg_mixed) { should be_nil }
|
46
51
|
its(:sold_in_us) { should eq true }
|
47
52
|
its(:co2) { should be_nil }
|
48
53
|
its(:make_title) { should eq "Acura" }
|
@@ -50,4 +55,4 @@ describe Carquery::Trim do
|
|
50
55
|
|
51
56
|
end
|
52
57
|
end
|
53
|
-
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carquery
|
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
|
- Rustam Sharshenov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec-its
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: www.carqueryapi.com API client
|
112
126
|
email:
|
113
127
|
- rustam@sharshenov.com
|
@@ -171,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
185
|
version: '0'
|
172
186
|
requirements: []
|
173
187
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.2.2
|
175
189
|
signing_key:
|
176
190
|
specification_version: 4
|
177
191
|
summary: Provides DSL for a www.carqueryapi.com API.
|