src/utilities.jl
changed.
Showing 1 of 1 files from the diff.
@@ -283,6 +283,36 @@
Loading
283 | 283 | end |
|
284 | 284 | end |
|
285 | 285 | ||
286 | + | ||
287 | + | if VERSION < v"1.1" |
|
288 | + | _splitdir_nodrive(path::String) = _splitdir_nodrive("", path) |
|
289 | + | function _splitdir_nodrive(a::String, b::String) |
|
290 | + | m = match(Base.Filesystem.path_dir_splitter, b) |
|
291 | + | m === nothing && return (a, b) |
|
292 | + | a = string(a, isempty(m.captures[1]) ? m.captures[2][1] : m.captures[1]) |
|
293 | + | a, String(m.captures[3]) |
|
294 | + | end |
|
295 | + | splitpath(p::AbstractString) = splitpath(String(p)) |
|
296 | + | ||
297 | + | function splitpath(p::String) |
|
298 | + | drive, p = _splitdrive(p) |
|
299 | + | out = String[] |
|
300 | + | isempty(p) && (pushfirst!(out, p)) # "" means the current directory. |
|
301 | + | while !isempty(p) |
|
302 | + | dir, base = _splitdir_nodrive(p) |
|
303 | + | dir == p && (pushfirst!(out, dir); break) # Reached root node. |
|
304 | + | if !isempty(base) # Skip trailing '/' in basename |
|
305 | + | pushfirst!(out, base) |
|
306 | + | end |
|
307 | + | p = dir |
|
308 | + | end |
|
309 | + | if !isempty(drive) # Tack the drive back on to the first element. |
|
310 | + | out[1] = drive * out[1] # Note that length(out) is always >= 1. |
|
311 | + | end |
|
312 | + | return out |
|
313 | + | end |
|
314 | + | end |
|
315 | + | ||
286 | 316 | @static if Sys.iswindows() && VERSION < v"1.3" |
|
287 | 317 | function _splitdir_nodrive(a::String, b::String) |
|
288 | 318 | m = match(r"^(.*?)([/\\]+)([^/\\]*)$", b) |
@@ -308,6 +338,7 @@
Loading
308 | 338 | else |
|
309 | 339 | _dirname = dirname |
|
310 | 340 | _splitdir = splitdir |
|
341 | + | _splitdrive = splitdrive |
|
311 | 342 | end |
|
312 | 343 | ||
313 | 344 | function valid_id(s::String) |
@@ -374,31 +405,3 @@
Loading
374 | 405 | end |
|
375 | 406 | end |
|
376 | 407 | ||
377 | - | if VERSION < v"1.1" |
|
378 | - | _splitdir_nodrive(path::String) = _splitdir_nodrive("", path) |
|
379 | - | function _splitdir_nodrive(a::String, b::String) |
|
380 | - | m = match(Base.Filesystem.path_dir_splitter, b) |
|
381 | - | m === nothing && return (a, b) |
|
382 | - | a = string(a, isempty(m.captures[1]) ? m.captures[2][1] : m.captures[1]) |
|
383 | - | a, String(m.captures[3]) |
|
384 | - | end |
|
385 | - | splitpath(p::AbstractString) = splitpath(String(p)) |
|
386 | - | ||
387 | - | function splitpath(p::String) |
|
388 | - | drive, p = splitdrive(p) |
|
389 | - | out = String[] |
|
390 | - | isempty(p) && (pushfirst!(out, p)) # "" means the current directory. |
|
391 | - | while !isempty(p) |
|
392 | - | dir, base = _splitdir_nodrive(p) |
|
393 | - | dir == p && (pushfirst!(out, dir); break) # Reached root node. |
|
394 | - | if !isempty(base) # Skip trailing '/' in basename |
|
395 | - | pushfirst!(out, base) |
|
396 | - | end |
|
397 | - | p = dir |
|
398 | - | end |
|
399 | - | if !isempty(drive) # Tack the drive back on to the first element. |
|
400 | - | out[1] = drive * out[1] # Note that length(out) is always >= 1. |
|
401 | - | end |
|
402 | - | return out |
|
403 | - | end |
|
404 | - | end |
Files | Coverage |
---|---|
src | 68.23% |
Project Totals (29 files) | 68.23% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.