uppityrobot 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish.yml +40 -0
- data/Gemfile.lock +5 -5
- data/README.md +1 -1
- data/Rakefile +4 -0
- data/lib/uppityrobot/tasks/uppityrobot.rake +6 -3
- data/lib/uppityrobot/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9397823fd8a288fb052f7a4dcc0278279e16375e9182183298334a6c7228ae77
|
4
|
+
data.tar.gz: 819f188c12700edbbfc415619f603b8a1ba73fdbc24e4dc7346aa55a580d501e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08f3bd70fc1565abed8e97987db929e3e9146f57f36ff751cde51111b9e3d238bfd787fb13be27d736a5eaedf870434f648d301c43822f3daeebbf513b57ee6d'
|
7
|
+
data.tar.gz: 44b1f4ba2c5f16520805fe8bf658996d324760e86fe956c9e9778afe19f63249db476e8f6692d757fdd544b88202bcc9cd538819895b05991f2d13d041843f52
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: Publish Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
- master
|
8
|
+
jobs:
|
9
|
+
publish:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: write
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
|
17
|
+
- name: Setup Ruby and install gems
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
bundler-cache: true
|
21
|
+
ruby-version: 2.7
|
22
|
+
rubygems: latest
|
23
|
+
|
24
|
+
- name: Release Gem
|
25
|
+
run: |
|
26
|
+
VERSION=$(bundle exec rake version)
|
27
|
+
GEM_VERSION=$(gem list --exact --remote $GEM_NAME)
|
28
|
+
# Publish to RubyGems.org
|
29
|
+
if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
|
30
|
+
gem build $GEM_NAME.gemspec
|
31
|
+
gem push "$GEM_NAME-${VERSION}.gem"
|
32
|
+
fi
|
33
|
+
# Create a release tag
|
34
|
+
if ! git ls-remote --tags --exit-code origin v${VERSION}; then
|
35
|
+
git tag v${VERSION}
|
36
|
+
git push --tags
|
37
|
+
fi
|
38
|
+
env:
|
39
|
+
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
|
40
|
+
GEM_NAME: uppityrobot
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
uppityrobot (0.
|
4
|
+
uppityrobot (0.4.0)
|
5
5
|
dry-cli (~> 0.7)
|
6
6
|
json (~> 2.5)
|
7
7
|
uptimerobot (~> 0.2)
|
@@ -84,8 +84,8 @@ GEM
|
|
84
84
|
faraday-em_synchrony (1.0.0)
|
85
85
|
faraday-excon (1.1.0)
|
86
86
|
faraday-httpclient (1.0.1)
|
87
|
-
faraday-multipart (1.0.
|
88
|
-
multipart-post (
|
87
|
+
faraday-multipart (1.0.4)
|
88
|
+
multipart-post (~> 2)
|
89
89
|
faraday-net_http (1.0.1)
|
90
90
|
faraday-net_http_persistent (1.2.0)
|
91
91
|
faraday-patron (1.0.0)
|
@@ -95,7 +95,7 @@ GEM
|
|
95
95
|
faraday (~> 1.0)
|
96
96
|
ffi (1.15.4)
|
97
97
|
hashdiff (1.0.1)
|
98
|
-
json (2.6.
|
98
|
+
json (2.6.2)
|
99
99
|
json_spec (1.1.5)
|
100
100
|
multi_json (~> 1.0)
|
101
101
|
rspec (>= 2.0, < 4.0)
|
@@ -107,7 +107,7 @@ GEM
|
|
107
107
|
mini_portile2 (2.6.1)
|
108
108
|
multi_json (1.15.0)
|
109
109
|
multi_test (0.1.2)
|
110
|
-
multipart-post (2.
|
110
|
+
multipart-post (2.2.3)
|
111
111
|
mustermann (1.1.1)
|
112
112
|
ruby2_keywords (~> 0.0.1)
|
113
113
|
nokogiri (1.12.4)
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -55,6 +55,7 @@ namespace :uppityrobot do
|
|
55
55
|
data = row.to_hash
|
56
56
|
name = data["friendly_name"]
|
57
57
|
url = data["url"]
|
58
|
+
interval = data.fetch("interval", 300)
|
58
59
|
|
59
60
|
begin
|
60
61
|
if !current_monitors.key?(name)
|
@@ -62,15 +63,17 @@ namespace :uppityrobot do
|
|
62
63
|
d = {
|
63
64
|
friendly_name: name,
|
64
65
|
url: url,
|
66
|
+
interval: interval,
|
65
67
|
type: UptimeRobot::Monitor::Type::HTTP,
|
66
68
|
subtype: UptimeRobot::Monitor::SubType::HTTPS,
|
67
69
|
alert_contacts: contacts
|
68
70
|
}
|
69
71
|
UppityRobot::Client.new(:newMonitor, d).execute
|
70
|
-
elsif current_monitors.key?(name) &&
|
71
|
-
|
72
|
+
elsif current_monitors.key?(name) &&
|
73
|
+
(current_monitors[name]["url"] != url || current_monitors[name]["interval"] != interval)
|
74
|
+
puts "Updating monitor: #{current_monitors[name]["url"]} TO #{url} [#{interval}] WITH CONTACTS #{contacts}"
|
72
75
|
# avoid uptimerobot client weirdness
|
73
|
-
d = { id: current_monitors[name]["id"], url: url, alert_contacts: contacts }.dup
|
76
|
+
d = { id: current_monitors[name]["id"], url: url, interval: interval, alert_contacts: contacts }.dup
|
74
77
|
UppityRobot::Client.new(:editMonitor, d).execute
|
75
78
|
end
|
76
79
|
rescue UptimeRobot::Error => e
|
data/lib/uppityrobot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uppityrobot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Cooper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -201,6 +201,7 @@ extensions: []
|
|
201
201
|
extra_rdoc_files: []
|
202
202
|
files:
|
203
203
|
- ".github/workflows/main.yml"
|
204
|
+
- ".github/workflows/publish.yml"
|
204
205
|
- ".gitignore"
|
205
206
|
- ".rspec"
|
206
207
|
- ".rubocop.yml"
|
@@ -256,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
257
|
- !ruby/object:Gem::Version
|
257
258
|
version: '0'
|
258
259
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
260
|
+
rubygems_version: 3.3.18
|
260
261
|
signing_key:
|
261
262
|
specification_version: 4
|
262
263
|
summary: Command line wrapper for the UptimeRobot API (wrapper).
|