1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

1823 commits

Author SHA1 Message Date
Burdette Lamar
4bdb4a1873
Close files in examples in io.c () 2022-03-01 12:07:54 -06:00
Burdette Lamar
26ffda2fd2
[DOC] Enhanced RDoc for some encoding methods ()
In String, treats:

    #b
    #scrub
    #scrub!
    #unicode_normalize
    #unicode_normalize!
    #encode
    #encode!

Also adds a note to IO.new (suggested by @jeremyevans).
2022-02-25 13:12:59 -06:00
Burdette Lamar
bec3a1f15a
Enhanced RDoc for io.c ()
Links to options doc added/improved; in particular, new links to new section "Encoding Options" in encoding.rdoc.  Minor inconsistencies ironed out.
2022-02-18 16:17:51 -06:00
Burdette Lamar
e9a2b30744
Enhanced RDoc concerning command injection ()
Clarifies security vulnerabilities for commands.

Treats:

    Kernel.system
    Kernel.` (backtick)
    IO.popen
    IO.read
    IO.write
    IO.binread
    IO.binwrite
    IO.readlines
    IO.foreach
2022-02-18 06:46:04 -06:00
Nobuyoshi Nakada
50c972a1ae
[DOC] Simplify operator method references 2022-02-12 12:38:36 +09:00
Peter Zhu
f53f49197f [DOC] Replace with IO@Modes 2022-02-07 09:52:06 -05:00
Peter Zhu
9b3115ff64 [DOC] Remove extra period 2022-02-07 09:52:06 -05:00
Peter Zhu
a12e2f9aa5 [DOC] Remove extra closing curly bracket 2022-02-07 09:52:06 -05:00
Peter Zhu
a32e5e1b97 [DOC] Use RDoc link style for links in the same class/module
I used this regex:

(?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+)

And performed a global find & replace for this:

rdoc-ref:$1@$2
2022-02-07 09:52:06 -05:00
Peter Zhu
f9a2802bc5 [DOC] Use RDoc link style for links to other classes/modules
I used this regex:

([A-Za-z]+)\.html#(?:class|module)-[A-Za-z]+-label-([A-Za-z0-9\-\+]+)

And performed a global find & replace for this:

rdoc-ref:$1@$2
2022-02-07 09:52:06 -05:00
Peter Zhu
ecd469fad0 [DOC] Fix links in documentation for File and IO
Fixes some typos and dead links.
2022-02-07 09:52:06 -05:00
Burdette Lamar
3e6c6c74dd
{DOC] Enhanced RDoc for io.c ()
Changes parameter name from simple opts to open_opts or enc_opts when appropriate; leaves the name unchanged when more than one kind of option is allowed.
2022-02-05 14:05:27 -06:00
Burdette Lamar
06a28ec4d4
[DOC] Enhanced RDoc for io.c ()
Treats:

    IO.binread (abbreviated to be like IO.binwrite).
    IO.write
    IO.binwrite
    IO.copystream
    IO#external_encoding
    IO#internal_encoding
    IO#set_encoding
2022-02-04 16:26:49 -06:00
Burdette Lamar
46f6575157
[DOC] Enhanced RDoc for io.c ()
Treats:

    IO.foreach
    IO.readlines
    IO.read
    IO.binread
2022-02-04 06:55:10 -06:00
Burdette Lamar
99a65e80d5
[DOC] Enhanced RDoc for io.c ()
Treats:

    Kernel#readline
    Kernel#readlines
    Kernel#`cmd`
    IO#advise
    IO.select
    IO#ioctl
    IO#fcntl
    Kernel#syscall
    IO.pipe
2022-01-30 16:17:53 -06:00
Yuta Saito
7ee786388a [wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libc 2022-01-19 11:19:06 +09:00
Burdette Lamar
ab85c5e979
[DOC] Enhanced RDoc for io.c ()
Treats:

    IO#reopen
    IO#printf
    Kernel#printf
    IO#print
    Kernel#print
    IO#putc
    IO.new
    IO#set_encoding_by_bom
    IO.for_fd
2022-01-18 06:25:26 -06:00
Masataka Pocke Kuwabara
28fad7764e Tweak IO documentation for IO.write('|cmd') and so on [ci skip] 2022-01-17 00:26:08 +09:00
Burdette Lamar
e40f79daa3
Enhanced RDoc for io.c ()
Treated:

    IO#open
    IO#sysopen
    #open
    IO#putc
    IO#puts
    #p
    Kernel#display
2022-01-14 18:33:06 -06:00
Burdette Lamar
6dc4c942a3
File rdoc ()
Treats:

    File introduction
    File.open
    File.new
2022-01-13 18:00:24 -06:00
Burdette Lamar
faf79d3a25
Enhanced RDoc for IO.popen ()
* Enhanced RDoc for IO.popen
2022-01-12 17:08:30 -06:00
Burdette Lamar
d920535d1b
Enhanced RDoc for IO ()
Treats:

    #pread
    #pwrite
    #binmode
    #binmode?
2022-01-10 17:02:48 -06:00
Burdette Lamar
6931d70e6e
Enhanced RDoc for IO ()
Treats:

    #sysseek
    #syswrite
    #sysread
2022-01-10 15:14:36 -06:00
Burdette Lamar
a9dc0c59e3
[DOC] Enhanced RDoc for IO ()
Revises much of the introductory material.

Also treats:

    #close_on_exec
    #close
    #closed?
    #close_read
    #close_write
2022-01-10 12:45:06 -06:00
Samuel Williams
0ca00e2cb7
Move IO write buffer allocation into function. 2022-01-09 00:03:16 +13:00
Burdette Lamar
5ad507d751
Enhanced RDoc for IO ()
Treats:

    #ungetc
    #isatty
    #close_on_exec?
2022-01-06 10:47:51 -06:00
Burdette Lamar
445c055b44
Enhanced RDoc for IO ()
Treats:

    #getc
    #readchar
    #getbyte
    #readbyte
    #ungetbyte
2022-01-05 16:13:06 -06:00
Burdette Lamar
9c15da0fd4
Enhanced RDoc for IO ()
Treats:

    #lineno
    #lineno=
    #readline
    #readlines
    #each_line
    #each_byte
    #each_char
    #each_codepoint
2022-01-04 12:57:45 -06:00
Nobuyoshi Nakada
069cca6f74
Negative RBOOL usage 2022-01-01 17:02:04 +09:00
Samuel Williams
243320d22f
Fix incorrect minimum read length. () 2022-01-01 20:23:47 +13:00
Burdette Lamar
87c03694e6
Enhanced RDoc for IO ()
Adds sections to class RDoc:

    Lines
        Line Separator
        Line Limit
        Line Number

Revises example text file t.txt to:

    Include paragraphs (separated by double line separator).
    Avoid being too long.

Revises examples that use the changed example file.

There are several other methods that will point to the added sections.
2021-12-30 16:46:24 -06:00
Nobuyoshi Nakada
3238164f9c ioctl_narg_len is used only when ioctl(2) is available 2021-12-29 11:40:04 +09:00
Samuel Williams
548c8f5f7a
Prefer to use RTEST when checking result of rb_io_wait. ()
* Prefer to use RTEST when checking result of `rb_io_wait`.

* Consistently use false for signifying no events ready.
2021-12-25 02:26:06 +13:00
Nobuyoshi Nakada
4f74153846
Adjust styles [ci skip] 2021-12-24 21:17:27 +09:00
Samuel Williams
acfe2f2655
Improvements to rb_io_wait return value handling and internal implementation. () 2021-12-24 23:11:02 +13:00
Burdette Lamar
a8f4cc2bfa
[DOC] Enhanced RDoc for IO ()
Treats #gets.
2021-12-23 10:27:10 -06:00
Burdette Lamar
243ecd176d
[DOC] Enhanced RDoc for IO ()
Treats:

    #readpartial
    #read
2021-12-22 14:41:39 -06:00
Nobuyoshi Nakada
fdf3996349
Empty and return the buffer if zero size is given [Bug ]
In `IO#readpartial` and `IO#read_nonblock`, as well as `IO#read`.
2021-12-22 15:45:59 +09:00
Nobuyoshi Nakada
c29c2afafe Refactor setup_narg and extract finish_narg 2021-12-21 13:34:04 +09:00
Burdette Lamar
6ad8cf7071
[DOC] Enhanced RDoc for IO ()
Treated:

    #sync
    #sync=
    #fsync
    #fdatasync
    #fileno
    #pid
    #inspect
    #to_io
