C Ruby
Switch branches/tags
Nothing to show
Clone or download
ksss Merge pull request #5 from katzer/master
Basic support for Win32
Latest commit c3ea100 Jun 26, 2018
Permalink
Failed to load latest commit information.
docker
mrblib
src
test
.travis-spec-build_config.rb
.travis-test-build_config.rb
.travis.yml
LICENSE.txt
README.md
mrbgem.rake

README.md

mruby-signal

Build Status

Signal trap and callback in mruby.

Synopsis

Signal.trap(:INT) { |signo|
  p "hello signal #{Signal.signame(signo)}" #=> "hello signal INT"
}

Methods

  • Signal.trap(sig, command){|signo| block }
  • Signal.list
  • Signal.signame(signo)
  • Kernel.trap(sig, command){|signo| block }

Installation

Write in /mruby/build_config.rb

MRuby::Build.new do |conf|
  # from mgem
  conf.gem :mgem => 'mruby-signal'

  # or from github
  conf.gem :github => 'ksss/mruby-signal', :branch => 'master'
end

License

MIT

Based on

https://github.com/ruby/ruby/blob/trunk/signal.c

Passed the ruby/spec

mruby-signal passed the below specs in ruby/spec

See also

http://ruby-doc.org/core-2.3.1/Signal.html