riemann-babbler 1.4.0 → 2.0.0pre1

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.
Files changed (51) hide show
  1. data/.gitignore +2 -0
  2. data/Gemfile +2 -16
  3. data/Gemfile.lock +25 -39
  4. data/LICENSE.txt +22 -0
  5. data/README.md +18 -16
  6. data/bin/riemann-babbler +30 -10
  7. data/lib/riemann/babbler/errors.rb +13 -0
  8. data/lib/riemann/babbler/logging.rb +36 -0
  9. data/lib/riemann/babbler/{support/deep_merge.rb → monkey_patches.rb} +25 -16
  10. data/lib/riemann/babbler/options.rb +43 -0
  11. data/lib/riemann/babbler/plugin.rb +154 -0
  12. data/lib/riemann/babbler/plugin_loader.rb +86 -0
  13. data/lib/riemann/babbler/plugins/cpu.rb +14 -11
  14. data/lib/riemann/babbler/plugins/cpu_fan.rb +2 -2
  15. data/lib/riemann/babbler/plugins/cpu_temp.rb +2 -2
  16. data/lib/riemann/babbler/plugins/disk.rb +12 -6
  17. data/lib/riemann/babbler/plugins/{diskstat.rb → disk_stat.rb} +18 -18
  18. data/lib/riemann/babbler/plugins/errors_reporter.rb +34 -0
  19. data/lib/riemann/babbler/plugins/exim4.rb +2 -2
  20. data/lib/riemann/babbler/plugins/find_files.rb +7 -7
  21. data/lib/riemann/babbler/plugins/haproxy.rb +7 -7
  22. data/lib/riemann/babbler/plugins/helpers/init.rb +2 -0
  23. data/lib/riemann/babbler/plugins/helpers/rest.rb +28 -0
  24. data/lib/riemann/babbler/plugins/helpers/shell.rb +37 -0
  25. data/lib/riemann/babbler/plugins/http.rb +4 -6
  26. data/lib/riemann/babbler/plugins/la.rb +11 -3
  27. data/lib/riemann/babbler/plugins/mdadm.rb +10 -10
  28. data/lib/riemann/babbler/plugins/mega_cli.rb +2 -2
  29. data/lib/riemann/babbler/plugins/memory.rb +21 -17
  30. data/lib/riemann/babbler/plugins/net.rb +7 -5
  31. data/lib/riemann/babbler/plugins/net_stat.rb +5 -5
  32. data/lib/riemann/babbler/plugins/nginx.rb +2 -2
  33. data/lib/riemann/babbler/plugins/pgsql.rb +13 -13
  34. data/lib/riemann/babbler/plugins/runit.rb +6 -7
  35. data/lib/riemann/babbler/plugins/status_file.rb +4 -4
  36. data/lib/riemann/babbler/plugins/tw_cli.rb +5 -5
  37. data/lib/riemann/babbler/responder.rb +45 -0
  38. data/lib/riemann/babbler/sender.rb +102 -0
  39. data/lib/riemann/babbler/version.rb +2 -2
  40. data/lib/riemann/babbler.rb +8 -175
  41. data/riemann-babbler.gemspec +30 -26
  42. metadata +39 -38
  43. data/config.yml +0 -72
  44. data/lib/riemann/babbler/plugins/dummy.rb +0 -12
  45. data/lib/riemann/babbler/start.rb +0 -159
  46. data/lib/riemann/babbler/support/errors.rb +0 -3
  47. data/lib/riemann/babbler/support/monkey_patches.rb +0 -42
  48. data/lib/riemann/babbler/support/plugin_helpers.rb +0 -104
  49. data/lib/riemann/babbler/support/responder.rb +0 -29
  50. data/spec/config.yml +0 -15
  51. data/spec/default.rb +0 -61
@@ -1,4 +1,4 @@
1
- class Riemann::Babbler::Pgsql < Riemann::Babbler
1
+ class Riemann::Babbler::Plugin::Pgsql < Riemann::Babbler::Plugin
2
2
 
3
3
  def init
4
4
  plugin.set_default(:service, 'pgsql')
@@ -30,21 +30,21 @@ class Riemann::Babbler::Pgsql < Riemann::Babbler
30
30
 
31
31
  # connection to pg
32
32
  def connections
