book-value 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: 8b2d13c166936168c1b4042f0b14aee46decf8a62306bdf8f89034ca2ec3cc44
4
- data.tar.gz: 76b81b257574bc634ea5f4ab171eceec490c53131e115e115dd95cda9c7a23c9
3
+ metadata.gz: f13ec585d50646d3083b25f0d66fd48a18846260bf43142240ac2900264abfef
4
+ data.tar.gz: b296783edf3d9a4e8eae476df35a35e7c6df43550125820c1de2c450c275fe6f
5
5
  SHA512:
6
- metadata.gz: 9ac3663a9f2c625a9b6ada1b4846b883165b533c0128e0988dda223263621333b6950d050681dea0e4712a741dcf7c550d4f7f77049cdd8273acea29c628bd17
7
- data.tar.gz: e847aebdd63bfd45c68b1e9320391410741984e3f2c8f61d320143409719afde93b72bd0160dbf6826c417f2e6751fa8dd21f568a313325d853d59ec879a37bb
6
+ metadata.gz: b01ba337b241e8182df07035e54630cc8faaad0b9dd04393bc2cb95cb4261f984ac2ee9cbd8852413b1293adf7ebb110dae69dfb23b089bd7526b1d2b10f1f48
7
+ data.tar.gz: 23087867bb8eeb3066fbbd128c395abbef11453f23baeb9db07beac84b55b0f837809db1c77496339f4f33b8f6bbaa140c53dc2a15a9458d218f31cd70fd13ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- book-value (0.0.1)
4
+ book-value (0.0.5)
5
5
  active_attr (~> 0.15.4)
6
6
  httparty (~> 0.21.0)
7
7
  nokogiri (~> 1.14.0)
@@ -38,13 +38,11 @@ module BookValue
38
38
  options
39
39
  end
40
40
 
41
- # TODO: Fix model to try `-`
42
41
  def car_features(make, model)
43
42
  checkbox_options = {}
44
43
 
45
- process_model(model) do |model_name|
44
+ process_model(model).each do |model_name|
46
45
  raw_page = authorise_and_send(http_method: :get, command: "calculate/#{make.downcase}/#{model_name}")
47
- next if raw_page == {}
48
46
 
49
47
  doc = Nokogiri::HTML(raw_page['body'])
50
48
 
@@ -65,7 +63,7 @@ module BookValue
65
63
  output = ''
66
64
  feature_params = ''
67
65
 
68
- process_model(model) do |model_name|
66
+ process_model(model).each do |model_name|
69
67
  features.each do |feature_id|
70
68
  feature_params = "#{feature_params}#{feature_id}=on&"
71
69
  end
@@ -73,9 +71,8 @@ module BookValue
73
71
  feature_params = feature_params[0..-2]
74
72
 
75
73
  milage_form_page = authorise_and_send(http_method: :post, payload: feature_params, command: "calculate/#{make.downcase}/#{model_name}")
76
- next if milage_form_page == {}
77
-
78
74
  condition_url = milage_form_page['headers']['location']
75
+ next unless condition_url
79
76
 
80
77
  _condition_page = HTTParty.post(condition_url, body: "mileage=#{mileage}&year=#{year}")
81
78
 
@@ -142,7 +139,8 @@ module BookValue
142
139
  {
143
140
  'start_time' => start_time,
144
141
  'end_time' => end_time,
145
- 'total_time' => total_time
142
+ 'total_time' => total_time,
143
+ 'ok' => response.ok?
146
144
  }
147
145
  end
148
146
 
@@ -1,3 +1,3 @@
1
1
  module BookValue
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: book-value
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-16 00:00:00.000000000 Z
11
+ date: 2023-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty