You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has recently come up in wren-console: joshgoebel#16
Talking about adding:
File.dirname(path) - Strip last component from file name
File.basename(path) - Strip directory from filenames
File.basename(path, suffixes) - Strip directory and suffix from filenames
The existing test infrastructure is a bit frustrating to use for testing like this vs a traditional testing framework. I wanted to open this here to see if there is interest in getting this functionality (basename/dirname) into the official CLI. If not, then we may switch to a much simpler testing framework for these tests. On the other hand, if we wish to upstream this change, then it makes sense to stick with the existing testing infrastructure.
One question if this was to land in CLI proper where should we place "core-like" utility functions, such as stringLastIndexOf... it doesn't seem correct to just leave this laying around in the File class as it may need to be reused more broadly in the future... do we need a util or tools module?
The text was updated successfully, but these errors were encountered:
joshgoebel
changed the title
Proposal: Basename and dirname for IO/File
Proposal: File.basename and File.dirnameSep 20, 2021
This has recently come up in
wren-console
: joshgoebel#16Talking about adding:
File.dirname(path)
- Strip last component from file nameFile.basename(path)
- Strip directory from filenamesFile.basename(path, suffixes)
- Strip directory and suffix from filenamesThe existing test infrastructure is a bit frustrating to use for testing like this vs a traditional testing framework. I wanted to open this here to see if there is interest in getting this functionality (basename/dirname) into the official CLI. If not, then we may switch to a much simpler testing framework for these tests. On the other hand, if we wish to upstream this change, then it makes sense to stick with the existing testing infrastructure.
One question if this was to land in CLI proper where should we place "core-like" utility functions, such as
stringLastIndexOf
... it doesn't seem correct to just leave this laying around in theFile
class as it may need to be reused more broadly in the future... do we need autil
ortools
module?The text was updated successfully, but these errors were encountered: