hashicorp-checkpoint 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 +4 -4
- data/lib/checkpoint.rb +9 -0
- data/lib/checkpoint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8481826ff6bddfcd56f0c1a17da45fe7510b5d3d
|
4
|
+
data.tar.gz: 372757bede042f8feb95812730dddcd9dcd355e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a68f13b32a2b2eb4d87827878e33ba516598565b33e122c3b7ef29af652ff175c8050f1310eb9294cf79501f1ea0b6f90cba6cd672ba45ee041857963cfd5b
|
7
|
+
data.tar.gz: 7b8cf606dc5b2c3e32ef69dce661217f6c073638c0b8b0a1bbf6ca840e2156c1dd77d00deefb09f68f02d6a7140caea1e3751737d887eea49d950e3007e0198d
|
data/lib/checkpoint.rb
CHANGED
@@ -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)
|
data/lib/checkpoint/version.rb
CHANGED