summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io
AgeCommit message (Collapse)Author
2019-12-14Avoid method in methoddearblue
And rename `File.concat_path` to `File._concat_path`.
2019-12-14Remove unnessesary branchesdearblue
2019-12-14Fix mruby-io test for mingw32dearblue
Need `mkstemp()` implements.
2019-12-12Add `mrb_num_args_error()` for "wrong number of arguments" errorKOBAYASHI Shuji
To unify the style of messages.
2019-12-09Add "mruby developers" into some gems; Resolve #4709dearblue
It is writing side by side with the original authors.
2019-11-24Remove unused methods of `MRubyIOTestUtil`KOBAYASHI Shuji
2019-11-09Fix argument specs to `IO`KOBAYASHI Shuji
2019-11-01Fix argument specs to `File`KOBAYASHI Shuji
2019-10-23Remove unnecessary `mrb_funcall()`.Yukihiro "Matz" Matsumoto
2019-10-23Remove unnecessary `mrb_string_p()` check.Yukihiro "Matz" Matsumoto
2019-10-21Remove `Kernel#getc`KOBAYASHI Shuji
`Kernel#getc` has been removed since Ruby 1.9 and is not defined in ISO.
2019-10-18Move methods of `Kernel` to `kernel.rb` from `io.rb` in `mruby-io` gemKOBAYASHI Shuji
2019-10-17Make `IO#each` family without block to return `Enumerator`KOBAYASHI Shuji
2019-10-11Remove unused exception classes in `mruby-io` gemKOBAYASHI Shuji
2019-10-10Silence double free warnings by `mrb_local_free()`.Yukihiro "Matz" Matsumoto
The warnings were detected by cppcheck.
2019-09-26Use type predicate macros instead of `mrb_type` if possibleKOBAYASHI Shuji
For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for all `enum mrb_vtype`).
2019-09-16Add small fix over #4712Yukihiro "Matz" Matsumoto
2019-09-16Fix broken UTF-8 characters by `IO#getc`dearblue
Character (multi-byte UTF-8) is destroyed when character spanning `IO::BUF_SIZE` (4096 bytes) exist. - Prepare file: ```ruby File.open("sample", "wb") { |f| f << "●" * 1370 } ``` - Before patched: ```ruby File.open("sample") { |f| a = []; while ch = f.getc; a << ch; end; p a } # => ["●", "●", ..., "●", "\xe2", "\x97", "\x8f", "●", "●", "●", "●"] - After patched: ```ruby File.open("sample") { |f| a = []; while ch = f.getc; a << ch; end; p a } # => ["●", "●", ..., "●", "●", "●", "●", "●", "●"]
2019-09-16Small improvement for mruby-iodearblue
2019-09-16Fix `IO#pos`dearblue
2019-09-16Revert part of 8c90b5fc6dearblue
`IO#readline` and `IO#readchar` process in character units.
2019-09-14Replace `String#byteslice` by custom `IO._bufread`.Yukihiro "Matz" Matsumoto
`byteslice` creates 2 string objects. `_bufread` creates one, and modifies the original buffer string, that is more efficient.
2019-09-13Remove unnecessary files from `mruby-{io,pack,socket}`.Yukihiro "Matz" Matsumoto
2019-09-12Remove `$/` from mruby implementation.Yukihiro "Matz" Matsumoto
1. `$/` and other Perl-ish global variables are not defined in ISO. 2. The current Ruby policy do not encourage those variables. 3. Those variables has global effect and can cause troubles.
2019-09-11Fixed `length` for IO should be in bytes, not in characters; #4696Yukihiro "Matz" Matsumoto
E.g. `io.read(5)` should read 5 byte string, not 5 characters.
2019-08-24Create a symbolic link in the temporary directory; fix #4642dearblue
Because the linker gives a warning on FreeBSD 12.0. ``` warning: mktemp() possibly used unsafely; consider using mkstemp() ```
2019-08-20Remove deprecated iij stuffsTakeshi Watanabe
2019-08-18Make symbolic link names unique for testdearblue
2019-08-07Reorganize `mrb_string_value_cstr` and related functions.Yukihiro "Matz" Matsumoto
`mrb_string_value_cstr` and `mrb_string_value_len`: obsolete `mrb_string_cstr`: new function to retrieve NULL terminated C string `RSTRING_CSTR`: wrapper macro of `mrb_string_cstr`
2019-08-07`RUBY_PLATFORM` may not contain `mswin` or `mingw`; Add `msys`Yukihiro "Matz" Matsumoto
2019-08-06Removed an unused local variable; ref #4615Yukihiro "Matz" Matsumoto
2019-08-05Use new specifiers/modifiers of `mrb_vfromat()`KOBAYASHI Shuji
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
2019-07-30Refine message to `skip` in nested `assert`KOBAYASHI Shuji
- I think "Info" is used only to `skip`, so change to "Skip". - Changed the default value of `assert` and specify the argument explicitly at the caller of `assert` because it is unnatural "Assertion failed" is output even though the assertion doesn't fail. == Example: def assert_foo(exp, act) assert do assert_equal exp[0], act[0] assert_equal exp[1], act[1] end end def assert_bar(exp, act) assert do skip end end def assert_baz(exp, act) assert do assert_equal exp, act assert_bar exp, act end end assert 'test#skip_in_nested_assert' do assert_baz 1, 1 end === Before this patch: ?.. Info: test#skip_in_nested_assert (core) - Assertion[1] Info: Assertion failed (core) - Assertion[1-2] Skip: Assertion failed (core) Total: 3 OK: 2 KO: 0 Crash: 0 Warning: 0 Skip: 1 === After this patch: ??? Skip: test#skip_in_nested_assert (core) - Assertion[1] Skip: assert (core) - Assertion[1-2] Skip: assert (core) Total: 3 OK: 0 KO: 0 Crash: 0 Warning: 0 Skip: 3
2019-06-29Use nested `assert`dearblue
2019-06-29Use a normal method instead of a lambdadearblue
Ref commit 35319bed01d58c785f73ce03e67d4e58be30f4b5
2019-06-07Replace obsolete macrosdearblue
2019-05-15Fix typo in `mrbgems/mruby-io/src/file_test.c` [ci skip]KOBAYASHI Shuji
2019-05-10Move `mrb_gc_arena_restore` to inside the loop in `mrb_file_s_chmod`KOBAYASHI Shuji
2019-05-10Raise `TypeError` if the argument type is unsupported in `mrb_stat0`KOBAYASHI Shuji
2019-05-07Refactor `mrb_str_to_cstr` and `mrb_string_value_cstr`KOBAYASHI Shuji
- Extract null byte check to function. - Avoid string allocation if null byte is included. - Use `str_new` instead of `mrb_str_dup` + `mrb_str_modify`
2019-05-06Avoid using `mrb_str_to_cstr` if possibleKOBAYASHI Shuji
Because it always allocate new string. Replace with the followings: - Use `RSRING_PTR` if string is guaranteed to be null-terminated. - Use `mrb_string_value_cstr` or `mrb_get_args("z")` if return value isn't modified.
2019-04-29Fix missing assertions in `mruby-io` testKOBAYASHI Shuji
2019-04-27Remove duplicated `String#each_char`KOBAYASHI Shuji
2019-04-15Fix test, popen and cmd in mruby-ioShouji Kuboyama
2019-02-26Remove unneeded `const_defined?(:Time)` in `mruby-io` testKOBAYASHI Shuji
`mruby-time` is included in test dependencies.
2019-01-28Use assertion methods in `FileTest` testsKOBAYASHI Shuji
2019-01-27Remove no meaning statements in `mruby-io` testsKOBAYASHI Shuji
2019-01-25Merge pull request #4245 from shuujii/remove-assert_nothing_raised-in-io-testYukihiro "Matz" Matsumoto
Remove definition of `assert_nothing_raised` in `IO` test
2019-01-25Merge pull request #4246 from shuujii/use-assertion-methods-in-file-testYukihiro "Matz" Matsumoto
Use assertion methods in `File` test
2019-01-25Remove unused file for `mruby-io` testKOBAYASHI Shuji