Skip to content

Commit 3fbd1c8

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Tweaks for Pathname#chardev?
1 parent 21cee84 commit 3fbd1c8

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

pathname_builtin.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,19 +1342,24 @@ class Pathname # * FileTest *
13421342
# The returned value is OS-dependent; on Windows, almost always `false`.
13431343
def blockdev?() FileTest.blockdev?(@path) end
13441344

1345+
# :markup: markdown
1346+
#
13451347
# call-seq:
13461348
# chardev? => true or false
13471349
#
1348-
# Returns whether +self+ represents a character device
1350+
# Returns whether `self` represents a path to a character device
13491351
# (i.e., a sequential-access device):
13501352
#
1351-
# Pathname.new('/dev/tty').chardev? # => true
1352-
# Pathname.new('/dev/null').chardev? # => true
1353-
# Pathname.new('/dev/nvme0n1').chardev? # => false
1354-
# Pathname.new('/dev/loop0').chardev? # => false
1355-
# Pathname.new('nosuch').chardev? # => false
1356-
#
1357-
# The returned value is OS-dependent; on Windows, almost always +false+.
1353+
# ```ruby
1354+
# Pathname('/dev/tty').chardev? # => true
1355+
# Pathname('/dev/null').chardev? # => true
1356+
# Pathname('/dev/nvme0n1').chardev? # => false
1357+
# Pathname('/dev/loop0').chardev? # => false
1358+
# Pathname($stdin).chardev? # => false
1359+
# Pathname('nosuch').chardev? # => false
1360+
# ```
1361+
#
1362+
# The returned value is OS-dependent; on Windows, almost always `false`.
13581363
def chardev?() FileTest.chardev?(@path) end
13591364

13601365
# Tests the file is empty.

0 commit comments

Comments
 (0)