Skip to content

Commit 328f508

Browse files
committed
cleanup
1 parent f1a6eef commit 328f508

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Bug fixes:
99
Compatibility:
1010

1111
* Add `Exception#detailed_message` method (#3257, @andrykonchin).
12+
* Promoted `File#path` and `File#to_path` to `IO#path` and `IO#to_path` and made IO#new accept an optional `path:` keyword argument (#3275, @moste00)
1213

1314
Performance:
1415

src/main/ruby/truffleruby/core/file.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
class File < IO
3838
include Enumerable
3939

40-
class FileError < RuntimeError; end
41-
42-
class NoFileError < FileError; end
43-
44-
class UnableToStat < FileError; end
45-
46-
class PermissionError < FileError; end
47-
4840
# these will be necessary when we run on Windows
4941
DOSISH = false # Primitive.as_boolean(RUBY_PLATFORM =~ /mswin/)
5042
CASEFOLD_FILESYSTEM = DOSISH
@@ -1169,8 +1161,7 @@ def initialize(path_or_fd, mode = nil, perm = nil, **options)
11691161
nmode, _binary, _external, _internal, _autoclose, perm = Truffle::IOOperations.normalize_options(mode, perm, options)
11701162
fd = IO.sysopen(path, nmode, perm)
11711163

1172-
options[:path] = path
1173-
super(fd, mode, **options)
1164+
super(fd, mode, **options, path: path)
11741165
end
11751166
end
11761167

src/main/ruby/truffleruby/core/io.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,6 @@ def prepare_read_string(str)
12251225
def path
12261226
@path.dup
12271227
end
1228-
12291228
alias_method :to_path, :path
12301229

12311230
##

0 commit comments

Comments
 (0)