Class: Capistrano::Datadog::CaptureIO

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/capistrano/datadog/v3.rb

Instance Method Summary collapse

Constructor Details

#initialize(wrapped) ⇒ CaptureIO

Returns a new instance of CaptureIO.



46
47
48
49
# File 'lib/capistrano/datadog/v3.rb', line 46

def initialize(wrapped)
  super
  @wrapped = wrapped
end

Instance Method Details

#write(*args) ⇒ Object Also known as: <<



51
52
53
54
55
56
57
58
59
# File 'lib/capistrano/datadog/v3.rb', line 51

def write(*args)
  # Check if Capistrano version >= 3.5.0
  if Gem::Version.new(VERSION) >= Gem::Version.new('3.5.0')
    @wrapped << args.join
  else
    @wrapped.write(*args)
  end
  args.each { |arg| Capistrano::Datadog.reporter.record_log(arg) }
end