dogwatch 1.1.0 → 1.1.1
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/.rubocop_todo.yml +11 -2
- data/bin/dogwatch +7 -1
- data/lib/dogwatch/dogfile.rb +15 -4
- data/test/dogwatch/test_options.rb +0 -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: a39a0f7aaeccd5b968f92b1255300d1d30cb30f3
|
|
4
|
+
data.tar.gz: bf9c58630253ace4b615550f07835a1271359eb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b69d626890eec8901212dad6ca9dbd65f84823806f375be63ac84b26a91d7f330675ef62170d2b929ba70171deaeb1eaa24f3e0618566b4375866febc3ec4a89
|
|
7
|
+
data.tar.gz: 5b7ae583b65df6536f14390af197a6c6e6bddd9825fd845b001453ef109106b0126e081f93264e24de66d2ae58bea28d7b507ffa0fa2271679dcde2daef97e0f
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
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:
|
|
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:
|
data/bin/dogwatch
CHANGED
|
@@ -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
|
|
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
|
data/lib/dogwatch/dogfile.rb
CHANGED
|
@@ -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.
|
|
25
|
-
|
|
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
|
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.
|
|
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-
|
|
11
|
+
date: 2017-07-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dogapi
|