apple_store_inventory_checker 0.1.0.pre → 0.1.0

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: f6c6dd692f60a5a5b7c8db6d7c8944bfd966f82ac2f4b296b1f4eb27409a16f0
4
- data.tar.gz: efd3288f76fb85fa7275796d8ea8fa5414bc3b563ab8dd7566cf8bac700ea348
3
+ metadata.gz: 72cad36db0d6e1608d86017d958b764e5acd27ae22cec7661b3e76ebd299ae42
4
+ data.tar.gz: 6991845e0a4e7d2ea377d1c89acb1451f4dfbee0b4fb122b0649f0255dfa6521
5
5
  SHA512:
6
- metadata.gz: f7485acd1945fa2e0b2836ac9f8de2a23988b574b7edca0469f937302d96e350477aab6c30af18a0fe86d4a614c315e03d65d58061e6bd8058a02854a21049db
7
- data.tar.gz: 63dba997a087cd0bed4b47b4ef31a7ca3fe758135a333c9046838f3548fd6320b3b9e0e432c7b1ff936cc502640f15754eb7842026367596152f8fb12fa21e0b
6
+ metadata.gz: ea986a8d3f964e0cc9ecff9c7eb76709fd739961c8d69b7796dfec43ae7111e84976d6a5c298fe6c642014ff754384b919ced0c1781f4f3610140ddc1f687a61
7
+ data.tar.gz: d1cfad4803caa1e4509c2230d15f78025dc2c20558bef35ecec0a557ae8febdc972b8ffff381f092d8148e4670dc7c5d55b642d7f00781900dbff5b851366c0c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apple_store_inventory_checker (0.1.0.pre)
4
+ apple_store_inventory_checker (0.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -35,7 +35,7 @@ GEM
35
35
  method_source (~> 0.9.0)
36
36
  public_suffix (3.1.1)
37
37
  rainbow (3.0.0)
38
- rake (10.5.0)
38
+ rake (12.3.2)
39
39
  ramsey_cop (0.14.0)
40
40
  rubocop (~> 0.62)
41
41
  rubocop-performance
@@ -103,7 +103,7 @@ DEPENDENCIES
103
103
  bundler (~> 1.17)
104
104
  debase
105
105
  pry
106
- rake (~> 10.0)
106
+ rake (~> 12.3)
107
107
  ramsey_cop
108
108
  rspec (~> 3.0)
109
109
  rspec_junit_formatter
data/README.md CHANGED
@@ -58,7 +58,7 @@ first_result.state # TN
58
58
  first_result.phone # 615-435 0620
59
59
  first_result.url # http://www.apple.com/retail/coolspringsgalleria
60
60
 
61
- in_stock_results = retrieve_results.select { |result| result.in_stock? }
61
+ in_stock_results = retrieve_results.select(&:in_stock?)
62
62
 
63
63
  in_stock_results.first.product # Powerbeats Pro - Totally Wireless Earphones - Black
64
64
  in_stock_results.first.in_stock? # true
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "bundler", "~> 1.17"
36
36
  spec.add_development_dependency "debase"
37
37
  spec.add_development_dependency "pry"
38
- spec.add_development_dependency "rake", "~> 10.0"
38
+ spec.add_development_dependency "rake", "~> 12.3"
39
39
  spec.add_development_dependency "ramsey_cop"
40
40
  spec.add_development_dependency "rspec", "~> 3.0"
41
41
  spec.add_development_dependency "rspec_junit_formatter"
@@ -32,7 +32,7 @@ module AppleStoreInventoryChecker
32
32
  objects = raw_results.map do |raw_result|
33
33
  result = Result.new(product_id: product_id)
34
34
  result.product = raw_result.dig(:partsAvailability, product_id.to_sym, :storePickupProductTitle)
35
- result.in_stock = raw_result.dig(:partsAvailability, product_id.to_sym, :storePickupQuote).include?("Today")
35
+ result.in_stock = stock_status(raw_result.dig(:partsAvailability, product_id.to_sym, :storePickupQuote))
36
36
  result.distance = raw_result.dig(:storedistance).to_f
37
37
  result.store = raw_result.dig(:storeName)
38
38
  result.city = raw_result.dig(:city)
@@ -43,5 +43,9 @@ module AppleStoreInventoryChecker
43
43
  end
44
44
  objects.select { |result| result&.distance && (result.distance < max_distance) }
45
45
  end
46
+
47
+ def stock_status(store_pickup)
48
+ store_pickup.match?("Today|Tomorrow")
49
+ end
46
50
  end
47
51
  end
@@ -1,3 +1,3 @@
1
1
  module AppleStoreInventoryChecker
2
- VERSION = "0.1.0.pre".freeze
2
+ VERSION = "0.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_store_inventory_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Peyton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-29 00:00:00.000000000 Z
11
+ date: 2019-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '12.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '12.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ramsey_cop
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -214,9 +214,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  version: 2.4.6
215
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - ">"
217
+ - - ">="
218
218
  - !ruby/object:Gem::Version
219
- version: 1.3.1
219
+ version: '0'
220
220
  requirements: []
221
221
  rubygems_version: 3.0.3
222
222
  signing_key: