forked from mruby/mruby
-
Notifications
You must be signed in to change notification settings - Fork 4
akiray03 edited this page Mar 6, 2013
·
25 revisions
- iij/mrubyの実装は MRB_TT_FILE で作っているが、 MRB_TT_DATA に置き換える
- MRB_TT_DATA に置き換えて、 IO#newしたオブジェクトがGCに回収されて動くところまでは試作した https://github.com/iij/mruby-io
- IO, File のメソッドのうち、rubyで記述できるものはできるだけrubyで記述する
- 既存のIO, Fileのコードはなるべく持って行かない :p
- 細々とした(似た名前の) Cのユーティリティ関数は減らしたい
- libc依存 (FILE構造体を持つ) の解消までは目指さない (MRB_TT_DATA で、 FILE構造体を持ち続ける)
- テスト書く
- FileTest作るか
- MRB_TT_DATAに変えて、IO#newしたオブジェクトがGCに回収されて動くところまで作る
- テスト書く
- IOのメソッドを1個ずつ移植する。Rubyで書ける部分はRubyで書く。テストも書く。
- テストは正常系と異常系のテストをセットにして書く。
- mrbtestで書きにくいテストは、crubyのminitestなり使ってテストする
- 本家mrubyでIO, Fileが使えるところがゴール
-
*
が付いているメソッドから実装していく
* IO#new
* IO#close
* IO#closed?
IO.__popen__ : IO.popen のブロック非対応版
IO.select :あとまわし?
* IO#read
* IO#write
* IO#sync
* IO#sync=
IO#flush
File.umask
* File.unlink, delete
File.rename
* File.exist?, exists?
* File.dirname : rubyで書ける?
File.basename : rubyで書ける?
File.realpath
File.size
File._getwd : File.expand_path用のutil
File._gethome : File.expand_path用のutil
File#flock
* IO.open
IO.popen
* IO#gets
* IO#puts
* IO#print
* IO#each, #each_line
* File.open
File.expand_path
File#path
method | iij/mruby | mruby-io | memo |
---|---|---|---|
IO.binread | |||
IO.binwrite | |||
IO.copy_stream | |||
IO.new, IO.for_fd, IO.open | IO.new, IO.open | o | |
IO.foreach | |||
IO.pipe | |||
IO.popen | o | o | |
IO.read | |||
IO.readlines | |||
IO.select | o | ||
IO.sysopen | o | o | |
IO.try_convert | |||
IO.write | |||
IO#<< | |||
IO#advise | |||
IO#autoclose= | |||
IO#autoclose? | |||
IO#binmode | |||
IO#binmode? | |||
IO#bytes | obsolete | ||
IO#chars | obsolete | ||
IO#clone, IO#dup | |||
IO#close | o | o | |
IO#close_on_exec= | |||
IO#close_on_exec? | |||
IO#close_read | |||
IO#close_write | |||
IO#closed? | o | o | |
IO#codepoints | obsolete | ||
IO#each_byte | o | o | |
IO#each_char | o | ||
IO#each_codepoint | |||
IO#each_line | o | o | |
IO#eof, IO#eof? | o | ||
IO#external_encoding | |||
IO#fcntl | |||
IO#fdatasync | |||
IO#fileno, IO#to_i | |||
IO#flush | o | ||
IO#fsync | |||
IO#getbyte | |||
IO#getc | o | o | |
IO#gets | o | o | |
IO#internal_encoding | |||
IO#ioctl | |||
IO#isatty, IO#tty? | |||
IO#lineno | |||
IO#lineno= | |||
IO#lines | obsolete | ||
IO#pid | o | ||
IO#pos, IO#tell | o | ||
IO#pos= | o | ||
IO#print | o | o | |
IO#printf | o | o | |
IO#putc | |||
IO#puts | o | o | |
IO#read | o | o | |
IO#read_nonblock | |||
IO#readbyte | |||
IO#readchar | o | ||
IO#readline | o | ||
IO#readlines | o | ||
IO#readpartial | |||
IO#reopen | |||
IO#rewind | |||
IO#seek | o | ||
IO#set_encoding | |||
IO#stat | |||
IO#sync | o | ||
IO#sync= | o | ||
IO#sysread | o | ||
IO#sysseek | o | ||
IO#syswrite | o | ||
IO#to_io | o | ||
IO#ungetbyte | |||
IO#ungetc | o | ||
IO#write | o | o | |
IO#write_nonblock |
method | iij/mruby | mruby-io | memo |
---|---|---|---|
File.absolute_path | |||
File.atime | |||
File.basename | o | o | |
File.blockdev? | FileTest | ||
File.chardev? | FileTest | ||
File.chmod | |||
File.chown | |||
File.ctime | |||
File.delete, File.unlink | o | o | |
File.directory? | o | FileTest | |
File.dirname | o | o | |
File.executable? | FileTest | ||
File.executable_real? | FileTest | ||
File.exist?, exists? | o | o | FileTest |
File.expand_path | o | ||
File.extname | o | ||
File.file? | o | FileTest | |
File.fnmatch, File.fnmatch? | |||
File.ftype | |||
File.grpowned? | FileTest | ||
File.identical? | FileTest | ||
File.join | o | o | |
File.lchmod | |||
File.lchown | |||
File.link | |||
File.lstat | |||
File.mtime | |||
File.new, File.open | o | o | |
File.owned? | FileTest | ||
File.path | |||
File.pipe? | o | FileTest | |
File.readable? | FileTest | ||
File.readable_real? | FileTest | ||
File.readlink | |||
File.realdirpath | |||
File.realpath | o | o | |
File.rename | o | o | |
File.setgid? | FileTest | ||
File.setuid? | FileTest | ||
File.size | o | o | |
File.size? | o | FileTest | |
File.socket? | o | FileTest | |
File.split | |||
File.stat | |||
File.sticky? | FileTest | ||
File.symlink | |||
File.symlink? | o | FileTest | |
File.truncate | |||
File.umask | o | o | |
File.utime | |||
File.world_readable? | |||
File.world_writable? | |||
File.writable? | FileTest | ||
File.writable_real? | FileTest | ||
File.zero? | o | FileTest | |
File#atime | |||
File#chmod | |||
File#chown | |||
File#ctime | |||
File#flock | |||
File#lstat | |||
File#mtime | |||
File#path, File#to_path | File#path | o | |
File#size | o | ||
File#truncate |