From 3dee7b5d768807780d042babdbe44a20e4f65153 Mon Sep 17 00:00:00 2001 From: rofinn Date: Mon, 5 Mar 2018 13:34:37 -0600 Subject: [PATCH] Replaced references to FilePaths.jl with FilePathsBase.jl --- .travis.yml | 4 ++-- LICENSE.md | 2 +- README.md | 32 ++++++++++++++++---------------- appveyor.yml | 6 +++--- src/FilePathsBase.jl | 2 +- src/path.jl | 18 +++++++++--------- test/path.jl | 12 ++++++------ test/runtests.jl | 4 ++-- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87f9300..92aa96e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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())' diff --git a/LICENSE.md b/LICENSE.md index c27b489..0a9dbd2 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -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. > diff --git a/README.md b/README.md index e8aaec6..e42b541 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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() @@ -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 diff --git a/appveyor.yml b/appveyor.yml index 43a17c2..67cb484 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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())" diff --git a/src/FilePathsBase.jl b/src/FilePathsBase.jl index 54e0deb..ea46ba4 100644 --- a/src/FilePathsBase.jl +++ b/src/FilePathsBase.jl @@ -1,6 +1,6 @@ __precompile__() -module FilePaths +module FilePathsBase using Compat diff --git a/src/path.jl b/src/path.jl index 0069a7b..534f6d4 100644 --- a/src/path.jl +++ b/src/path.jl @@ -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" @@ -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) @@ -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" ``` """ @@ -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" @@ -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-- ``` """ @@ -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 ``` """ @@ -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 ``` """ @@ -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-- diff --git a/test/path.jl b/test/path.jl index b2f5355..d9e1996 100644 --- a/test/path.jl +++ b/test/path.jl @@ -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") == "" @@ -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. diff --git a/test/runtests.jl b/test/runtests.jl index 0f41b97..85b9839 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ -using FilePaths +using FilePathsBase using Base.Test -@testset "FilePaths" begin +@testset "FilePathsBase" begin include("mode.jl") include("path.jl")