File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -258,13 +258,13 @@ def try_path_with_ext(path)
258
258
def try_path ( path )
259
259
partial = File . join ( File . dirname ( path ) , "_#{ File . basename ( path ) } " )
260
260
result = [ ]
261
- result . push ( partial ) if file_exist ?( partial )
262
- result . push ( path ) if file_exist ?( path )
261
+ result . push ( partial ) if File . file ?( partial )
262
+ result . push ( path ) if File . file ?( path )
263
263
result
264
264
end
265
265
266
266
def try_path_as_dir ( path , from_import )
267
- return unless dir_exist ?( path )
267
+ return unless File . directory ?( path )
268
268
269
269
if from_import
270
270
result = exactly_one ( try_path_with_ext ( File . join ( path , 'index.import' ) ) )
@@ -281,14 +281,6 @@ def exactly_one(paths)
281
281
raise "It's not clear which file to import. Found:\n #{ paths . map { |path | " #{ path } " } . join ( "\n " ) } "
282
282
end
283
283
284
- def file_exist? ( path )
285
- File . exist? ( path ) && File . file? ( path )
286
- end
287
-
288
- def dir_exist? ( path )
289
- File . exist? ( path ) && File . directory? ( path )
290
- end
291
-
292
284
def without_ext ( path )
293
285
ext = File . extname ( path )
294
286
path . delete_suffix ( ext )
You can’t perform that action at this time.
0 commit comments