dogwatch 1.1.0 → 1.1.1

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: 224be9842797fe4c2fc9c0cf3d88a9972759d54f
4
- data.tar.gz: 5b14f7af6a5a64146640832cf53aa16fe350d0bc
3
+ metadata.gz: a39a0f7aaeccd5b968f92b1255300d1d30cb30f3
4
+ data.tar.gz: bf9c58630253ace4b615550f07835a1271359eb1
5
5
  SHA512:
6
- metadata.gz: f98c42c081bbf044495be9c26272e03699a74d581e9653cf5b6a21c8a3103c45d3d06b27b2c7faf8714b8033a928e5bdee2bffa8c95cb7b14e82ba452b6981d8
7
- data.tar.gz: 026bf75a19af2a701511e8d7222dc176bf856fc4bac7ddee1cda6458eb09de0a46ea357836749a0cc015e054a0a3a84ef0438e03aeb7d12fdf069e6378c379ae
6
+ metadata.gz: b69d626890eec8901212dad6ca9dbd65f84823806f375be63ac84b26a91d7f330675ef62170d2b929ba70171deaeb1eaa24f3e0618566b4375866febc3ec4a89
7
+ data.tar.gz: 5b7ae583b65df6536f14390af197a6c6e6bddd9825fd845b001453ef109106b0126e081f93264e24de66d2ae58bea28d7b507ffa0fa2271679dcde2daef97e0f
@@ -1,17 +1,26 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-06-01 14:50:11 +0100 using RuboCop version 0.40.0.
3
+ # on 2017-07-13 10:26:09 -0400 using RuboCop version 0.40.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
9
+ # Offense count: 1
10
+ Metrics/AbcSize:
11
+ Max: 19
12
+
13
+ # Offense count: 7
10
14
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
11
15
  # URISchemes: http, https
12
16
  Metrics/LineLength:
13
17
  Max: 90
14
18
 
19
+ # Offense count: 1
20
+ # Configuration parameters: CountComments.
21
+ Metrics/MethodLength:
22
+ Max: 11
23
+
15
24
  # Offense count: 1
16
25
  # Cop supports --auto-correct.
17
26
  Performance/RedundantBlockCall:
@@ -11,6 +11,7 @@ module DogWatch
11
11
  class_option :api_key, :type => :string, :default => nil
12
12
  class_option :app_key, :type => :string, :default => nil
13
13
  class_option :timeout, :type => :numeric, :default => 5
14
+ class_option :verbose, :type => :boolean, :default => false
14
15
  def initialize(*args)
15
16
  super
16
17
  @cwd = Dir.getwd
@@ -22,7 +23,12 @@ module DogWatch
22
23
  @dogfile.configure(File.absolute_path(options['dogfile'], @cwd),
23
24
  options['api_key'], options['app_key'],
24
25
  options['timeout'])
25
- @dogfile.create { |c| say_status(*c.to_thor) }
26
+ @dogfile.create do |c|
27
+ results = c.to_thor
28
+ next if results.first == :none && options['verbose'] == false
29
+
30
+ say_status(*results)
31
+ end
26
32
  end
27
33
  end
28
34
  end
@@ -18,11 +18,22 @@ module DogWatch
18
18
  # @param [Proc] block
19
19
  def create(&block)
20
20
  monitor = instance_eval(IO.read(@dogfile), @dogfile, 1)
21
- monitor.config = @config
22
- monitor.client
23
21
 
24
- monitor.get
25
- monitor.responses.each { |r| block.call(r) }
22
+ if monitor.is_a?(DogWatch::Monitor)
23
+ monitor.config = @config
24
+ monitor.client
25
+
26
+ monitor.get
27
+ monitor.responses.each { |r| block.call(r) }
28
+ else
29
+ klass = Class.new do
30
+ def to_thor
31
+ [:none, 'File does not contain any monitors.', :yellow]
32
+ end
33
+ end
34
+
35
+ block.call(klass.new)
36
+ end
26
37
  end
27
38
  end
28
39
  end
@@ -13,7 +13,6 @@ class TestOptions < Minitest::Test
13
13
  include_tags: false
14
14
  }.freeze
15
15
 
16
- # rubocop:disable Metrics/AbcSize
17
16
  def setup
18
17
  @options = DogWatch::Model::Options.new
19
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Greene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-25 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dogapi