hashicorp-checkpoint 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ecb84fe275a46ccb1c809131973885a3b4c9574
4
- data.tar.gz: 821397cdf04825128fd2b84ebebb9b7c550dc8b2
3
+ metadata.gz: 8481826ff6bddfcd56f0c1a17da45fe7510b5d3d
4
+ data.tar.gz: 372757bede042f8feb95812730dddcd9dcd355e0
5
5
  SHA512:
6
- metadata.gz: 1b5add6e2913e2edd29ec8e7c7bee74fd5ad0b48bf1ea3105f75abcbbf9a1ab4e33a0e623cc27a2914b9eae7feeebe7c6471160d9d5ff3f5af64969c7bd712ba
7
- data.tar.gz: ee8ae910a45245286fd18e2846cefaa13e8712b020e0567ffd0117b9faa342e456712317c4563f33259c3eec7d175d6fc41e68a002856b9912c3c38197f499ad
6
+ metadata.gz: 12a68f13b32a2b2eb4d87827878e33ba516598565b33e122c3b7ef29af652ff175c8050f1310eb9294cf79501f1ea0b6f90cba6cd672ba45ee041857963cfd5b
7
+ data.tar.gz: 7b8cf606dc5b2c3e32ef69dce661217f6c073638c0b8b0a1bbf6ca840e2156c1dd77d00deefb09f68f02d6a7140caea1e3751737d887eea49d950e3007e0198d
@@ -8,6 +8,8 @@ require "checkpoint/platform"
8
8
  require "checkpoint/version"
9
9
 
10
10
  module Checkpoint
11
+ @@disabled = false
12
+
11
13
  # Checks for the latest version information as well as alerts.
12
14
  #
13
15
  # @param [Hash] opts the options to check with
@@ -24,6 +26,8 @@ module Checkpoint
24
26
  # @option opts [String] :cache_file If specified, the response will be
25
27
  # cached here for cache_time period (defaults to 48 hours).
26
28
  def self.check(**opts)
29
+ return nil if @@disabled
30
+
27
31
  # If we have the cache file, then just return the contents.
28
32
  if opts[:cache_file] && File.file?(opts[:cache_file])
29
33
  # If the cache file is too old, then delete it
@@ -95,6 +99,11 @@ module Checkpoint
95
99
  return nil
96
100
  end
97
101
 
102
+ # Disables checkpoint.
103
+ def self.disable!
104
+ @@disabled = true
105
+ end
106
+
98
107
  protected
99
108
 
100
109
  def self.build_check(response)
@@ -1,3 +1,3 @@
1
1
  module Checkpoint
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashicorp-checkpoint
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
  - Mitchell Hashimoto