33
- max_conn = run_sql("show max_connections").to_i
34
- res_conn = run_sql("show superuser_reserved_connections").to_i
35
- cur_conn = run_sql("select count(1) from pg_stat_activity;").to_i
33
+ max_conn = run_sql('show max_connections').to_i
34
+ res_conn = run_sql('show superuser_reserved_connections').to_i
35
+ cur_conn = run_sql('select count(1) from pg_stat_activity;').to_i
36
36
  [cur_conn, (max_conn - res_conn - cur_conn)]
37
37
  end
38
38
 
39
39
  def rep_lag_state
40
- rep_lag = run_sql(plugin.rep_lag_sql).to_i
41
- if rep_lag >= plugin.rep_lag_crit || rep_lag == 0
42
- { :service => plugin.service + ' rep_lag', :description => "Postgresql replication lag state", :state => 'critical', :metric => rep_lag }
40
+ rep_lag = abs(run_sql(plugin.rep_lag_sql).to_i)
41
+ if rep_lag >= plugin.rep_lag_crit
42
+ { :service => plugin.service + ' rep_lag', :description => 'Postgresql replication lag state', :state => 'critical', :metric => rep_lag }
43
43
  elsif rep_lag >= plugin.rep_lag_warn
44
- { :service => plugin.service + ' rep_lag', :description => "Postgresql replication lag state", :state => 'warning', :metric => rep_lag }
44
+ { :service => plugin.service + ' rep_lag', :description => 'Postgresql replication lag state', :state => 'warning', :metric => rep_lag }
45
45
  else
46
- { :service => plugin.service + ' rep_lag', :description => "Postgresql replication lag state", :state => 'ok', :metric => rep_lag }
47
- end
46
+ { :service => plugin.service + ' rep_lag', :description => 'Postgresql replication lag state', :state => 'ok', :metric => rep_lag }
47
+ end
48
48
  end
49
49
 
50
50
  def collect
@@ -53,14 +53,14 @@ class Riemann::Babbler::Pgsql < Riemann::Babbler
53
53
  cur_conn, res_conn = connections
54
54
 
55
55
  status << rep_lag_state if in_recovery?
56
- status << { :service => plugin.service + ' connections', :description => "Postgresql current connections", :state => 'ok', :metric => cur_conn }
56
+ status << { :service => plugin.service + ' connections', :description => 'Postgresql current connections', :state => 'ok', :metric => cur_conn }
57
57
 
58
58
  # check reserved pool size
59
59
  if res_conn < plugin.conn_warn
60
60
  if res_conn > plugin.conn_crit
61
- status << { :service => plugin.service + ' reserved connections', :description => "Postgresql reserved connections state", :state => 'warning', :metric => res_conn }
61
+ status << { :service => plugin.service + ' reserved connections', :description => 'Postgresql reserved connections state', :state => 'warning', :metric => res_conn }
62
62
  else
63
- status << { :service => plugin.service + ' reserved connections', :description => "Postgresql reserved connections state", :state => 'critical', :metric => res_conn }
63
+ status << { :service => plugin.service + ' reserved connections', :description => 'Postgresql reserved connections state', :state => 'critical', :metric => res_conn }
64
64
  end
65
65
  end
66
66
 
@@ -1,10 +1,9 @@
1
- class Riemann::Babbler::Runit < Riemann::Babbler
1
+ class Riemann::Babbler::Plugin::Runit < Riemann::Babbler::Plugin
2
2
 
3
3
  def init
4
4
  plugin.set_default(:service, 'runit')
5
- plugin.set_default(:not_monit, ['riemann-client'])
5
+ plugin.set_default(:not_monit, %w(riemann-client))
6
6
  plugin.set_default(:interval, 60)
7
-
8
7
  @status_history = Array.new
9
8
  end
10
9
 
@@ -22,7 +21,7 @@ class Riemann::Babbler::Runit < Riemann::Babbler
22
21
  def runned?(service)
23
22
  stat_file = File.join(service, 'supervise', 'stat')
24
23
  return false unless File.exists?(stat_file)
25
- File.read( stat_file ).strip == 'run'
24
+ File.read(stat_file).strip == 'run'
26
25
  end
27
26
 
28
27
  def human_srv(service)
@@ -40,12 +39,12 @@ class Riemann::Babbler::Runit < Riemann::Babbler
40
39
  next if not_monit?(srv)
