From 3c8d7597a0a38e3cd8bd65e13fa8677391fcc7b9 Mon Sep 17 00:00:00 2001 From: Quentin Madec Date: Fri, 20 May 2016 15:16:58 -0400 Subject: [PATCH] [capistrano] add 3.5.0 compatibility Capistrano 3.5.0 upgraded its `sshkit` library to `1.9.0` (from `1.3`). Since we we're relying on a monkey patch of it, it broke the integration. This is the minimal set of change to fix this issue. --- lib/capistrano/datadog/v3.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/datadog/v3.rb b/lib/capistrano/datadog/v3.rb index 7029d37b..dafc369f 100644 --- a/lib/capistrano/datadog/v3.rb +++ b/lib/capistrano/datadog/v3.rb @@ -30,7 +30,12 @@ def initialize(wrapped) end def write(*args) - @wrapped.write(*args) + # Check if Capistrano version >= 3.5.0 + if Gem::Version.new(VERSION) >= Gem::Version.new('3.5.0') + @wrapped << args + else + @wrapped.write(*args) + end args.each { |arg| Capistrano::Datadog.reporter.record_log(arg) } end alias :<< :write