module Rollbar::Rake

Attributes

patched[RW]

Public Class Methods

patch!() click to toggle source
# File lib/rollbar/plugins/rake.rb, line 26
def self.patch!
  unless patch?
    skip_patch

    return
  end

  ::Rake.application.instance_eval do
    class << self
      include ::Rollbar::Rake::Handler
    end
  end

  self.patched = true
end
patch?() click to toggle source
# File lib/rollbar/plugins/rake.rb, line 47
def self.patch?
  return false if patched?
  return false unless rake_version

  major, minor, = rake_version.split('.').map(&:to_i)

  major > 0 || major == 0 && minor > 8
end
patched?() click to toggle source
# File lib/rollbar/plugins/rake.rb, line 56
def self.patched?
  patched
end
rake_version() click to toggle source
# File lib/rollbar/plugins/rake.rb, line 60
def self.rake_version
  if Object.const_defined?('RAKEVERSION')
    RAKEVERSION
  elsif ::Rake.const_defined?('VERSION')
    ::Rake::VERSION
  end
end
skip_patch() click to toggle source
# File lib/rollbar/plugins/rake.rb, line 42
def self.skip_patch
  warn('[Rollbar] Rollbar is disabled for Rake tasks since your Rake ' \
    'version is under 0.9.x. Please upgrade to 0.9.x or higher.')
end