Skip to content

Commit dcf5f29

Browse files
committed
move ftype to File
1 parent d532855 commit dcf5f29

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/file.rbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@
810810
# * #truncate: Truncates `self` to the given size.
811811
#
812812
class File < IO
813+
# The string that `File.ftype` and `File::Stat#ftype` return
814+
type ftype = 'file' | 'directory' | 'characterSpecial' | 'blockSpecial'
815+
| 'fifo' | 'link' | 'socket' | 'unknown'
816+
813817
# <!-- rdoc-file=file.c -->
814818
# platform specific alternative separator
815819
#

core/file_stat.rbs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
class File::Stat
1010
include Comparable
1111

12-
# The string that `File::Stat#ftype` returns
13-
type ftype = 'file' | 'directory' | 'characterSpecial' | 'blockSpecial'
14-
| 'fifo' | 'link' | 'socket' | 'unknown'
15-
1612
# <!--
1713
# rdoc-file=file.c
1814
# - File::Stat.new(file_name) -> stat
@@ -230,7 +226,7 @@ class File::Stat
230226
#
231227
# File.stat("/dev/tty").ftype #=> "characterSpecial"
232228
#
233-
def ftype: () -> ftype
229+
def ftype: () -> File::ftype
234230

235231
# <!--
236232
# rdoc-file=file.c

test/stdlib/File_Stat_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_file?
9595
end
9696

9797
def test_ftype
98-
assert_send_type "() -> File::Stat::ftype",
98+
assert_send_type "() -> File::ftype",
9999
File::Stat.new(File.expand_path(__FILE__)), :ftype
100100
end
101101

0 commit comments

Comments
 (0)