Sha256: 32e8fa0173ad64df3b755d3e7dddc76d4378ff4113b06bb0483fbadf5c815b56

Contents?: true

Size: 811 Bytes

Versions: 30

Compression:

Stored size: 811 Bytes

Contents

module Rollbar
  module LanguageSupport
    extend self

    def const_defined?(mod, target, inherit = true)
      if ruby_18?
        mod.const_defined?(target)
      else
        mod.const_defined?(target, inherit)
      end
    end

    def const_get(mod, target, inherit = true)
      if ruby_18?
        mod.const_get(target)
      else
        mod.const_get(target, inherit)
      end
    end

    def can_scrub_url?
      !version?('1.8')
    end

    def ruby_18?
      version?('1.8')
    end

    def ruby_19?
      version?('1.9')
    end

    def version?(version)
      numbers = version.split('.')

      numbers == ::RUBY_VERSION.split('.')[0, numbers.size]
    end

    def timeout_exceptions
      return [] if ruby_18? || ruby_19?

      [Net::ReadTimeout, Net::OpenTimeout]
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rollbar-2.19.2 lib/rollbar/language_support.rb
rollbar-2.19.1 lib/rollbar/language_support.rb
rollbar-2.19.0 lib/rollbar/language_support.rb
rollbar-2.18.2 lib/rollbar/language_support.rb
rollbar-2.18.0 lib/rollbar/language_support.rb
rollbar-2.17.0 lib/rollbar/language_support.rb
rollbar-2.16.4 lib/rollbar/language_support.rb
rollbar-2.16.3 lib/rollbar/language_support.rb
rollbar-2.16.2 lib/rollbar/language_support.rb
rollbar-2.16.0 lib/rollbar/language_support.rb
rollbar-2.15.6 lib/rollbar/language_support.rb
rollbar-2.15.5 lib/rollbar/language_support.rb
rollbar-2.15.4 lib/rollbar/language_support.rb
rollbar-2.15.3 lib/rollbar/language_support.rb
rollbar-2.15.2 lib/rollbar/language_support.rb
rollbar-2.15.1 lib/rollbar/language_support.rb
rollbar-2.15.0 lib/rollbar/language_support.rb
rollbar-2.14.1 lib/rollbar/language_support.rb
rollbar-2.14.0 lib/rollbar/language_support.rb
rollbar-2.13.3 lib/rollbar/language_support.rb