Sha256: a79d9a5b0177f06d04531dfcae658e95a892b61b18041234c44d8d70ca545b29

Contents?: true

Size: 510 Bytes

Versions: 2

Compression:

Stored size: 510 Bytes

Contents

module BetterErrors
  module REPL
    PROVIDERS = [
        { impl:   "better_errors/repl/basic",
          const:  :Basic },
      ]

    def self.provider
      @provider ||= const_get detect[:const]
    end
    
    def self.provider=(prov)
      @provider = prov
    end
    
    def self.detect
      PROVIDERS.find do |prov|
        test_provider prov
      end
    end
    
    def self.test_provider(provider)
      require provider[:impl]
      true
    rescue LoadError
      false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
better_errors-0.2.0 lib/better_errors/repl.rb
better_errors-0.1.1 lib/better_errors/repl.rb