41
40
  srv_uptime = uptime(srv)
42
41
  srv_runned = runned?(srv)
43
- srv_name = human_srv(srv)
42
+ srv_name = human_srv(srv)
44
43
 
45
44
  # сервис запущен и работает дольше чем мы приходили к нему в прошлый раз
46
45
  if srv_runned && srv_uptime > plugin.interval
47
46
  @status_history.delete(srv_name)
48
- status << {:service => plugin.service + ' ' + srv_name , :state => 'ok', :description => "runit service #{srv_name} running", :metric => srv_uptime}
47
+ status << { :service => plugin.service + ' ' + srv_name, :state => 'ok', :description => "runit service #{srv_name} running", :metric => srv_uptime }
49
48
  else
50
49
  # сервис запущен но работает подозрительно мало, но последний раз замечен не был
51
50
  if srv_uptime < plugin.interval && srv_runned && !@status_history.include?(srv_name)
@@ -53,7 +52,7 @@ class Riemann::Babbler::Runit < Riemann::Babbler
53
52
  @status_history << srv_name
54
53
  else
55
54
  # во всех остальных случаях сообщаем о проблеме
56
- status << {:service => plugin.service + ' ' + srv_name , :state => 'critical', :description => "runit service #{srv_name} not running", :metric => srv_uptime}
55
+ status << { :service => plugin.service + ' ' + srv_name, :state => 'critical', :description => "runit service #{srv_name} not running", :metric => srv_uptime }
57
56
  end
58
57
  end
59
58
 
@@ -1,4 +1,4 @@
1
- class Riemann::Babbler::StatusFile < Riemann::Babbler
1
+ class Riemann::Babbler::Plugin::StatusFile < Riemann::Babbler::Plugin
2
2
 
3
3
  def init
4
4
  plugin.set_default(:service, 'check state file')
@@ -11,11 +11,11 @@ class Riemann::Babbler::StatusFile < Riemann::Babbler
11
11
 
12
12
  def collect
13
13
  return [] unless File.exists? plugin.file
14
- content = File.read(plugin.file).split("\n").delete_if {|x| x.strip.empty? }
14
+ content = File.read(plugin.file).split("\n").delete_if { |x| x.strip.empty? }
15
15
  {
16
- :service => plugin.service + " #{plugin.file}",
16
+ :service => plugin.service + " #{plugin.file}",
17
17
  :description => content.last(plugin.report_lines).join("\n"),
18
- :metric => content.count
18
+ :metric => content.count
19
19
  }
20
20
  end
21
21
 
@@ -1,4 +1,4 @@
1
- class Riemann::Babbler::TwCli < Riemann::Babbler
1
+ class Riemann::Babbler::Plugin::TwCli < Riemann::Babbler::Plugin
2
2
 
3
3
  def init
4
4
  plugin.set_default(:service, 'twcli')
@@ -12,10 +12,10 @@ class Riemann::Babbler::TwCli < Riemann::Babbler
12
12
  end
13
13
 
14
14
  def collect
