doggy 2.0.36 → 2.0.37
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/Gemfile.lock +1 -1
- data/lib/doggy/cli.rb +7 -3
- data/lib/doggy/cli/mute.rb +1 -0
- data/lib/doggy/cli/unmute.rb +5 -4
- data/lib/doggy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6ca3e8dffbd2ec37317f14aa6b824324abd4cb3
|
|
4
|
+
data.tar.gz: 8b72ae39c4fce2e3a9e3f205689e3d0a1c695ae5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86313aa953b60dc71bf0ba9d425d20daf1e6585a5a66cace87898f12de58ac57315ad980ebd141c4f2235fb09e58c5e3ffe90c912257d7d6475072363cda24a0
|
|
7
|
+
data.tar.gz: 9f607bf285f1b58ae97d3d927368a44ce1a4e842ab220a5b2113d76df2ef981a778bd4ac7d4f9701fd736a8b9261e72da1e846a2b3d1d936a53214e0379a5b05
|
data/Gemfile.lock
CHANGED
data/lib/doggy/cli.rb
CHANGED
|
@@ -47,23 +47,27 @@ module Doggy
|
|
|
47
47
|
CLI::Push.new.push_all(ids)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
desc
|
|
50
|
+
desc 'mute IDs [--duration DURATION]', 'Mutes given monitors indefinitely or for the specific duration'
|
|
51
51
|
long_desc <<-D
|
|
52
52
|
IDs is a space separated list of item IDs.
|
|
53
53
|
If `--duration` is not given, item will be muted indefinitely.
|
|
54
54
|
D
|
|
55
55
|
|
|
56
|
-
method_option
|
|
56
|
+
method_option 'duration', type: :string, desc: 'Mute only for the given period of time.'
|
|
57
|
+
method_option 'scope', type: :string, desc: 'The scope to apply the mute to.'
|
|
57
58
|
|
|
58
59
|
def mute(*ids)
|
|
59
60
|
CLI::Mute.new(options.dup, ids).run
|
|
60
61
|
end
|
|
61
62
|
|
|
62
|
-
desc
|
|
63
|
+
desc 'unmute IDs', 'Unmutes given monitors'
|
|
63
64
|
long_desc <<-D
|
|
64
65
|
IDs is a space separated list of item IDs.
|
|
65
66
|
D
|
|
66
67
|
|
|
68
|
+
method_option 'scope', type: :string, desc: 'The scope to apply the unmute to.'
|
|
69
|
+
method_option 'all_scopes', type: :boolean, default: false, desc: 'Clear muting across all scopes.'
|
|
70
|
+
|
|
67
71
|
def unmute(*ids)
|
|
68
72
|
CLI::Unmute.new(options.dup, ids).run
|
|
69
73
|
end
|
data/lib/doggy/cli/mute.rb
CHANGED
|
@@ -15,6 +15,7 @@ module Doggy
|
|
|
15
15
|
if @options['duration']
|
|
16
16
|
body[:end] = Time.now.utc.to_i + Duration.parse(@options['duration']).to_i
|
|
17
17
|
end
|
|
18
|
+
body[:scope] = @options['scope'] if @options['scope']
|
|
18
19
|
monitors.each { |monitor| monitor.toggle_mute!('mute', JSON.dump(body)) }
|
|
19
20
|
end
|
|
20
21
|
end
|
data/lib/doggy/cli/unmute.rb
CHANGED
|
@@ -4,14 +4,15 @@ module Doggy
|
|
|
4
4
|
class CLI::Unmute
|
|
5
5
|
def initialize(options, ids)
|
|
6
6
|
@options = options
|
|
7
|
-
@ids
|
|
7
|
+
@ids = ids
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def run
|
|
11
11
|
monitors = @ids.map { |id| Doggy::Models::Monitor.find(id) }
|
|
12
|
-
|
|
12
|
+
body = {}
|
|
13
|
+
body[:all_scopes] = true if @options['all_scopes']
|
|
14
|
+
body[:scope] = @options['scope'] if @options['scope']
|
|
15
|
+
monitors.each { |monitor| monitor.toggle_mute!('unmute', JSON.dump(body)) }
|
|
13
16
|
end
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
|
-
|
|
17
|
-
|
data/lib/doggy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: doggy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.37
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vlad Gorodetsky
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-12-
|
|
12
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json
|