Browse Source

rm Compat

pull/14/head
Fredrik Ekre 8 years ago
parent
commit
857b739720
  1. 1
      REQUIRE
  2. 19
      src/Documenter.jl
  3. 3
      src/IJulia.jl
  4. 2
      src/Literate.jl
  5. 6
      test/runtests.jl

1
REQUIRE

@ -1,3 +1,2 @@ @@ -1,3 +1,2 @@
julia 0.7.0-alpha
JSON
Compat

19
src/Documenter.jl

@ -1,22 +1,7 @@ @@ -1,22 +1,7 @@
# this file contains some utilities copied from the Documenter.jl package
# (https://github.com/JuliaDocs/Documenter.jl), see LICENSE.md for license
module Documenter
using Compat: stdout, stderr, Cvoid
@static if VERSION < v"0.7.0-DEV.3951"
link_pipe!(pipe; reader_supports_async = true, writer_supports_async = true) =
Base.link_pipe(pipe, julia_only_read = reader_supports_async, julia_only_write = writer_supports_async)
else
import Base: link_pipe!
end
@static if isdefined(Base, :with_logger)
using Logging
else # make things a no-op since warnings/info already print to stdout
struct ConsoleLogger end
ConsoleLogger(io) = ConsoleLogger()
with_logger(f, logger) = f()
end
using Logging
function withoutput(f)
# Save the default output streams.
@ -25,7 +10,7 @@ function withoutput(f) @@ -25,7 +10,7 @@ function withoutput(f)
# Redirect both the `stdout` and `stderr` streams to a single `Pipe` object.
pipe = Pipe()
link_pipe!(pipe; reader_supports_async = true, writer_supports_async = true)
Base.link_pipe!(pipe; reader_supports_async = true, writer_supports_async = true)
redirect_stdout(pipe.in)
redirect_stderr(pipe.in)
# Also redirect logging stream to the same pipe

3
src/IJulia.jl

@ -1,8 +1,7 @@ @@ -1,8 +1,7 @@
# this file contains some utilities copied from the IJulia.jl package
# (https://github.com/JuliaLang/IJulia.jl), see LICENSE.md for license
module IJulia
using Compat.Base64
import Compat: showable
using Base64
const text_plain = MIME("text/plain")
const image_svg = MIME("image/svg+xml")

2
src/Literate.jl

@ -1,8 +1,6 @@ @@ -1,8 +1,6 @@
__precompile__()
module Literate
import Compat: replace, popfirst!, @error, @info, occursin
import JSON
include("IJulia.jl")

6
test/runtests.jl

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
import Literate
import Literate: Chunk, MDChunk, CodeChunk
import Compat
import Compat: occursin
using Test
# compare content of two parsed chunk vectors
@ -539,7 +537,7 @@ end @@ -539,7 +537,7 @@ end
lastidx = 1
for cell in expected_cells
idx = Compat.findnext(cell, notebook, lastidx)
idx = findnext(cell, notebook, lastidx)
@test idx !== nothing
lastidx = nextind(notebook, last(idx))
end
@ -619,7 +617,7 @@ end @@ -619,7 +617,7 @@ end
lastidx = 1
for out in expected_outputs
idx = Compat.findnext(out, notebook, lastidx)
idx = findnext(out, notebook, lastidx)
@test idx !== nothing
lastidx = nextind(notebook, last(idx))
end

Loading…
Cancel
Save