Skip to content

Commit

Permalink
[capistrano] add 3.5.0 compatibility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
degemer committed Aug 23, 2016
1 parent ec8cd90 commit 3c8d759
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/capistrano/datadog/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c8d759

Please sign in to comment.