carquery 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8913bf7fa5f6995c90e863d4b17aef2426d853b6
4
- data.tar.gz: b34075a37187839db825c4b7a7f28f8d3a5e7519
3
+ metadata.gz: d0094d92f9ffd94f2481306769ce3e4ba0756cb8
4
+ data.tar.gz: 5667b59440e7b4ff2fc6e238af0242fcfdbe5ff1
5
5
  SHA512:
6
- metadata.gz: ed6ad1fb8c7fb4602b632ec80f566c4dd3760e21f4f54cf07c2b6f4493106eae5dd436733c7a35d31753b171fe6e301607ea1e85fbb84eb213dcb1f1319901b0
7
- data.tar.gz: 173e66d655b4d9b5774563f840d7a1a0ef43998768650598286dcb1a4e5aa1a8657d12a81d03b93269bf5284d661ce8f7bcd102dc4bbd93da9af9ddb4965f0d7
6
+ metadata.gz: a17a0e0b30e3fd14980eb011ff62d7f5212e3f6f6dc19c3e70005771db27a9e83112f8ce43cb5c169a663fe62532586ec1d6d21a3c995914a07a13dec5dd3857
7
+ data.tar.gz: 420e8b302fbf022d9638e012fbae93544c863018cd35d17795ce438b79b4a8c7b44aba0fa9f0cab83f67bd696e1ee96edb3bf1d0012c41dc97124280fc9c6721
data/Gemfile CHANGED
@@ -3,6 +3,6 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in carquery.gemspec
4
4
  gemspec
5
5
 
6
- group :development, :test do
7
- gem 'pry-debugger'
8
- end
6
+ #group :development, :test do
7
+ # gem 'pry-debugger'
8
+ #end
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rspec"
27
27
  spec.add_development_dependency "webmock"
28
28
  spec.add_development_dependency "vcr"
29
+ spec.add_development_dependency "rspec-its"
29
30
  end
@@ -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, :sold_in_us,
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, sold_in_us, co2, make_title, make_country
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
-
@@ -1,3 +1,3 @@
1
1
  module Carquery
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'rspec/its'
2
3
 
3
4
  describe Carquery::CarModel do
4
5
  describe '.build' do
@@ -12,4 +13,4 @@ describe Carquery::CarModel do
12
13
  its(:title) { should eq "021 C" }
13
14
  end
14
15
  end
15
- end
16
+ end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'rspec/its'
2
3
 
3
4
  describe Carquery::Make do
4
5
  describe '.build' do
@@ -15,4 +16,4 @@ describe Carquery::Make do
15
16
  its(:country) { should eq "Italy" }
16
17
  end
17
18
  end
18
- end
19
+ end
@@ -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.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: 2013-10-08 00:00:00.000000000 Z
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.0.7
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.