15
- {
16
- :service => plugin.service,
17
- :metric => shell(plugin.cmd).to_i,
18
- :description => 'Hardware raid tw_cli status'
15
+ {
16
+ :service => plugin.service,
17
+ :metric => shell(plugin.cmd).to_i,
18
+ :description => 'Hardware raid tw_cli status'
19
19
  }
20
20
  end
21
21
 
@@ -0,0 +1,45 @@
1
+ require 'net/http/server'
2
+ require 'json'
3
+
4
+ module Riemann
5
+ module Babbler
6
+
7
+ class Responder
8
+
9
+
10
+ include Riemann::Babbler::Logging
11
+ include Riemann::Babbler::Options
12
+
13
+ attr_accessor :port, :errors, :config, :started_at
14
+
15
+ def initialize
16
+ @port = opts.riemann.responder_port
17
+ @started_at = Time.now.to_i
18
+ @errors = opts.errors
19
+ @config = opts.riemann
20
+ end
21
+
22
+ def info
23
+ {
24
+ :version => Riemann::Babbler::VERSION,
25
+ :ruby => "#{RUBY_VERSION}-#{RUBY_PATCHLEVEL}",
26
+ :uptime => Time.now.to_i - started_at,
27
+ :errors => errors.to_hash,
28
+ :config => config.to_hash
29
+ }
30
+ end
31
+
32
+ def run!
33
+ Thread.new {
34
+ log :unknown, "Start responder 0.0.0.0:#{port}"
35
+ Net::HTTP::Server.run(:port => port) do |request, _|
36
+ log :debug, "Responder request: #{request}"
37
+ [200, { 'Content-Type' => 'application/json' }, [info.to_json]]
38
+ end
39
+ }
40
+ end
41
+ end
42
+
43
+ end
44
+ end
45
+
@@ -0,0 +1,102 @@
1
+ require 'riemann/client'
2
+ require 'resolv'
3
+ require 'socket'
4
+
5
+ module Riemann
6
+ module Babbler
7
+
8
+ class Sender
9
+
10
+ include Riemann::Babbler::Logging
11
+ include Riemann::Babbler::Options
12
+ include Riemann::Babbler::Errors
13
+
14
+ attr_accessor :sender
15
+
16
+ HOSTNAME_FILE = '/proc/sys/kernel/hostname'
17
+
18
+ def initialize
19
+ @sender = build_riemann_client
20
+ @hostname = hostname
21
+ end
22
+
23
+ alias :r :sender
24
+
25
+ def build_riemann_client
26
+ @sender = Riemann::Client.new(
27
+ :host => resolv(opts.riemann.host), #todo: add ttl
28
+ :port => opts.riemann.port,
29
+ :timeout => opts.riemann.timeout
30
+ )
31
+ @sender = @sender.tcp if opts.riemann.tcp
32
+ connect_client(@sender)
33
+ @sender
34
+ end
35
+
36
+ #@return ipaddress of riemann server
37
+ def resolv(host)
38
+ begin
39
+ ip = Resolv.new.getaddress(host)
40
+ log :debug, "Resolv host: #{host} => #{ip}"
41
+ rescue
42
+ log :fatal, "Can't resolv hostname: #{host}"
43
+ exit Errors::RESOLV_RIEMANN_SERVER
44
+ end
45
+ ip
46
+ end
47
+
48
+ #@return connect to riemann
49
+ def connect_client(riemann)
50
+ begin
51
+ connect = @sender.connect
52
+ log :debug, "Connected to #{riemann.host}:#{riemann.port}"
53
+ rescue
54
+ log :fatal, "Can't connect to riemann server: #{riemann.host}:#{riemann.port}"
55
+ exit Errors::INIT_CONNECT
56
+ end
57
+ connect
58
+ end
59
+
60
+ def <<(event)
61
+ set_event_hostname(event)
62
+ set_event_tags(event)
63
+ log :debug, "Post event: #{event}"
64
+ send_with_rescue(event, opts.riemann.timeout)
65
+ end
66
+
67
+ def send_with_rescue(event, timeout)
68
+ begin
69
+ Timeout::timeout(timeout) {
70
+ @sender << event
71
+ }
72
+ rescue
73
+ log :fatal, "Connection problem with #{@sender.host}:#{@sender.port}, exit."
74
+ exit Errors::CONNECTION_PROBLEM
75
+ end
76
+ end
77
+
78
+ def set_event_tags(event)
79
+ unless opts.riemann.tags.nil?
80
+ event[:tags] = opts.riemann.tags unless event[:tags]
81
+ end
82
+ end
83
+
84
+ def set_event_hostname(event)
85
+ event[:host] = @hostname unless event[:host]
86
+ end
87
+
88
+ def hostname
89
+ if opts.riemann.fqdn
90
+ hostname = Socket.gethostbyname(Socket.gethostname).first
91
+ log :debug, "Get hostname from Socket.gethostname: #{hostname}"
92
+ else
93
+ hostname = File.read(HOSTNAME_FILE).strip.downcase if File.exist? HOSTNAME_FILE
94
+ log :debug, "Get hostname from #{HOSTNAME_FILE}: #{hostname}"
95
+ end
96
+ hostname
97
+ end
98
+
99
+ end
100
+
101
+ end
102
+ end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
- class Babbler
3
- VERSION = '1.4.0'
2
+ module Babbler
3
+ VERSION = '2.0.0pre1'
4
4
  end
5
5
  end
@@ -1,175 +1,8 @@
1
- # encoding: utf-8
2
-
3
- require 'riemann/babbler/support/plugin_helpers'
4
- require 'riemann/client'
5
- require 'open3'
6
- require 'timeout'
7
- require 'rest_client'
8
- require 'socket'
9
- require 'net/ping'
10
- require 'file/tail'
11
- require 'riemann/babbler/support/monkey_patches'
12
- require 'riemann/babbler/support/errors'
13
-
14
-
15
- # Базовое описание плагина
16
- module Riemann
17
- class Babbler
18
-
19
- def self.registered_plugins
20
- @plugins ||= []
21
- end
22
-
23
- def self.inherited( klass )
24
- registered_plugins << klass
25
- end
26
-
27
- attr_reader :hostname, :has_last_error, :logger, :riemann, :has_last_error
28
- alias :r :riemann
29
-
30
- def initialize( configatron, logger, riemann )
31
- @configatron = configatron
32
- @logger = logger
33
- @riemann = riemann
34
- @storage = Hash.new
35
- @hostname = get_hostname
36
- @has_last_error = false
37
- init
38
- plugin.set_default(:interval, configatron.riemann.interval)
39
- end
40
-
41
- # Доступ к конфигу определенного плагина
42
- def plugin
43
- plugin_name = self.class.name.split('::').last.gsub( /(\p{Lower})(\p{Upper})/, "\\1_\\2" ).downcase
44
- options.plugins.send plugin_name
45
- end
46
-
47
- def options
48
- @configatron
49
- end
50
- alias :opts :options
51
-
52
- def report(event)
53
- report_with_diff(event) and return if event[:as_diff]
54
- # если нет event[:state] то попробовать его добавить
55
- unless event[:state]
56
- event[:state] = state(event[:metric]) unless plugin.states.critical.nil?
57
- end
58
- event[:metric] = event[:metric].round(2) if event[:metric].kind_of? Float
59
- # set tags
60
- if event[:tags].nil?
61
- event[:tags] = options.riemann.tags unless options.riemann.tags.nil?
62
- end
63
- # set host
64
- event[:host] = hostname if event[:host].nil?
65
- logger.debug "Report status: #{event.inspect}"
66
- riemann << event
67
- end
68
-
69
- def report_with_diff(event)
70
- current_metric = event[:metric]
71
- old_metric = @storage[event[:service]]
72
- if old_metric && current_metric + old_metric < 2**64
73
- event[:metric] = current_metric - old_metric
74
- event.delete(:as_diff)
75
- report(event)
76
- end
77
- @storage[event[:service]] = current_metric
78
- end
79
-
80
- def get_hostname
81
- # разбор fqdn
82
- if options.riemann.use_fqdn.nil? || options.riemann.use_fqdn == false
83
- if File.exist? '/proc/sys/kernel/hostname'
84
- hostname = File.read('/proc/sys/kernel/hostname').strip.downcase
85
- else
86
- hostname = `hostname`
87
- end
88
- else
89
- hostname = Socket.gethostbyname(Socket.gethostname).first
90
- end
91
- # разбор инсталяции
92
- if options.riemann.installation.nil?
93
- hostname += options.riemann.suffix unless options.riemann.suffix.nil?
94
- else
95
- hostname += ( '.' + options.riemann.installation )
96
- end
97
- hostname = options.riemann.prefix + hostname unless options.riemann.prefix.nil?
98
- hostname
99
- end
100
-
101
- # не запускаем плагин есть
102
- def run_plugin
103
- if plugin.run.nil?
104
- true
105
- else
106
- plugin.run ? true : false
107
- end
108
- end
109
-
110
- # Переодически вызываемое действие
111
- def tick
112
- posted_array = collect
113
- posted_array = posted_array.class == Array ? posted_array : [ posted_array ]
114
- posted_array.uniq.each { |event| report event }
115
- end
116
-
117
- # Plugin init
118
- def init
119
- end
120
-
121
- def run
122
- # выйти если run_plugin не равен true
123
- # error - текущая ошибка, @has_last_error - предыдущая
124
- # две переменные для того что бы не удвоить сообщения об 'ОК'
125
- return 0 unless run_plugin
126
- error = false
127
- t0 = Time.now
128
- loop do
129
-
130
- begin
131
- Timeout::timeout( plugin.interval ) { tick }
132
- rescue TimeoutError
133
- report({:state => 'critical', :service => plugin.service + " plugin errors", :description => "Broken plugin: deadlock"})
134
- logger.error("Plugin #{self.class.name} timed out!")
135
- error = true
136
- rescue Riemann::Babbler::PluginHelperError
137
- logger.error("Plugin helper error!")
138
- error = true
139
- rescue => e
140
- report({:state => 'critical', :service => plugin.service + " plugin errors", :description => "Plugin exception: #{e.class}\n #{e.backtrace.join "\n"}"})
141
- logger.error("Plugin #{self.class.name} : #{e.class} #{e}\n#{e.backtrace.join "\n"}")
142
- error = true
143
- end
144
-
145
- if (!error && @has_last_error)
146
- report({:state => 'ok', :service => plugin.service + " plugin errors"})
147
- end
148
-
149
- @has_last_error = error
150
- sleep(plugin.interval - ((Time.now - t0) % plugin.interval))
151
- end
152
-
153
- end
154
-
155
- # хелпер, описание статуса
156
- def state(my_state)
157
- return 'critical' if my_state.nil?
158
- if plugin.states.warning.nil?
159
- my_state >= plugin.states.critical ? 'critical' : 'ok'
160
- elsif plugin.states.critical.nil?
161
- my_state >= plugin.states.warning ? 'warning' : 'ok'
162
- else
163
- case
164
- when my_state.between?(plugin.states.warning, plugin.states.critical)
165
- 'warning'
166
- when my_state > plugin.states.warning
167
- 'critical'
168
- else
169
- 'ok'
170
- end
171
- end
172
- end
173
-
174
- end
175
- end
1
+ require 'riemann/babbler/version'
2
+ require 'riemann/babbler/options'
3
+ require 'riemann/babbler/logging'
4
+ require 'riemann/babbler/errors'
5
+ require 'riemann/babbler/monkey_patches'
6
+ require 'riemann/babbler/sender'
7
+ require 'riemann/babbler/responder'
8
+ require 'riemann/babbler/plugin_loader'
@@ -1,29 +1,33 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/riemann/babbler/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'riemann/babbler/version'
3
5
 
4
- Gem::Specification.new do |s|
5
- s.name = 'riemann-babbler'
6
- s.version = Riemann::Babbler::VERSION
7
- s.authors = ['Vasiliev D.V.']
8
- s.email = %w(vadv.mkn@gmail.com)
9
- s.homepage = 'https://github.com/vadv/riemann-babbler'
10
- s.summary = %q{Plugin manager for riemann.}
11
- s.description = %q{Plugin manager for riemann.}
12
- s.licenses = %w(MIT)
13
-
14
- s.add_dependency('riemann-client')
15
- s.add_dependency('configatron')
16
- s.add_dependency('logger')
17
- s.add_dependency('trollop')
18
- s.add_dependency('sys-filesystem')
19
- s.add_dependency('rest-client')
20
- s.add_dependency('net-ping')
21
- s.add_dependency('file-tail')
22
- s.add_dependency('sys-proctable')
23
- s.add_dependency('net-http-server')
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'riemann-babbler'
8
+ spec.version = Riemann::Babbler::VERSION
9
+ spec.authors = ['Vasiliev Dmitry']
10
+ spec.email = ['vadv.mkn@gmail.com']
11
+ spec.description = %q{Monitoring tool for riemann}
12
+ spec.summary = %q{Monitoring tool for riemann server, aka plugin manager}
13
+ spec.homepage = 'https://github.com/vadv/riemann-babbler'
14
+ spec.license = 'MIT'
24
15
 
25
- s.files = `git ls-files`.split("\n")
26
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
27
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
28
- s.require_paths = %w(lib)
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = %w(lib)
20
+
21
+ spec.add_dependency 'riemann-client'
22
+ spec.add_dependency 'trollop'
23
+ spec.add_dependency 'rest-client'
24
+ spec.add_dependency 'sys-filesystem'
25
+ spec.add_dependency 'docile'
26
+ spec.add_dependency 'configatron'
27
+ spec.add_dependency 'net-http-server'
28
+
29
+
30
+ spec.add_development_dependency 'bundler', '~> 1.3'
31
+ spec.add_development_dependency 'rake'
32
+ spec.add_development_dependency 'pry'
29
33
  end