Граф коммитов

1872 Коммитов

Автор SHA1 Сообщение Дата
Samuel Williams d416205341
Copy `IO#timeout` on `IO#dup`. (#6546) 2022-10-15 01:45:51 +13:00
Samuel Williams 1bafa4a59b
Ignore failure to set nonblock mode. (#6524) 2022-10-11 10:18:20 +13:00
Samuel Williams 844a9dff88
Try `nil` as default for 'default timeout'. (#6509) 2022-10-08 14:02:34 +13:00
Samuel Williams e4f91bbdba
Add IO#timeout attribute and use it for blocking IO operations. (#5653) 2022-10-07 21:48:38 +13:00
Burdette Lamar bbbdb574c5
[DOC] Integrate io_streams.rdoc into io.c (#6491)
Integrate io_streams.rdoc into io.c
2022-10-06 09:30:12 -05:00
Burdette Lamar ded895baa9
[DOC] RDoc changes for IO (#6458)
Moves Expect library doc into io.c.
    Changes certain links to local sections, now pointing to sections in doc/io_streams.rdoc.
    Removes local sections now superseded by sections in doc/io_streams.rdoc.
2022-10-02 08:24:08 -05:00
Peter Zhu 64200990c4 [ci skip] Fix typos in documentation in io.c 2022-09-16 09:47:32 -04:00
Jeremy Bopp 684353fc03
[Win32] Negative length `IO#sysread`
Raise `ArgumentError` in `IO#sysread` on Windows when given a negative
length.

Fixes [Bug #18880]
2022-09-11 23:08:14 +09:00
Nobuyoshi Nakada e2ccb316b4 [Bug #5317] Use `rb_off_t` instead of `off_t`
Get rid of the conflict with system-provided small `off_t`.
2022-09-08 23:01:07 +09:00
Jeremy Evans 21cac42385 Raise ArgumentError for IO.foreach with limit of 0
Makes behavior consistent with IO.readlines.

Fixes [Bug #18767]
2022-08-25 13:36:17 -07:00
Alan Wu ca8daf70fa [DOC] Mention Windows text mode EOF marker interpretation
I don't think this is super well known so it's worth mentioning as it
can be a pitfall.

See: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-08-05 14:34:08 -04:00
Alan Wu f1057393da [DOC] Clarify that `IO.read` uses text mode
See: https://bugs.ruby-lang.org/issues/18882#note-13

[Bug #18882]
2022-08-05 14:34:08 -04:00
Nobuyoshi Nakada 431fdc9200
[DOC] Cross references for `ARGF` 2022-07-28 09:02:23 +09:00
Jeremy Evans 4ad69899b7 Fix documentation for ARGF.inplace_mode{,=}
The value affects the name of the backup file created, not the
name of the file modified (as the file is modified in place).

Fixes [Bug #18920]
2022-07-27 15:29:00 -07:00
Nobuyoshi Nakada f42230ff22
Adjust styles [ci skip] 2022-07-27 18:42:27 +09:00
Kaíque Kandy Koga 1cd487d785 [DOC] IO#eof
Use IO#eof? instead of I#eof?
2022-07-23 16:57:09 -07:00
Jeremy Evans 7223c0da15 Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.

Partially Fixes [Bug #18770]
2022-07-21 12:55:24 -07:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Jeremy Evans 203f179ce7 Revert "Do not chomp trailing line separator IO#each with nil separator and chomp"
This reverts commit 04f86ad0b5.

This is causing CI issues, reverting for now.
2022-07-21 08:29:50 -07:00
Jeremy Evans 04f86ad0b5 Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.

Partially Fixes [Bug #18770]
2022-07-21 08:13:40 -07:00
Peter Zhu 280b805d04 [DOC] Fix documentation for ARGF#readlines
[Bug #18909]
2022-07-15 10:30:50 -04:00
Peter Zhu c8748942f1 [DOC] Fix typo in documentation for IO#readlines 2022-07-14 16:37:47 -04:00
Nobuyoshi Nakada cd94842922 [Bug #18892] Reset `ARGF.lineno` after reading shebang 2022-07-07 11:33:07 +09:00
Nobuyoshi Nakada 5ef3c7ea2d
[Bug #18898] Fallback invalid external encoding to the default 2022-07-06 18:08:31 +09:00
Samuel Williams d2166c09b0 Copy `IO#wait*` methods from `io-wait` gem to `io.c`. 2022-06-25 21:17:13 +12:00
Nobuyoshi Nakada a58611dfb1 Allow to just warn as bool expected, without an exception 2022-06-20 19:35:12 +09:00
S-H-GAMELINKS 420f3ced4d Using is_ascii_string to check encoding 2022-06-17 12:02:50 +09:00
Samuel Williams 425a46131a Handle case where write result is zero. 2022-06-13 16:12:18 +12:00
Jeremy Evans 27eb36596a Stop ignoring 4th positional argument to IO.#{foreach,readlines}
Fixes [Bug #18771]
2022-06-09 08:22:06 -07:00
Samuel Williams 6b0131db6f Make `Kernel#p` completely uninterruptible. 2022-05-28 15:44:18 +12:00
Samuel Williams 753d305503 Tidy up usage of write_lock. 2022-05-28 15:44:18 +12:00
Samuel Williams 1589ac6291 Improve handling of zero length writes. 2022-05-28 15:44:18 +12:00
Samuel Williams 4efccd28e4 Improve consistency of `io_binwritev_internal` implementaiton. 2022-05-28 15:44:18 +12:00
Samuel Williams ac499bb511 Improve error handling in `finish_writeconv`. 2022-05-28 15:44:18 +12:00
Samuel Williams c6cd9e180e Better handling of `error`. 2022-05-28 15:44:18 +12:00
machty 585e97142d Always allocate write_lock 2022-05-28 15:44:18 +12:00
Samuel Williams 15ebfe2849 Make `io_binwritev` atomic. 2022-05-28 15:44:18 +12:00
Samuel Williams ce23cfa518 Make `io_binwrite` atomic. 2022-05-28 15:44:18 +12:00
Samuel Williams 952ff7fbb3 Fix out of bounds read. 2022-05-25 21:50:53 +12:00
David Rodríguez ec7b42eb77
[DOC] Add a note to clarify binary flags to `IO.new`
Try to make it more clear that the `File::BINARY` integer flag, and the
`b` string suffix are not equivalent.
2022-05-20 17:23:45 +09:00
Burdette Lamar ac75c710cc
Link from printf methods to format spec doc (#5886) 2022-05-05 09:01:12 -05:00
Jean Boussier 4fcc7e2d7c Fix ARGF#lineno to return Integer as documented
[Bug #18753]
2022-04-25 12:39:14 +02:00
Peter Zhu 54b53e2c8f [ci skip] Fix docs 2022-04-13 10:43:23 -04:00
Burdette Lamar 70415071e8
Fix some RDoc links (#5778) 2022-04-08 14:25:38 -05:00
S-H-GAMELINKS 3607657e1c [DOC] Fix linux kernel commit links 2022-04-07 09:46:05 +09:00
Burdette Lamar 7be4d900f0
[DOC] Enhanced RDoc for String (#5751)
Adds to doc for String.new, also making it compliant with documentation_guide.rdoc.
    Fixes some broken links in io.c (that I failed to correct yesterday).
2022-04-02 14:26:49 -05:00
Nobuyoshi Nakada 729b9a8543
[DOC] Fix broken links to encodings.rdoc
Also prefers class name based references than file name based
references.
2022-04-02 15:06:12 +09:00
Nobuyoshi Nakada 42a0bed351
Prefix ccan headers (#4568)
* Prefixed ccan headers

* Remove unprefixed names in ccan/build_assert

* Remove unprefixed names in ccan/check_type

* Remove unprefixed names in ccan/container_of

* Remove unprefixed names in ccan/list

Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
2022-03-30 20:36:31 +13:00
Burdette Lamar 7f93b7dc88
[DOC] Fix formatting for What's Here in IO (#5719)
* Fix formatting for What's Here in IO

* Repair formatting in What's Heres in numeric.c

* Fix formatting for What's Here in IO
2022-03-25 15:43:46 -05:00
Burdette Lamar 4bdb4a1873
Close files in examples in io.c (#5615) 2022-03-01 12:07:54 -06:00