Skip to content
This repository was archived by the owner on Mar 22, 2021. It is now read-only.

Commit b5641a3

Browse files
committed
README: fix filepath examples
Use snake case instead of pascal case.
1 parent 941df96 commit b5641a3

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Windows). All examples below are for [POSIX systems].
271271
Remove last extension, and the `.` preceding it.
272272

273273
```lua
274-
dropExtension("/directory/path.ext") == "/directory/path"
274+
drop_extension("/directory/path.ext") == "/directory/path"
275275
```
276276

277277
Parameters:
@@ -292,8 +292,8 @@ This function wraps [System.FilePath.dropExtension].
292292
Does the given filename have an extension?
293293

294294
```lua
295-
hasExtension("/directory/path.ext") == true
296-
hasExtension("/directory/path") == false
295+
has_extension("/directory/path.ext") == true
296+
has_extension("/directory/path") == false
297297
```
298298

299299
Parameters:
@@ -333,9 +333,9 @@ This function wraps [System.FilePath.isAbsolute].
333333
Is a path relative, or is it fixed to the root?
334334

335335
```lua
336-
isRelative("test/path") == true
337-
isRelative("/test") == false
338-
isRelative("/") == false
336+
is_relative("test/path") == true
337+
is_relative("/test") == false
338+
is_relative("/") == false
339339
```
340340

341341
Parameters:
@@ -357,7 +357,7 @@ This function wraps [System.FilePath.isRelative].
357357
Join path elements back together by the directory separator.
358358

359359
```lua
360-
joinPath({"/","directory/","file.ext"}) == "/directory/file.ext"
360+
join_path({"/","directory/","file.ext"}) == "/directory/file.ext"
361361
```
362362

363363
Parameters:
@@ -396,9 +396,9 @@ This function wraps [System.FilePath.normalise].
396396
Split a path by the directory separator.
397397

398398
```lua
399-
splitDirectories("/directory/file.ext") == {"/","directory","file.ext"}
400-
splitDirectories("test/file") == {"test","file"}
401-
splitDirectories("/test/file") == {"/","test","file"}
399+
split_directories("/directory/file.ext") == {"/","directory","file.ext"}
400+
split_directories("test/file") == {"test","file"}
401+
split_directories("/test/file") == {"/","test","file"}
402402
```
403403

404404
Parameters:
@@ -419,8 +419,8 @@ This function wraps [System.FilePath.splitDirectories].
419419
Get the directory name, move up one level.
420420

421421
```lua
422-
takeDirectory("/foo/bar/baz") == "/foo/bar"
423-
takeDirectory("/foo/bar/baz/") == "/foo/bar/baz"
422+
take_directory("/foo/bar/baz") == "/foo/bar"
423+
take_directory("/foo/bar/baz/") == "/foo/bar/baz"
424424
```
425425

426426
Parameters:
@@ -441,8 +441,8 @@ This function wraps [System.FilePath.takeDirectory].
441441
Get all extensions.
442442

443443
```lua
444-
takeExtensions("/directory/path.ext") == ".ext"
445-
takeExtensions("file.tar.gz") == ".tar.gz"
444+
take_extensions("/directory/path.ext") == ".ext"
445+
take_extensions("file.tar.gz") == ".tar.gz"
446446
```
447447

448448
Parameters:
@@ -463,8 +463,8 @@ This function wraps [System.FilePath.takeExtensions].
463463
Get the file name.
464464

465465
```lua
466-
takeFileName("/directory/file.ext") == "file.ext"
467-
takeFileName("test/") == ""
466+
take_filename("/directory/file.ext") == "file.ext"
467+
take_filename("test/") == ""
468468
```
469469

470470
Parameters:

0 commit comments

Comments
 (0)