2021-12-20 16:28:58 -06:00
Burdette Lamar
3bb6e4f641
[DOC] Enhanced RDoc for IO ()
Treated:

    ::try_convert
    #write
    #<<
    #flush
    #tell
    #seek
    #pos=
    #rewind
    #eof
2021-12-19 22:04:47 -06:00
Burdette Lamar
f44367effe
[DOC] Addition to IO introduction ()
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-12-19 09:37:06 -06:00
Samuel Williams
42d3231154
Introduce io_result wrapper for passing [-errno, size] in VALUE. 2021-12-18 18:19:30 +13:00
Nobuyoshi Nakada
b555e659c4
Do not use fcopyfile if appending to non-empty file [Bug ]
`fcopyfile` appends `src` to `to` and then truncates `to` to it's
original size.
2021-12-05 18:47:02 +09:00
Nobuyoshi Nakada
37cd35aea8 [win32] Transcode input from console [Bug ]
On Windows, as the input from console is encoded in the active
code page, convert the input to the internal encoding.
2021-12-01 18:54:26 +09:00
Samuel Williams
51c67ee61a Don't allow fd == -1 to propagate to system calls. 2021-11-11 13:35:16 +13:00
Nobuyoshi Nakada
46e46eafd4
size_t is not for file size 2021-11-10 16:41:26 +09:00
Samuel Williams
4b89034218 IO::Buffer for scheduler interface. 2021-11-10 19:21:05 +13:00
Peter Zhu
aeae6e2842 [Feature ] Remove all usages of rb_gc_force_recycle
This commit removes usages of rb_gc_force_recycle since it is a burden
to maintain and makes changes to the GC difficult.
2021-11-08 14:05:54 -05:00
Nobuyoshi Nakada
049e1f8560
Fix typo 2021-10-26 14:43:12 +09:00