doggy 2.0.36 → 2.0.37

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: 1d39f4f63d4b4b124cc616000333e14fc3822411
4
- data.tar.gz: c13787f15576b9724b3b45f470499c1a900eb3a1
3
+ metadata.gz: e6ca3e8dffbd2ec37317f14aa6b824324abd4cb3
4
+ data.tar.gz: 8b72ae39c4fce2e3a9e3f205689e3d0a1c695ae5
5
5
  SHA512:
6
- metadata.gz: c183eba4b8589802d765f93eb2b0d694b988441e437b14f8a410f9f2f0465bd06a87e35422822c39c8de7bd2a4591d827c40414f4514057ea0c6e073aa8aa679
7
- data.tar.gz: f9419f6950b73107f097f9cc3f0f65711bc38e5012653a27c023383559cbcd7cd3c5141ad451681ac019d44f3a04be64d6f446f7823934040396c975ba3dcaed
6
+ metadata.gz: 86313aa953b60dc71bf0ba9d425d20daf1e6585a5a66cace87898f12de58ac57315ad980ebd141c4f2235fb09e58c5e3ffe90c912257d7d6475072363cda24a0
7
+ data.tar.gz: 9f607bf285f1b58ae97d3d927368a44ce1a4e842ab220a5b2113d76df2ef981a778bd4ac7d4f9701fd736a8b9261e72da1e846a2b3d1d936a53214e0379a5b05
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doggy (2.0.36)
4
+ doggy (2.0.37)
5
5
  activesupport (~> 4)
6
6
  json (~> 1.8.3)
7
7
  parallel (~> 1.6.1)
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 "mute IDs [--duration DURATION]", "Mutes given monitors indefinitely or for the specific duration"
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 "duration", type: :string, desc: 'Mute only for the given period of time.'
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 "unmute IDs", "Unmutes given monitors"
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
@@ -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
@@ -4,14 +4,15 @@ module Doggy
4
4
  class CLI::Unmute
5
5
  def initialize(options, ids)
6
6
  @options = options
7
- @ids = 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
- monitors.each { |monitor| monitor.toggle_mute!('unmute') }
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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Doggy
4
- VERSION = '2.0.36'
4
+ VERSION = '2.0.37'
5
5
  end
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.36
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 00:00:00.000000000 Z
12
+ date: 2016-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json