lib/capistrano/notifier/statsd.rb in capistrano-notifier-0.1.2 vs lib/capistrano/notifier/statsd.rb in capistrano-notifier-0.2.0

- old
+ new

@@ -8,21 +8,21 @@ configuration.load do namespace :deploy do namespace :notify do desc 'Notify StatsD of deploy.' task :statsd do - Capistrano::Notifier::StatsD.new(configuration).perform + run Capistrano::Notifier::StatsD.new(configuration).command end end end after 'deploy:restart', 'deploy:notify:statsd' end end - def perform - socket.send packet, 0, host, port + def command + "echo #{packet.gsub('|', '\\|')} | nc -w 1 -u #{host} #{port}" end private def host @@ -45,13 +45,9 @@ end end def port options[:port] - end - - def socket - @socket ||= UDPSocket.new end def with case options[:with] when :counter then "1|c"