hermes_api 0.5.1 → 0.5.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
  SHA256:
3
- metadata.gz: 2e400e9d1240ecc150a2874ba335cc33bd21c277fb73260669caabcddd80abaa
4
- data.tar.gz: f6518ec3b0f4f8dfad5ea3e628434cca6201a81da372472fb32fca8889232b90
3
+ metadata.gz: 87f92e8ae4fdbdc63d9e57027707610b8e46beb0017887e3653b30fb7100917e
4
+ data.tar.gz: 9943983c9eb55d666baf6941450a5c960df500af17a653bd4f4c652b949b581d
5
5
  SHA512:
6
- metadata.gz: 4bc7d0a0e966bbfc27b3069ed5144093d9fdb5734d51c940977a1d2bc5552d6de432313c4cff7d8438cc8a6583742ed37b24a0fa99fcee6561ae192e82432420
7
- data.tar.gz: 5bcb49363c64277def2894e6abb8c2e9858956e71a64f41064fe54a74e574bf4a4afbd26c09678c3c6800b2de41067b526d94093272ecebfa2b587b82f916b9c
6
+ metadata.gz: b0424b7e0049fd9fba5c542b22007b6232e5188f11c7711d4fcdab8d8255957d7382a04a8a7e66cb8ed0ef226021971ae0ebd76f1808f125c204ec81f5939038
7
+ data.tar.gz: 8118f608d127c49d58c843136d6269553dcabfccff2e05fe703dbbbafd970dfe86f280321252d54a8b7f38f17ed0c4977604094c2134696cb6bdad9c26fec81f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hermes_api (0.5.0)
4
+ hermes_api (0.5.1)
5
5
  activeresource (>= 4.1.0, < 6.0.0)
6
6
 
7
7
  GEM
@@ -1,10 +1,5 @@
1
1
  module HermesAPI
2
2
  mattr_accessor :cache
3
3
 
4
- self.cache = if defined?(Rails) && Rails.respond_to?(:cache) &&
5
- Rails.cache.is_a?(ActiveSupport::Cache::Store)
6
- Rails.cache
7
- else
8
- ActiveSupport::Cache::MemoryStore.new
9
- end
10
- end
4
+ self.cache = ActiveSupport::Cache::MemoryStore.new
5
+ end
@@ -25,6 +25,10 @@ module HermesAPI
25
25
 
26
26
  HermesAPI::JsonBase.site = config.env.to_s == "production" ? JSON_PRODUCTION_SITE : JSON_TESTING_SITE
27
27
  HermesAPI::OAuth.site = config.env.to_s == "production" ? OAUTH_PRODUCTION_SITE : OAUTH_TESTING_SITE
28
+
29
+ if defined?(Rails) && Rails.respond_to?(:cache) && Rails.cache.is_a?(ActiveSupport::Cache::Store)
30
+ HermesAPI.cache = Rails.cache
31
+ end
28
32
  end
29
33
 
30
34
  def configure
@@ -23,6 +23,8 @@ module HermesAPI
23
23
 
24
24
  def self.find(barcode)
25
25
  uniqueId = format.decode(connection.get("#{prefix}/search/#{barcode}", headers).body).first
26
+ return nil if uniqueId.nil?
27
+
26
28
  find_single("", params: {uniqueIds: uniqueId})
27
29
  end
28
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HermesAPI
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermes_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-30 00:00:00.000000000 Z
11
+ date: 2021-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource