Sha256: a1a5dd45e5feaa3f0f46fb91dab4d4f17c4cb56b6056abbf7ab8c070c5acc7fc

Contents?: true

Size: 471 Bytes

Versions: 28

Compression:

Stored size: 471 Bytes

Contents

module Kernel

  def exceptions_wrapping(error_class)
    m = Module.new
    (class << m; self; end).instance_eval do
      define_method(:===) do |err|
        err.respond_to?(:original_exception) && error_class === err.original_exception
      end
    end
    m
  end

  def exceptions_matching(matcher)
    m = Module.new
    (class << m; self; end).instance_eval do
      define_method(:===) do |err|
        err.message =~ matcher
      end
    end
    m
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
houston-core-0.9.2 lib/core_ext/kernel.rb
houston-core-0.9.1 lib/core_ext/kernel.rb
houston-core-0.9.0 lib/core_ext/kernel.rb
houston-core-0.9.0.rc1 lib/core_ext/kernel.rb
houston-core-0.8.4 lib/core_ext/kernel.rb
houston-core-0.8.3 lib/core_ext/kernel.rb
houston-core-0.8.2 lib/core_ext/kernel.rb
houston-core-0.8.1 lib/core_ext/kernel.rb
houston-core-0.8.0 lib/core_ext/kernel.rb
houston-core-0.8.0.pre2 lib/core_ext/kernel.rb
houston-core-0.8.0.pre lib/core_ext/kernel.rb
houston-core-0.7.0 lib/core_ext/kernel.rb
houston-core-0.7.0.beta4 lib/core_ext/kernel.rb
houston-core-0.7.0.beta3 lib/core_ext/kernel.rb
houston-core-0.7.0.beta2 lib/core_ext/kernel.rb
houston-core-0.7.0.beta lib/core_ext/kernel.rb
houston-core-0.6.3 lib/core_ext/kernel.rb
houston-core-0.6.2 lib/core_ext/kernel.rb
houston-core-0.6.1 lib/core_ext/kernel.rb
houston-core-0.6.0 lib/core_ext/kernel.rb