Skip to content

ksss/mruby-at_exit

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

mruby-at_exit

Add Kernel#at_exit method in mruby.

def do_at_exit(str1)
  at_exit { print str1 }
end
at_exit { puts "cruel world" }
do_at_exit("goodbye ")
exit
#=> goodbye cruel world

Installation

On your build_config.rb

MRuby::Build.new do |conf|
  # by mgem
  conf.gem :mgem => 'mruby-at_exit'
  # by github
  conf.gem :github => 'ksss/mruby-at_exit'
end

Doc

http://docs.ruby-lang.org/en/2.3.0/Kernel.html#method-i-at_exit

Why doesn't implement to mruby-core?

mruby/mruby#2363

About

Kernel.at_exit method on mruby

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published