35 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 1bba8cf53b mruby-dir: remove files needed for an independent gem 2023-01-10 10:53:15 +09:00
dearblue 72ab1821de Avoid IOError when returning from Dir.open
Ignore `IOError` if `Dir#close` was done in the block.
2023-01-01 17:40:50 +09:00
Yukihiro "Matz" Matsumoto bb3f403511 Merge pull request #5876 from dearblue/dir-foreach
Close the directory object with the `Dir.foreach` method
2022-12-26 13:27:53 +09:00
Yukihiro "Matz" Matsumoto 3518d15d04 Merge pull request #5875 from dearblue/dir-cstr
Get argument of the `Dir` method takes a C string directly
2022-12-26 13:26:56 +09:00
Yukihiro "Matz" Matsumoto 2656a92380 Merge pull request #5874 from dearblue/dir-funcs
Hide substance functions of methods in `mruby-dir`
2022-12-26 12:58:44 +09:00
dearblue 50b24c124f Close the directory object with the Dir.foreach method 2022-12-25 21:25:30 +09:00
dearblue 1fb19ca046 Get argument of the Dir method takes a C string directly 2022-12-25 21:25:30 +09:00
dearblue 71df263bdf Hide substance functions of methods in mruby-dir 2022-12-25 21:25:30 +09:00
dearblue 35490c2c32 Define also the exception class IOError in mruby-dir
Since `IOError` is a standard exception class in Ruby, there is no need to assume different superclasses.
The Ruby specification allows repeated class definitions as long as the superclass is the same.

This also avoids using the `mruby/ext/io.h` file to reference `E_IO_ERROR`.
2022-12-25 21:25:21 +09:00
dearblue fec74cd040 Avoid uses mruby/src/error.h file 2022-12-25 17:31:53 +09:00
Yukihiro "Matz" Matsumoto 7821462571 mruby-dir/dirtest.c: need to include <io.h> for mktemp() on Windows 2022-12-22 22:07:07 +09:00
Yukihiro "Matz" Matsumoto 67addd7da3 mruby-dir/dirtest.c: avoid string allocations for mrb_raisef 2022-12-22 11:36:03 +09:00
Yukihiro "Matz" Matsumoto 1d174404b3 mruby-dir/dirtest.c: refactor mkdir in mrb_dirtest_setup 2022-12-22 11:33:44 +09:00
Yukihiro "Matz" Matsumoto d51d5825ad mruby-dir/dir.c: update compatibility macros for Windows 2022-12-22 11:13:50 +09:00
Yukihiro "Matz" Matsumoto 084871abf3 mruby-dir/dirtest.c: use _mktemp instead of mktemp for Windows 2022-12-22 11:12:32 +09:00
Yukihiro "Matz" Matsumoto c737519d02 mruby-dir/dirtest.c: add compatibility macro for getcwd 2022-12-22 11:11:49 +09:00
Yukihiro "Matz" Matsumoto 4cbcf743a7 mruby-dir/dirtest.c: wrap function prototypes by extern "C" 2022-12-22 11:11:18 +09:00
Yukihiro "Matz" Matsumoto 783e62e582 mruby-dir/dirtest.c: copy some of dirent header information
Instead of including whole "dirent.c" file.
2022-12-22 09:53:16 +09:00
Yukihiro "Matz" Matsumoto 965d1d1554 mruby-dir/dirtest.c: should not include <unistd.h> 2022-12-22 09:27:13 +09:00
Yukihiro "Matz" Matsumoto 0aa8ce5c57 mruby-dir/dirtest.c: did not work for Windows 2022-12-22 09:10:40 +09:00
Yukihiro "Matz" Matsumoto cfb2d3e888 mruby-dir: include Enumerable module 2022-12-22 00:03:28 +09:00
Yukihiro "Matz" Matsumoto ca3b694efe mruby-dir/dir.rb: make each_child as an alias to each 2022-12-22 00:02:33 +09:00
Yukihiro "Matz" Matsumoto 3d6a4c39bf mruby-dir: reformat 2022-12-21 15:18:09 +09:00
Yukihiro "Matz" Matsumoto d656ea87c6 mruby-dir: add compatibility macro 2022-12-21 15:15:10 +09:00
Yukihiro "Matz" Matsumoto b93a624b5f mruby-dir/dir.c: add new method Dir.empty?(path) 2022-12-21 15:11:37 +09:00
Yukihiro "Matz" Matsumoto e4b80cc282 mruby-dir/dir.rb: add new method children as an alias to entries 2022-12-21 14:48:22 +09:00
Yukihiro "Matz" Matsumoto 818212b5db mruby-dir/dir.rb: rename each to each_child 2022-12-21 14:44:24 +09:00
Yukihiro "Matz" Matsumoto afcdf5e803 mruby-dir/dir.rb: simplify loop delegation 2022-12-21 14:42:50 +09:00
Yukihiro "Matz" Matsumoto d3e997f4f9 mruby-dir: remove run_test.rb that is no longer used 2022-12-20 22:13:34 +09:00
Yukihiro "Matz" Matsumoto 4b48c86103 mruby-dir: extra spaces and typos are removed 2022-12-20 22:12:21 +09:00
Yukihiro "Matz" Matsumoto f486069a94 mruby-dir/test: reformat 2022-12-20 21:56:52 +09:00
Yukihiro "Matz" Matsumoto 869a2778a9 mruby-dir/test: remove warnings from lacked assertions 2022-12-20 20:24:28 +09:00
Yukihiro "Matz" Matsumoto fbf04c6ec3 mruby-dir/dir.rb: removed work around for old mruby bug 2022-12-20 20:13:04 +09:00
Yukihiro "Matz" Matsumoto e6a2f0b98e mruby-dir/dir.rb: reformat according to coding standard 2022-12-20 19:51:18 +09:00
Yukihiro "Matz" Matsumoto 277341f694 Add 'mrbgems/mruby-dir/' from commit '89dceefa1250fb1ae868d4cb52498e9e24293cd1'
git-subtree-dir: mrbgems/mruby-dir
git-subtree-mainline: f2d43069f0
git-subtree-split: 89dceefa12
2022-12-20 18:06:36 +09:00