Skip to content

Commit

Permalink
Replaced references to FilePaths.jl with FilePathsBase.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
rofinn committed Mar 5, 2018
1 parent a0903f0 commit 3dee7b5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ matrix:
- julia: nightly
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.init(); Pkg.clone(pwd()); Pkg.test("FilePaths"; coverage=true)'
- julia -e 'Pkg.init(); Pkg.clone(pwd()); Pkg.test("FilePathsBase"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("FilePaths")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
- julia -e 'cd(Pkg.dir("FilePathsBase")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The FilePaths.jl package is licensed under the MIT "Expat" License:
The FilePathsBase.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2015: Rory Finnegan.
>
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# FIlePaths.jl
# FilePathsBase.jl

[![Build Status](https://travis-ci.org/rofinn/FilePaths.jl.svg?branch=master)](https://travis-ci.org/rofinn/FilePaths.jl)
[![codecov.io](https://codecov.io/github/rofinn/FilePaths.jl/coverage.svg?branch=master)](https://codecov.io/rofinn/Rory-Finnegan/FilePaths.jl?branch=master)
[![Build Status](https://travis-ci.org/rofinn/FilePathsBase.jl.svg?branch=master)](https://travis-ci.org/rofinn/FilePathsBase.jl)
[![codecov.io](https://codecov.io/github/rofinn/FilePathsBase.jl/coverage.svg?branch=master)](https://codecov.io/rofinn/FilePathsBase.jl?branch=master)

FilePaths.jl provides a type based approach to working with filesystem paths in julia.
FilePathsBase.jl provides a type based approach to working with filesystem paths in julia.

## Intallation:
FilePaths.jl is registered, so you can to use `Pkg.add` to install it.
FilePathsBase.jl is registered, so you can to use `Pkg.add` to install it.
```julia
julia> Pkg.add("FilePaths")
```

## Usage:
```julia
julia> using FilePaths
julia> using FilePathsBase
```

The first important difference about working with paths in FilePaths.jl is that a path is an immutable list (Tuple) of strings, rather than simple a string.
The first important difference about working with paths in FilePathsBase.jl is that a path is an immutable list (Tuple) of strings, rather than simple a string.

Path creation:
```julia
julia> Path("~/repos/FilePaths.jl/")
Paths.PosixPath(("~","repos","FilePaths.jl",""))
julia> Path("~/repos/FilePathsBase.jl/")
Paths.PosixPath(("~","repos","FilePathsBase.jl",""))
```
or
```julia
julia> p"~/repos/FilePaths.jl/"
Paths.PosixPath(("~","repos","FilePaths.jl",""))
julia> p"~/repos/FilePathsBase.jl/"
Paths.PosixPath(("~","repos","FilePathsBase.jl",""))
```

Human readable file status info:
Expand Down Expand Up @@ -86,9 +86,9 @@ julia> read(p"testfile")
"foobar"
```

All the standard methods for working with paths in base julia exist in the FilePaths.jl. The following describes the rough mapping of method names. Use `?` at the REPL to get the documentation and arguments as they may be different than the base implementations.
All the standard methods for working with paths in base julia exist in the FilePathsBase.jl. The following describes the rough mapping of method names. Use `?` at the REPL to get the documentation and arguments as they may be different than the base implementations.

Base | FilePaths.jl
Base | FilePathsBase.jl
--- | ---
pwd() | cwd()
homedir() | home()
Expand Down Expand Up @@ -131,9 +131,9 @@ mv | move
rm | remove
touch | touch
tempname | tmpname
tempdir | tmpdir
mktemp | mktmp
mktempdir | mktmpdir
tempdir | tmpdir
mktemp | mktmp
mktempdir | mktmpdir
chmod | chmod (recursive unix-only)
chown (unix only) | chown (unix only)
N/A | read
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ install:
build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "Pkg.clone(pwd(), \"FilePaths\"); versioninfo(); Pkg.build(\"FilePaths\")"
- C:\projects\julia\bin\julia -e "Pkg.clone(pwd(), \"FilePathsBase\"); versioninfo(); Pkg.build(\"FilePathsBase\")"

test_script:
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"FilePaths\", coverage=true)"
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"FilePathsBase\", coverage=true)"

after_test:
- C:\projects\julia\bin\julia -e "cd(Pkg.dir(\"FilePaths\")); Pkg.add(\"Coverage\"); using Coverage; Codecov.submit(Codecov.process_folder())"
- C:\projects\julia\bin\julia -e "cd(Pkg.dir(\"FilePathsBase\")); Pkg.add(\"Coverage\"); using Coverage; Codecov.submit(Codecov.process_folder())"
2 changes: 1 addition & 1 deletion src/FilePathsBase.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__precompile__()

module FilePaths
module FilePathsBase

using Compat

Expand Down
18 changes: 9 additions & 9 deletions src/path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Base.parent(path::AbstractPath) = parents(path)[end]
# Example
```
julia> parents(p"~/.julia/v0.6/REQUIRE")
3-element Array{FilePaths.PosixPath,1}:
3-element Array{FilePathsBase.PosixPath,1}:
p"~"
p"~/.julia"
p"~/.julia/v0.6"
Expand Down Expand Up @@ -112,8 +112,8 @@ Extracts the `basename` without any extensions.
# Example
```
julia> filename(p"~/repos/FilePaths.jl/src/FilePaths.jl")
"FilePaths"
julia> filename(p"~/repos/FilePathsBase.jl/src/FilePathsBase.jl")
"FilePathsBase"
```
"""
function filename(path::AbstractPath)
Expand All @@ -128,7 +128,7 @@ Extracts the last extension from a filename if there any, otherwise it returns a
# Example
```
julia> extension(p"~/repos/FilePaths.jl/src/FilePaths.jl")
julia> extension(p"~/repos/FilePathsBase.jl/src/FilePathsBase.jl")
"jl"
```
"""
Expand All @@ -150,7 +150,7 @@ Extracts all extensions from a filename if there any, otherwise it returns an em
# Example
```
julia> extensions(p"~/repos/FilePaths.jl/src/FilePaths.jl.bak")
julia> extensions(p"~/repos/FilePathsBase.jl/src/FilePathsBase.jl.bak")
2-element Array{SubString{String},1}:
"jl"
"bak"
Expand Down Expand Up @@ -294,7 +294,7 @@ Returns the `Mode` for the specified path.
# Example
```
julia> mode(p"src/FilePaths.jl")
julia> mode(p"src/FilePathsBase.jl")
-rw-r--r--
```
"""
Expand All @@ -308,7 +308,7 @@ Returns the last modified date for the `path`.
# Example
```
julia> modified(p"src/FilePaths.jl")
julia> modified(p"src/FilePathsBase.jl")
2017-06-20T04:01:09
```
"""
Expand All @@ -321,7 +321,7 @@ Returns the creation date for the `path`.
# Example
```
julia> created(p"src/FilePaths.jl")
julia> created(p"src/FilePathsBase.jl")
2017-06-20T04:01:09
```
"""
Expand Down Expand Up @@ -576,7 +576,7 @@ julia> chmod(p"newfile", user=(READ+WRITE+EXEC), group=(READ+EXEC), other=READ)
julia> mode(p"newfile")
-rwxr-xr--
julia> chmod(p"newfile", mode(p"src/FilePaths.jl"))
julia> chmod(p"newfile", mode(p"src/FilePathsBase.jl"))
julia> mode(p"newfile")
-rw-r--r--
Expand Down
12 changes: 6 additions & 6 deletions test/path.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

cd(abs(parent(Path(@__FILE__)))) do
@testset "Simple Path Usage" begin
reg = is_windows() ? "..\\src\\FilePaths.jl" : "../src/FilePaths.jl"
reg = is_windows() ? "..\\src\\FilePathsBase.jl" : "../src/FilePathsBase.jl"
@test ispath(reg)

p = Path(reg)

@test p == p"../src/FilePaths.jl"
@test p == p"../src/FilePathsBase.jl"
@test String(p) == reg
@test String(cwd()) == pwd()
@test String(home()) == homedir()

@test parts(p) == ("..", "src", "FilePaths.jl")
@test parts(p) == ("..", "src", "FilePathsBase.jl")
@test hasparent(p)
@test parent(p) == p"../src"
@test parents(p) == [p"..", p"../src"]
@test_throws ErrorException parents(p".")

@test basename(p) == "FilePaths.jl"
@test basename(p) == "FilePathsBase.jl"
@test join(parent(p), Path(basename(p))) == p
@test filename(p) == "FilePaths"
@test filename(p) == "FilePathsBase"

@test extension(p) == "jl"
@test extension(p"../REQUIRE") == ""
Expand All @@ -28,7 +28,7 @@ cd(abs(parent(Path(@__FILE__)))) do

@test exists(p)
@test !isabs(p)
@test String(norm(p"../src/../src/FilePaths.jl")) == normpath("../src/../src/FilePaths.jl")
@test String(norm(p"../src/../src/FilePathsBase.jl")) == normpath("../src/../src/FilePathsBase.jl")
@test String(abs(p)) == abspath(String(p))
# This works around an issue with Base.relpath: that function does not take
# into account the paths on Windows should be compared case insensitive.
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using FilePaths
using FilePathsBase
using Base.Test

@testset "FilePaths" begin
@testset "FilePathsBase" begin

include("mode.jl")
include("path.jl")
Expand Down

0 comments on commit 3dee7b5

Please sign in to comment.