Sha256: 236857657d440d6c0c97bb70621c77cff35bfb83587dedc7ae45b3ececcb1788

Contents?: true

Size: 572 Bytes

Versions: 7

Compression:

Stored size: 572 Bytes

Contents

require "rollbar/js/version"

module Rollbar
  module Js
    extend self

    attr_reader :framework
    attr_reader :framework_loader

    def prepare
      @framework ||= detect_framework
      @framework_loader ||= load_framework_class.new

      @framework_loader.prepare
    end

    private

    def detect_framework
      case
      when defined?(::Rails::VERSION)
        :rails
      end
    end

    def load_framework_class
      require "rollbar/js/frameworks/#{framework}"

      Rollbar::Js::Frameworks.const_get(framework.to_s.capitalize)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rollbar-2.10.0 lib/rollbar/js.rb
rollbar-2.9.1 lib/rollbar/js.rb
rollbar-2.9.0 lib/rollbar/js.rb
rollbar-2.8.3 lib/rollbar/js.rb
rollbar-2.8.2 lib/rollbar/js.rb
rollbar-2.8.1 lib/rollbar/js.rb
rollbar-2.8.0 lib/rollbar/js.rb