riemann-babbler 2.0.0pre7 → 2.0.0pre8
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.
- data/Gemfile.lock +11 -2
- data/lib/riemann/babbler/options.rb +11 -3
- data/lib/riemann/babbler/plugin_loader.rb +5 -4
- data/lib/riemann/babbler/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
riemann-babbler (2.0.
|
4
|
+
riemann-babbler (2.0.0pre7)
|
5
5
|
configatron
|
6
6
|
docile
|
7
|
+
file-tail
|
7
8
|
net-http-server
|
9
|
+
net-ping
|
8
10
|
rest-client
|
9
11
|
riemann-client
|
10
12
|
sys-filesystem
|
13
|
+
sys-proctable
|
11
14
|
trollop
|
12
15
|
|
13
16
|
GEM
|
@@ -20,11 +23,15 @@ GEM
|
|
20
23
|
yamler (>= 0.1.0)
|
21
24
|
docile (1.1.0)
|
22
25
|
ffi (1.9.0)
|
26
|
+
file-tail (1.0.12)
|
27
|
+
tins (~> 0.5)
|
23
28
|
method_source (0.8.2)
|
24
|
-
mime-types (
|
29
|
+
mime-types (2.0)
|
25
30
|
mtrc (0.0.4)
|
26
31
|
net-http-server (0.2.2)
|
27
32
|
parslet (~> 1.0)
|
33
|
+
net-ping (1.7.1)
|
34
|
+
ffi (>= 1.0.0)
|
28
35
|
parslet (1.5.0)
|
29
36
|
blankslate (~> 2.0)
|
30
37
|
pry (0.9.12.2)
|
@@ -41,6 +48,8 @@ GEM
|
|
41
48
|
slop (3.4.6)
|
42
49
|
sys-filesystem (1.1.1)
|
43
50
|
ffi
|
51
|
+
sys-proctable (0.9.3)
|
52
|
+
tins (0.12.0)
|
44
53
|
trollop (2.0)
|
45
54
|
yamler (0.1.0)
|
46
55
|
|
@@ -24,12 +24,20 @@ module Riemann
|
|
24
24
|
opts.configure_from_hash(result_config)
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
# return string tw_cli_3
|
28
|
+
def name_to_underscore(name = 'Riemann::Babbler::Plugin::TwCli_3')
|
28
29
|
name.split('::').last.gsub(/(\p{Lower})(\p{Upper})/, "\\1_\\2").downcase
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
-
|
32
|
+
# return string Riemann::Babbler::Plugin::TwCli_3
|
33
|
+
def underscore_to_name(name = 'tw_cli_3', parent = 'Riemann::Babbler::Plugin')
|
34
|
+
parent + '::' + name.to_s.split('_').map { |part|
|
35
|
+
if part.to_i != 0
|
36
|
+
"_#{part}"
|
37
|
+
else
|
38
|
+
part.capitalize
|
39
|
+
end
|
40
|
+
}.join('')
|
33
41
|
end
|
34
42
|
|
35
43
|
def self.included(base)
|
@@ -52,10 +52,11 @@ module Riemann
|
|
52
52
|
opts.plugins.to_hash.each do |plugin_name, plugin_opts|
|
53
53
|
next if plugin_opts.nil?
|
54
54
|
next unless plugin_opts.kind_of?(Hash)
|
55
|
-
if plugin_opts.has_key?
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
if plugin_opts.has_key? :parent
|
56
|
+
cmd = "class #{underscore_to_name plugin_name} < #{underscore_to_name plugin_opts[:parent]}; end;"
|
57
|
+
cmd += "Riemann::Babbler::Plugin.registered_plugins << #{underscore_to_name plugin_name}"
|
58
|
+
puts "CMD: #{cmd}"
|
59
|
+
eval(cmd)
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-babbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.0pre8
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riemann-client
|