cronitor 3.0.0 → 3.1.0
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/README.md +26 -1
- data/lib/cronitor.rb +9 -1
- data/lib/cronitor/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4b5bc9e1efd7fb5247f7f473195589fb4cb822c52a1ee92f1b6c784086016f7
|
4
|
+
data.tar.gz: f617431b175f6c2e9263fc48fece1af7d7bff634285d703e5d3d57d548f70236
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88a42cddedfea16c32fe0ab3716684343f7c6e8adcfa9cd5018a43e28c6e1e86ba9ced38cfe361e1ecc184dde146f2b8b222320ce17c2e8e1194c4d698d55e20
|
7
|
+
data.tar.gz: 5ecb82ea549bd5a5ffb5d4298f493e40d3e2569d1517365156315a30f965fbe8b46629daf3bcae9cd029b93ad14c8363d6f06e0f543d8b26a0e270567446dc61
|
data/README.md
CHANGED
@@ -25,6 +25,31 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
|
28
|
+
|
29
|
+
### Configure
|
30
|
+
|
31
|
+
You need to set Cronitor Token in order to create a monitor
|
32
|
+
|
33
|
+
#### Using configure
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require 'cronitor'
|
37
|
+
|
38
|
+
Cronitor.configure do |cronitor|
|
39
|
+
cronitor.default_token = 'token' # default token to be re-used by cronitor
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Using ENV
|
44
|
+
|
45
|
+
```
|
46
|
+
# .env
|
47
|
+
CRONITOR_TOKEN: token
|
48
|
+
|
49
|
+
# bash
|
50
|
+
export CRONITOR_TOKEN='token'
|
51
|
+
```
|
52
|
+
|
28
53
|
### Creating a Monitor
|
29
54
|
|
30
55
|
A Cronitor monitor (hereafter referred to only as a monitor for brevity) is created if it does not already exist, and its ID returned.
|
@@ -56,7 +81,7 @@ monitor_options = {
|
|
56
81
|
note: 'A human-friendly description of this monitor'
|
57
82
|
}
|
58
83
|
|
59
|
-
# The token parameter is optional; if omittted, ENV['CRONITOR_TOKEN'] will be used
|
84
|
+
# The token parameter is optional; if omittted, ENV['CRONITOR_TOKEN'] will be used if not configured
|
60
85
|
my_monitor = Cronitor.new token: 'api_token', opts: monitor_options
|
61
86
|
```
|
62
87
|
|
data/lib/cronitor.rb
CHANGED
@@ -11,8 +11,16 @@ class Cronitor
|
|
11
11
|
API_URL = 'https://cronitor.io/v3'
|
12
12
|
PING_URL = 'https://cronitor.link'
|
13
13
|
|
14
|
+
class << self
|
15
|
+
attr_accessor :default_token
|
16
|
+
|
17
|
+
def configure(&block)
|
18
|
+
block.call(self)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
def initialize(token: ENV['CRONITOR_TOKEN'], opts: {}, code: nil)
|
15
|
-
@token = token
|
23
|
+
@token = token || self.class.default_token
|
16
24
|
@opts = opts
|
17
25
|
@code = code
|
18
26
|
|
data/lib/cronitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Byrnes
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.1'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
113
|
- thejeffbyrnes@gmail.com
|
114
114
|
executables: []
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
homepage: https://github.com/evertrue/cronitor
|
134
134
|
licenses: []
|
135
135
|
metadata: {}
|
136
|
-
post_install_message:
|
136
|
+
post_install_message:
|
137
137
|
rdoc_options: []
|
138
138
|
require_paths:
|
139
139
|
- lib
|
@@ -148,8 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.1.
|
152
|
-
signing_key:
|
151
|
+
rubygems_version: 3.1.4
|
152
|
+
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: An interface for the Cronitor API
|
155
155
|
test_files: []
|