File: core_ext.rb

package info (click to toggle)
ruby-rbtrace 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 756 kB
  • sloc: ruby: 1,128; ansic: 925; sh: 42; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
module FFI::LastError
  Errnos = Errno::constants.map(&Errno.method(:const_get)).inject({}) do |hash, c|
    hash[ c.const_get(:Errno) ] = c
    hash
  end

  def self.exception
    Errnos[error]
  end
  def self.raise(msg=nil)
    Kernel.raise exception, msg
  end
end