From c63a5406fae6ca506d14e538b6183b3507553370 Mon Sep 17 00:00:00 2001 From: aminya Date: Sat, 29 Feb 2020 17:31:26 -0600 Subject: [PATCH 1/9] Rename EzXML Change UUID --- LICENSE.md | 2 +- Project.toml | 4 +- README.md | 40 ++--- docs/Project.toml | 2 +- docs/make.jl | 8 +- docs/setup.jl | 2 +- docs/src/devnotes.md | 4 +- docs/src/index.md | 4 +- docs/src/manual.md | 148 +++++++++---------- docs/src/reference.md | 88 +++++------ example/julia2xml.jl | 2 +- example/listlinks.jl | 2 +- example/primates.jl | 2 +- src/EzXML.jl | 2 +- src/node.jl | 4 +- src/streamreader.jl | 2 +- test/runtests.jl | 332 +++++++++++++++++++++--------------------- 17 files changed, 324 insertions(+), 324 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index b7a727d..8484a77 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The EzXML.jl package is licensed under the MIT "Expat" License: +The EzXMLPatched.jl package is licensed under the MIT "Expat" License: > Copyright (c) 2016: Kenta Sato. > diff --git a/Project.toml b/Project.toml index 85a22e5..5b9ae14 100644 --- a/Project.toml +++ b/Project.toml @@ -1,5 +1,5 @@ -name = "EzXML" -uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" +name = "EzXMLPatched" +uuid = "ebbc4602-91c8-4f2e-9b89-acc792d9cec0" authors = ["Kenta Sato "] version = "1.1.0" diff --git a/README.md b/README.md index 010832f..711df87 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -

EzXML.jl Logo

+

EzXMLPatched.jl Logo

-EzXML.jl - XML/HTML tools for primates +EzXMLPatched.jl - XML/HTML tools for primates ====================================== [![Docs Stable][docs-stable-img]][docs-stable-url] @@ -9,7 +9,7 @@ EzXML.jl - XML/HTML tools for primates [![Appveyor Status][appveyor-img]][appveyor-url] [![codecov.io][codecov-img]][codecov-url] -EzXML.jl is a package to handle XML/HTML documents for primates. +EzXMLPatched.jl is a package to handle XML/HTML documents for primates. The main features are: * Reading and writing XML/HTML documents. @@ -24,9 +24,9 @@ The main features are: Installation ------------ -Install EzXML.jl as follows: +Install EzXMLPatched.jl as follows: ``` -julia -e 'using Pkg; Pkg.add("EzXML")' +julia -e 'using Pkg; Pkg.add("EzXMLPatched")' ``` This package depends on [libxml2](http://xmlsoft.org/) 2.9.9, which will be automatically installed as an artifact via [XML2_jll.jl](https://github.com/JuliaBinaryWrappers/XML2_jll.jl) if you use Julia 1.3 or later. @@ -35,7 +35,7 @@ Currently, Windows, Linux, macOS, and FreeBSD are now supported. Version compatibility --------------------- -| EzXML.jl | Julia | +| EzXMLPatched.jl | Julia | |:--------:|:------------:| | 1.0 | 1.0 or later | | 1.1 | 1.3 or later | @@ -45,7 +45,7 @@ Usage ```julia # Load the package. -using EzXML +using EzXMLPatched # Parse an XML string # (use `readxml()` to read a document from a file). @@ -86,13 +86,13 @@ end Quick reference --------------- -See the [reference page](https://bicycle1885.github.io/EzXML.jl/stable/reference/) or docstrings for more details. +See the [reference page](https://bicycle1885.github.io/EzXMLPatched.jl/stable/reference/) or docstrings for more details. Types: -* `EzXML.Document`: an XML/HTML document -* `EzXML.Node`: an XML/HTML node including elements, attributes, texts, etc. -* `EzXML.XMLError`: an error happened in libxml2 -* `EzXML.StreamReader`: a streaming XML reader +* `EzXMLPatched.Document`: an XML/HTML document +* `EzXMLPatched.Node`: an XML/HTML node including elements, attributes, texts, etc. +* `EzXMLPatched.XMLError`: an error happened in libxml2 +* `EzXMLPatched.StreamReader`: a streaming XML reader IO: * From file: `readxml(filename|stream)`, `readhtml(filename|stream)` @@ -130,8 +130,8 @@ Accessors: * Namespaces: `namespace(node)`, `namespaces(node)` Constructors: -* `EzXML.Document` type: `XMLDocument(version="1.0")`, `HTMLDocument(uri=nothing, externalID=nothing)` -* `EzXML.Node` type: `XMLDocumentNode(version="1.0")`, `HTMLDocumentNode(uri, externalID)`, `ElementNode(name)`, `TextNode(content)`, `CommentNode(content)`, `CDataNode(content)`, `AttributeNode(name, value)`, `DTDNode(name, [systemID, [externalID]])` +* `EzXMLPatched.Document` type: `XMLDocument(version="1.0")`, `HTMLDocument(uri=nothing, externalID=nothing)` +* `EzXMLPatched.Node` type: `XMLDocumentNode(version="1.0")`, `HTMLDocumentNode(uri, externalID)`, `ElementNode(name)`, `TextNode(content)`, `CommentNode(content)`, `CDataNode(content)`, `AttributeNode(name, value)`, `DTDNode(name, [systemID, [externalID]])` Queries: * XPath: `findall(xpath, doc|node)`, `findfirst(xpath, doc|node)`, `findlast(xpath, doc|node)` @@ -150,12 +150,12 @@ Other XML/HTML packages in Julia * [LibExpat.jl](https://github.com/amitmurthy/LibExpat.jl) [docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg -[docs-stable-url]: https://bicycle1885.github.io/EzXML.jl/stable +[docs-stable-url]: https://bicycle1885.github.io/EzXMLPatched.jl/stable [docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg -[docs-latest-url]: https://bicycle1885.github.io/EzXML.jl/latest -[travisci-img]: https://travis-ci.org/bicycle1885/EzXML.jl.svg?branch=master -[travisci-url]: https://travis-ci.org/bicycle1885/EzXML.jl +[docs-latest-url]: https://bicycle1885.github.io/EzXMLPatched.jl/latest +[travisci-img]: https://travis-ci.org/bicycle1885/EzXMLPatched.jl.svg?branch=master +[travisci-url]: https://travis-ci.org/bicycle1885/EzXMLPatched.jl [appveyor-img]: https://ci.appveyor.com/api/projects/status/n5d7o2mmy8ckdjc8?svg=true [appveyor-url]: https://ci.appveyor.com/project/bicycle1885/ezxml-jl -[codecov-img]: http://codecov.io/github/bicycle1885/EzXML.jl/coverage.svg?branch=master -[codecov-url]: http://codecov.io/github/bicycle1885/EzXML.jl?branch=master +[codecov-img]: http://codecov.io/github/bicycle1885/EzXMLPatched.jl/coverage.svg?branch=master +[codecov-url]: http://codecov.io/github/bicycle1885/EzXMLPatched.jl?branch=master diff --git a/docs/Project.toml b/docs/Project.toml index fa6ae82..7136344 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" +EzXMLPatched = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" [compat] Documenter = "~0.24" diff --git a/docs/make.jl b/docs/make.jl index 36bdf37..a1fccf0 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,11 +1,11 @@ using Documenter -using EzXML +using EzXMLPatched makedocs( - sitename="EzXML.jl", - modules=[EzXML], + sitename="EzXMLPatched.jl", + modules=[EzXMLPatched], pages=["index.md", "manual.md", "reference.md", "devnotes.md"]) deploydocs( - repo="github.com/bicycle1885/EzXML.jl.git", + repo="github.com/bicycle1885/EzXMLPatched.jl.git", target="build") diff --git a/docs/setup.jl b/docs/setup.jl index 61aacfa..ff5ee4d 100644 --- a/docs/setup.jl +++ b/docs/setup.jl @@ -1,4 +1,4 @@ using Pkg Pkg.instantiate() Pkg.develop(PackageSpec(path=pwd())) -Pkg.build("EzXML") +Pkg.build("EzXMLPatched") diff --git a/docs/src/devnotes.md b/docs/src/devnotes.md index c710d74..d2c5dee 100644 --- a/docs/src/devnotes.md +++ b/docs/src/devnotes.md @@ -7,7 +7,7 @@ allocated by libxml2. There are several node-like types in libxml2 that have common fields to constitute an XML tree. These fields are always located at the first fields of struct definitions, so we can safely use them by casting a pointer to `_Node`. Especially, the first field, `_private`, is reserved for -applications and EzXML.jl uses it to store a pointer to a `Node` object. That +applications and EzXMLPatched.jl uses it to store a pointer to a `Node` object. That is, a `Node` object points to a node struct and the node struct keeps an opposite pointer to the `Node` object. These bidirectional references are especially important in this package. @@ -33,7 +33,7 @@ after finished freeing nodes, which may result in a segmentation fault. Another important role of keeping owner reference is that it prohibits owner objects from being deallocated by Julia's garbage collecter. -Since the `owner` field is not managed by libxml2, EzXML.jl needs to update the +Since the `owner` field is not managed by libxml2, EzXMLPatched.jl needs to update the field when changing the structure of an XML tree. For example, linking a tree with another tree will lead to an inconsistent situation where descendants nodes reference different owner nodes. `update_owners!` updates the owner node of a diff --git a/docs/src/index.md b/docs/src/index.md index 329b053..e21a913 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,7 +1,7 @@ Home ==== -EzXML.jl is a package for handling XML and HTML documents. The APIs are simple +EzXMLPatched.jl is a package for handling XML and HTML documents. The APIs are simple and consistent, and provide a range of functionalities including: * Reading and writing XML/HTML documents. * Traversing XML/HTML trees with DOM interfaces. @@ -15,7 +15,7 @@ and consistent, and provide a range of functionalities including: Here is an example of parsing and traversing an XML document: ```julia # Load the package. -using EzXML +using EzXMLPatched # Parse an XML string # (use `readxml()` to read a document from a file). diff --git a/docs/src/manual.md b/docs/src/manual.md index 2390b72..a3c5d7c 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -1,21 +1,21 @@ Manual ====== -This page is dedicated to those who are new to EzXML.jl. It is recommended to +This page is dedicated to those who are new to EzXMLPatched.jl. It is recommended to read this page before reading other pages to grasp the concepts of the package first. Once you have read it, [the reference page](reference.md) would be a better place to find necessary functions. [The developer notes page](devnotes.md) is for developers and most users do not need to read it. -In this manual, we use `using EzXML` to load the package for brevity. However, -it is recommended to use `import EzXML` or something similar for non-trivial -scripts or packages because EzXML.jl exports a number of names to your +In this manual, we use `using EzXMLPatched` to load the package for brevity. However, +it is recommended to use `import EzXMLPatched` or something similar for non-trivial +scripts or packages because EzXMLPatched.jl exports a number of names to your environment. These are useful in an interactive session but easily conflict with other names. If you would like to know the list of exported names, please -go to the top of src/EzXML.jl, where you will see a long list of type and +go to the top of src/EzXMLPatched.jl, where you will see a long list of type and function names. -EzXML.jl is built on top of [libxml2](http://xmlsoft.org/), a portable C library +EzXMLPatched.jl is built on top of [libxml2](http://xmlsoft.org/), a portable C library compliant to the XML standard. If you are no familiar with XML itself, the following links offer good resources to learn the basic concents of XML: - [XML Tutorial](https://www.w3schools.com/xml/default.asp) @@ -25,8 +25,8 @@ following links offer good resources to learn the basic concents of XML: ```@meta # Ignore pointers. DocTestFilters = r"@0x[0-9a-f]{16}" -# Load EzXML.jl -DocTestSetup = :(using EzXML) +# Load EzXMLPatched.jl +DocTestSetup = :(using EzXMLPatched) ``` Data types @@ -38,27 +38,27 @@ document. A `Document` object points to the topmost node of the XML document, but note that it is different from the root node you see in an XML file. The `Node` type represents almost everything in an XML document; elements, attributes, texts, CDATAs, comments, documents, etc. are all `Node` type -objects. These two type names are not exported from EzXML.jl because their names +objects. These two type names are not exported from EzXMLPatched.jl because their names are very general and easily conflict with other names exported from other packages. However, the user can expect them as public APIs and use them with -the `EzXML.` prefix. +the `EzXMLPatched.` prefix. Here is an example to create an empty XML document using the `XMLDocument` constructor: ```jldoctest doc -julia> using EzXML +julia> using EzXMLPatched julia> doc = XMLDocument() -EzXML.Document(EzXML.Node()) +EzXMLPatched.Document(EzXMLPatched.Node()) julia> typeof(doc) -EzXML.Document +EzXMLPatched.Document julia> doc.node -EzXML.Node() +EzXMLPatched.Node() julia> typeof(doc.node) -EzXML.Node +EzXMLPatched.Node julia> print(doc) # print an XML-formatted text @@ -72,20 +72,20 @@ The text just before the `@` sign shows the node type (in this example, Let's add a root node to the document and a text node to the root node: ```jldoctest doc julia> elm = ElementNode("root") # create an element node -EzXML.Node() +EzXMLPatched.Node() julia> setroot!(doc, elm) -EzXML.Node() +EzXMLPatched.Node() julia> print(doc) julia> txt = TextNode("some text") # create a text node -EzXML.Node() +EzXMLPatched.Node() julia> link!(elm, txt) -EzXML.Node() +EzXMLPatched.Node() julia> print(doc) @@ -111,7 +111,7 @@ The value of a property will be `nothing` when there is no corresponding value. ```jldoctest julia> elm = ElementNode("element") -EzXML.Node() +EzXMLPatched.Node() julia> println(elm) @@ -144,7 +144,7 @@ julia> println(elm) some text julia> txt = TextNode(" text ") -EzXML.Node() +EzXMLPatched.Node() julia> println(txt) text @@ -167,19 +167,19 @@ julia> txt.content child element to an existing node: ```jldoctest julia> user = ElementNode("User") -EzXML.Node() +EzXMLPatched.Node() julia> println(user) julia> addelement!(user, "id", "167492") -EzXML.Node() +EzXMLPatched.Node() julia> println(user) 167492 julia> addelement!(user, "name", "Kumiko Oumae") -EzXML.Node() +EzXMLPatched.Node() julia> println(user) 167492Kumiko Oumae @@ -218,12 +218,12 @@ Likewise, `parsexml()` parses an XML string or a byte array in memory and builds a document object: ```jldoctest dom julia> doc = readxml("primates.xml") -EzXML.Document(EzXML.Node()) +EzXMLPatched.Document(EzXMLPatched.Node()) julia> data = String(read("primates.xml")); julia> doc = parsexml(data) -EzXML.Document(EzXML.Node()) +EzXMLPatched.Document(EzXMLPatched.Node()) ``` @@ -231,12 +231,12 @@ Before traversing a document we need to get the root of the document tree. The `.root` property returns the root element (if any) of a document: ```jldoctest dom julia> primates = doc.root # get the root element -EzXML.Node() +EzXMLPatched.Node() julia> genus = elements(primates) # `elements` returns all child elements. -2-element Array{EzXML.Node,1}: - EzXML.Node() - EzXML.Node() +2-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() + EzXMLPatched.Node() julia> genus[1].type, genus[1].name (ELEMENT_NODE, "genus") @@ -278,7 +278,7 @@ julia> println(genus[1]) # the "genus" element has been updated In this package, a `Node` object is regarded as a container of its child nodes. This idea is reflected on its property and function names; for example, a property returning the first child node is named as `.firstnode` instead of -`.firstchildnode`. All properties and functions provided by the `EzXML` module +`.firstchildnode`. All properties and functions provided by the `EzXMLPatched` module are named in this way, and the tree traversal API of a node works on its child nodes by default. Properties (functions) with a direction prefix work on that direction; for example, `.nextnode` returns the next sibling node and @@ -294,19 +294,19 @@ indicate a node type the property (function) is interested in. For example, but `.firstelement` always returns the first element node (if any): ```jldoctest dom julia> primates.firstnode -EzXML.Node() +EzXMLPatched.Node() julia> primates.firstelement -EzXML.Node() +EzXMLPatched.Node() julia> primates.firstelement == genus[1] true julia> primates.lastnode -EzXML.Node() +EzXMLPatched.Node() julia> primates.lastelement -EzXML.Node() +EzXMLPatched.Node() julia> primates.lastelement === genus[2] true @@ -350,30 +350,30 @@ and elements, respectively: julia> for node in eachnode(primates) @show node end -node = EzXML.Node() -node = EzXML.Node() -node = EzXML.Node() -node = EzXML.Node() -node = EzXML.Node() +node = EzXMLPatched.Node() +node = EzXMLPatched.Node() +node = EzXMLPatched.Node() +node = EzXMLPatched.Node() +node = EzXMLPatched.Node() julia> for node in eachelement(primates) @show node end -node = EzXML.Node() -node = EzXML.Node() +node = EzXMLPatched.Node() +node = EzXMLPatched.Node() julia> nodes(primates) -5-element Array{EzXML.Node,1}: - EzXML.Node() - EzXML.Node() - EzXML.Node() - EzXML.Node() - EzXML.Node() +5-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() + EzXMLPatched.Node() + EzXMLPatched.Node() + EzXMLPatched.Node() + EzXMLPatched.Node() julia> elements(primates) -2-element Array{EzXML.Node,1}: - EzXML.Node() - EzXML.Node() +2-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() + EzXMLPatched.Node() ``` @@ -388,22 +388,22 @@ The `findall`, `findfirst` and `findlast` functions are overloaded for XPath query and return a vector of selected nodes: ```jldoctest xpath julia> primates = readxml("primates.xml") -EzXML.Document(EzXML.Node()) +EzXMLPatched.Document(EzXMLPatched.Node()) julia> findall("/primates", primates) # Find the "primates" element just under the document -1-element Array{EzXML.Node,1}: - EzXML.Node() +1-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() julia> findall("//genus", primates) -2-element Array{EzXML.Node,1}: - EzXML.Node() - EzXML.Node() +2-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() + EzXMLPatched.Node() julia> findfirst("//genus", primates) -EzXML.Node() +EzXMLPatched.Node() julia> findlast("//genus", primates) -EzXML.Node() +EzXMLPatched.Node() julia> println(findfirst("//genus", primates)) @@ -416,7 +416,7 @@ If you would like to change the starting node of a query, you can pass the node as the second argument of `find*`: ```jldoctest xpath julia> genus = findfirst("//genus", primates) -EzXML.Node() +EzXMLPatched.Node() julia> println(genus) @@ -445,10 +445,10 @@ julia> doc = parsexml(""" """) -EzXML.Document(EzXML.Node()) +EzXMLPatched.Document(EzXMLPatched.Node()) julia> findall("/parent/child", doc.root) # nothing will be found -0-element Array{EzXML.Node,1} +0-element Array{EzXMLPatched.Node,1} julia> namespaces(doc.root) # the default namespace has an empty prefix 1-element Array{Pair{String,String},1}: @@ -458,15 +458,15 @@ julia> ns = namespace(doc.root) # get the namespace "http://www.foobar.org" julia> findall("/x:parent/x:child", doc.root, ["x"=>ns]) # specify its prefix as "x" -1-element Array{EzXML.Node,1}: - EzXML.Node() +1-element Array{EzXMLPatched.Node,1}: + EzXMLPatched.Node() ``` Streaming API ------------- -In addition to the DOM API, EzXML.jl provides a streaming reader of XML files. +In addition to the DOM API, EzXMLPatched.jl provides a streaming reader of XML files. The streaming reader processes, as the name suggests, a stream of XML data by incrementally reading data from a file instead of reading a whole XML tree into the memory. This enables processing extremely large files with limited memory. @@ -491,11 +491,11 @@ undirected graph in the [GraphML](http://graphml.graphdrawing.org/) format The API of a streaming reader is quite different from the DOM API. The first -thing you needs to do is to create an `EzXML.StreamReader` object using the +thing you needs to do is to create an `EzXMLPatched.StreamReader` object using the `open` function: ```jldoctest stream -julia> reader = open(EzXML.StreamReader, "undirected.graphml") -EzXML.StreamReader() +julia> reader = open(EzXMLPatched.StreamReader, "undirected.graphml") +EzXMLPatched.StreamReader() ``` @@ -547,8 +547,8 @@ While reading data, a stream reader provides the following properties: available from the file. When you finished reading data, you need to call `close(reader)` to release allocated resources: ```jldoctest -julia> reader = open(EzXML.StreamReader, "undirected.graphml") -EzXML.StreamReader() +julia> reader = open(EzXMLPatched.StreamReader, "undirected.graphml") +EzXMLPatched.StreamReader() julia> while (item = iterate(reader)) != nothing @show reader.type, reader.name @@ -588,18 +588,18 @@ julia> close(reader) # close the reader The `open(...) do ... end` pattern can be written as: ```jldoctest -julia> open(EzXML.StreamReader, "undirected.graphml") do reader +julia> open(EzXMLPatched.StreamReader, "undirected.graphml") do reader # do something end ``` -EzXML.jl overloads the `Base.iterate` function to make a streaming reader +EzXMLPatched.jl overloads the `Base.iterate` function to make a streaming reader iterable via the `for` loop. Therefore, you can iterate over all components without explicitly calling `iterate` as follows: ```jldoctest -julia> reader = open(EzXML.StreamReader, "undirected.graphml") -EzXML.StreamReader() +julia> reader = open(EzXMLPatched.StreamReader, "undirected.graphml") +EzXMLPatched.StreamReader() julia> for typ in reader @show typ, reader.name diff --git a/docs/src/reference.md b/docs/src/reference.md index b74b2bc..f89b341 100644 --- a/docs/src/reference.md +++ b/docs/src/reference.md @@ -2,17 +2,17 @@ Reference ========= ```@meta -CurrentModule = EzXML +CurrentModule = EzXMLPatched ``` Types ----- ```@docs -EzXML.Document -EzXML.Node -EzXML.StreamReader -EzXML.XMLError +EzXMLPatched.Document +EzXMLPatched.Node +EzXMLPatched.StreamReader +EzXMLPatched.XMLError ``` I/O @@ -47,27 +47,27 @@ Node types | Node type | Integer | | -------------------------- | ------- | -| `EzXML.ELEMENT_NODE` | 1 | -| `EzXML.ATTRIBUTE_NODE` | 2 | -| `EzXML.TEXT_NODE` | 3 | -| `EzXML.CDATA_SECTION_NODE` | 4 | -| `EzXML.ENTITY_REF_NODE` | 5 | -| `EzXML.ENTITY_NODE` | 6 | -| `EzXML.PI_NODE` | 7 | -| `EzXML.COMMENT_NODE` | 8 | -| `EzXML.DOCUMENT_NODE` | 9 | -| `EzXML.DOCUMENT_TYPE_NODE` | 10 | -| `EzXML.DOCUMENT_FRAG_NODE` | 11 | -| `EzXML.NOTATION_NODE` | 12 | -| `EzXML.HTML_DOCUMENT_NODE` | 13 | -| `EzXML.DTD_NODE` | 14 | -| `EzXML.ELEMENT_DECL` | 15 | -| `EzXML.ATTRIBUTE_DECL` | 16 | -| `EzXML.ENTITY_DECL` | 17 | -| `EzXML.NAMESPACE_DECL` | 18 | -| `EzXML.XINCLUDE_START` | 19 | -| `EzXML.XINCLUDE_END` | 20 | -| `EzXML.DOCB_DOCUMENT_NODE` | 21 | +| `EzXMLPatched.ELEMENT_NODE` | 1 | +| `EzXMLPatched.ATTRIBUTE_NODE` | 2 | +| `EzXMLPatched.TEXT_NODE` | 3 | +| `EzXMLPatched.CDATA_SECTION_NODE` | 4 | +| `EzXMLPatched.ENTITY_REF_NODE` | 5 | +| `EzXMLPatched.ENTITY_NODE` | 6 | +| `EzXMLPatched.PI_NODE` | 7 | +| `EzXMLPatched.COMMENT_NODE` | 8 | +| `EzXMLPatched.DOCUMENT_NODE` | 9 | +| `EzXMLPatched.DOCUMENT_TYPE_NODE` | 10 | +| `EzXMLPatched.DOCUMENT_FRAG_NODE` | 11 | +| `EzXMLPatched.NOTATION_NODE` | 12 | +| `EzXMLPatched.HTML_DOCUMENT_NODE` | 13 | +| `EzXMLPatched.DTD_NODE` | 14 | +| `EzXMLPatched.ELEMENT_DECL` | 15 | +| `EzXMLPatched.ATTRIBUTE_DECL` | 16 | +| `EzXMLPatched.ENTITY_DECL` | 17 | +| `EzXMLPatched.NAMESPACE_DECL` | 18 | +| `EzXMLPatched.XINCLUDE_START` | 19 | +| `EzXMLPatched.XINCLUDE_END` | 20 | +| `EzXMLPatched.DOCB_DOCUMENT_NODE` | 21 | Node accessors -------------- @@ -186,24 +186,24 @@ Reader node types | Node type | Integer | | ------------------------------------- | ------- | -| `EzXML.READER_NONE` | 0 | -| `EzXML.READER_ELEMENT` | 1 | -| `EzXML.READER_ATTRIBUTE` | 2 | -| `EzXML.READER_TEXT` | 3 | -| `EzXML.READER_CDATA` | 4 | -| `EzXML.READER_ENTITY_REFERENCE` | 5 | -| `EzXML.READER_ENTITY` | 6 | -| `EzXML.READER_PROCESSING_INSTRUCTION` | 7 | -| `EzXML.READER_COMMENT` | 8 | -| `EzXML.READER_DOCUMENT` | 9 | -| `EzXML.READER_DOCUMENT_TYPE` | 10 | -| `EzXML.READER_DOCUMENT_FRAGMENT` | 11 | -| `EzXML.READER_NOTATION` | 12 | -| `EzXML.READER_WHITESPACE` | 13 | -| `EzXML.READER_SIGNIFICANT_WHITESPACE` | 14 | -| `EzXML.READER_END_ELEMENT` | 15 | -| `EzXML.READER_END_ENTITY` | 16 | -| `EzXML.READER_XML_DECLARATION` | 17 | +| `EzXMLPatched.READER_NONE` | 0 | +| `EzXMLPatched.READER_ELEMENT` | 1 | +| `EzXMLPatched.READER_ATTRIBUTE` | 2 | +| `EzXMLPatched.READER_TEXT` | 3 | +| `EzXMLPatched.READER_CDATA` | 4 | +| `EzXMLPatched.READER_ENTITY_REFERENCE` | 5 | +| `EzXMLPatched.READER_ENTITY` | 6 | +| `EzXMLPatched.READER_PROCESSING_INSTRUCTION` | 7 | +| `EzXMLPatched.READER_COMMENT` | 8 | +| `EzXMLPatched.READER_DOCUMENT` | 9 | +| `EzXMLPatched.READER_DOCUMENT_TYPE` | 10 | +| `EzXMLPatched.READER_DOCUMENT_FRAGMENT` | 11 | +| `EzXMLPatched.READER_NOTATION` | 12 | +| `EzXMLPatched.READER_WHITESPACE` | 13 | +| `EzXMLPatched.READER_SIGNIFICANT_WHITESPACE` | 14 | +| `EzXMLPatched.READER_END_ELEMENT` | 15 | +| `EzXMLPatched.READER_END_ENTITY` | 16 | +| `EzXMLPatched.READER_XML_DECLARATION` | 17 | Streaming reader ---------------- diff --git a/example/julia2xml.jl b/example/julia2xml.jl index 22108a8..e485467 100755 --- a/example/julia2xml.jl +++ b/example/julia2xml.jl @@ -1,6 +1,6 @@ #!/usr/bin/env julia -using EzXML +using EzXMLPatched # Convert a Julia expression to an XML document. function expr2xml(expr) diff --git a/example/listlinks.jl b/example/listlinks.jl index 2c0baaa..0091ed9 100755 --- a/example/listlinks.jl +++ b/example/listlinks.jl @@ -1,6 +1,6 @@ #!/usr/bin/env julia -using EzXML +using EzXMLPatched doc = readhtml(ARGS[1]) # Select links that contain a non-blank text node. diff --git a/example/primates.jl b/example/primates.jl index d268bea..e1a8139 100755 --- a/example/primates.jl +++ b/example/primates.jl @@ -1,6 +1,6 @@ #!/usr/bin/env julia -using EzXML +using EzXMLPatched # Parse an XML string # (use `readxml()` to read a document from a file). diff --git a/src/EzXML.jl b/src/EzXML.jl index 53dbf76..7e8a717 100644 --- a/src/EzXML.jl +++ b/src/EzXML.jl @@ -1,4 +1,4 @@ -module EzXML +module EzXMLPatched export # Types diff --git a/src/node.jl b/src/node.jl index 1fc5e5e..907920d 100644 --- a/src/node.jl +++ b/src/node.jl @@ -242,7 +242,7 @@ Properties | Name | Type | Description | |:---- |:---- |:------------| -| `type` | `EzXML.NodeType` | the type of a node | +| `type` | `EzXMLPatched.NodeType` | the type of a node | | `name` | `String?`| the name of a node| | `path` | `String`| the absolute path to a node | | `content` | `String`| the content of a node | @@ -296,7 +296,7 @@ function ismanaged(node::Node) end function Base.show(io::IO, node::Node) - prefix = "EzXML.Node" + prefix = "EzXMLPatched.Node" ntype = nodetype(node) if ntype ∈ (ELEMENT_NODE, ATTRIBUTE_NODE) && hasnodename(node) desc = string(repr(ntype), '[', nodename(node), ']') diff --git a/src/streamreader.jl b/src/streamreader.jl index 71a28f5..8c6f560 100644 --- a/src/streamreader.jl +++ b/src/streamreader.jl @@ -28,7 +28,7 @@ end end function Base.show(io::IO, reader::StreamReader) - prefix = "EzXML.StreamReader" + prefix = "EzXMLPatched.StreamReader" nodetype_reader = repr(nodetype(reader)) print(io, "$(prefix)(<$(nodetype_reader)>)") end diff --git a/test/runtests.jl b/test/runtests.jl index a21f29f..fab9517 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using EzXML +using EzXMLPatched using Test using Logging: SimpleLogger, with_logger @@ -16,17 +16,17 @@ end @testset "Error" begin for i in 1:21 - t = convert(EzXML.NodeType, i) + t = convert(EzXMLPatched.NodeType, i) @test t == i @test occursin(r"^[A-Z_]+_(NODE|DECL|START|END)$", repr(t)) @test string(t) == string(i) - @test convert(EzXML.NodeType, t) === t + @test convert(EzXMLPatched.NodeType, t) === t end - @test_throws AssertionError repr(convert(EzXML.NodeType, 0)) - @test_throws AssertionError repr(convert(EzXML.NodeType, 100)) + @test_throws AssertionError repr(convert(EzXMLPatched.NodeType, 0)) + @test_throws AssertionError repr(convert(EzXMLPatched.NodeType, 100)) - err = EzXML.XMLError(1, 77, "some parser error", EzXML.XML_ERR_ERROR, 123) - @test isa(err, EzXML.XMLError) + err = EzXMLPatched.XMLError(1, 77, "some parser error", EzXMLPatched.XML_ERR_ERROR, 123) + @test isa(err, EzXMLPatched.XMLError) buf = IOBuffer() showerror(buf, err) @test take!(buf) == b"XMLError: some parser error from XML parser (code: 77, line: 123)" @@ -37,22 +37,22 @@ end valid_file = joinpath(dirname(@__FILE__), "sample1.xml") invalid_file = joinpath(dirname(@__FILE__), "sample1.invalid.xml") doc = readxml(valid_file) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE - @test nodetype(readxml(valid_file).node) === EzXML.DOCUMENT_NODE - @test_throws EzXML.XMLError readxml(invalid_file) + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE + @test nodetype(readxml(valid_file).node) === EzXMLPatched.DOCUMENT_NODE + @test_throws EzXMLPatched.XMLError readxml(invalid_file) @assert !isfile("not-exist.xml") - @test_throws EzXML.XMLError readxml("not-exist.xml") + @test_throws EzXMLPatched.XMLError readxml("not-exist.xml") # from compressed file compressed = joinpath(dirname(@__FILE__), "sample1.xml.gz") - @test isa(readxml(compressed), EzXML.Document) + @test isa(readxml(compressed), EzXMLPatched.Document) # from stream doc = open(readxml, valid_file) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE - @test_throws EzXML.XMLError open(readxml, invalid_file) + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE + @test_throws EzXMLPatched.XMLError open(readxml, invalid_file) # properties doc = readxml(joinpath(dirname(@__FILE__), "sample1.xml")) @@ -70,22 +70,22 @@ end @testset "HTML" begin valid_file = joinpath(dirname(@__FILE__), "sample1.html") doc = readhtml(valid_file) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE - @test nodetype(readhtml(valid_file).node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE + @test nodetype(readhtml(valid_file).node) === EzXMLPatched.HTML_DOCUMENT_NODE @assert !isfile("not-exist.html") - @test_throws EzXML.XMLError readxml("not-exist.html") - @test_throws EzXML.XMLError readhtml("not-exist.html") + @test_throws EzXMLPatched.XMLError readxml("not-exist.html") + @test_throws EzXMLPatched.XMLError readhtml("not-exist.html") # from compressed file compressed = joinpath(dirname(@__FILE__), "sample1.html.gz") - @test isa(readxml(compressed), EzXML.Document) - @test isa(readhtml(compressed), EzXML.Document) + @test isa(readxml(compressed), EzXMLPatched.Document) + @test isa(readhtml(compressed), EzXMLPatched.Document) # from stream (FIXME: this causes "Misplaced DOCTYPE declaration") #doc = open(readhtml, valid_file) - #@test isa(doc, EzXML.Document) - #@test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + #@test isa(doc, EzXMLPatched.Document) + #@test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE buf = IOBuffer(""" hey @@ -93,8 +93,8 @@ end """) doc = readhtml(buf) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE buf = IOBuffer(""" MBGD @@ -106,8 +106,8 @@ end doc, messages = capture_logging_messages() do readhtml(buf) end - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE @test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 2)", messages) @test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 4)", messages) end @@ -139,16 +139,16 @@ end content """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE doc = parsexml(""" content """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE doc = parsexml(b""" @@ -156,12 +156,12 @@ end content """) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE - @test nodetype(parsexml("").node) === EzXML.DOCUMENT_NODE - @test nodetype(parsexml("").node) === EzXML.DOCUMENT_NODE - @test nodetype(parsexml(b"").node) === EzXML.DOCUMENT_NODE - @test nodetype(parsexml(b"").node) === EzXML.DOCUMENT_NODE + @test nodetype(parsexml("").node) === EzXMLPatched.DOCUMENT_NODE + @test nodetype(parsexml("").node) === EzXMLPatched.DOCUMENT_NODE + @test nodetype(parsexml(b"").node) === EzXMLPatched.DOCUMENT_NODE + @test nodetype(parsexml(b"").node) === EzXMLPatched.DOCUMENT_NODE # This includes multi-byte characters. doc = parsexml(""" @@ -173,15 +173,15 @@ end pubmed """) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE @test_throws ArgumentError parsexml("") - @test_throws EzXML.XMLError parsexml(" ") - @test_throws EzXML.XMLError parsexml("abracadabra") - @test_throws EzXML.XMLError parsexml("""""") + @test_throws EzXMLPatched.XMLError parsexml(" ") + @test_throws EzXMLPatched.XMLError parsexml("abracadabra") + @test_throws EzXMLPatched.XMLError parsexml("""""") _, messages = capture_logging_messages() do - @test_throws EzXML.XMLError parsexml("jgo<<<><<") + @test_throws EzXMLPatched.XMLError parsexml("jgo<<<><<") end @test occursin("caught 4 errors; showing the first one", messages) end @@ -198,8 +198,8 @@ end """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE @test hasdtd(doc) @test nodename(dtd(doc)) == "html" @@ -213,8 +213,8 @@ end """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE @test hasdtd(doc) doc = parsehtml(b""" @@ -228,8 +228,8 @@ end """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE doc = parsehtml(""" @@ -238,11 +238,11 @@ end こんにちは、世界! """) - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.HTML_DOCUMENT_NODE - @test nodetype(parsehtml("").node) === EzXML.HTML_DOCUMENT_NODE - @test nodetype(parsehtml(b"").node) === EzXML.HTML_DOCUMENT_NODE + @test nodetype(parsehtml("").node) === EzXMLPatched.HTML_DOCUMENT_NODE + @test nodetype(parsehtml(b"").node) === EzXMLPatched.HTML_DOCUMENT_NODE @test_throws ArgumentError parsehtml("") end @@ -250,18 +250,18 @@ end @testset "Stream Reader" begin for i in 0:17 - t = convert(EzXML.ReaderType, i) + t = convert(EzXMLPatched.ReaderType, i) @test t == i @test occursin(r"READER_[A-Z_]+$", repr(t)) @test string(t) == string(i) - @test convert(EzXML.ReaderType, t) === t + @test convert(EzXMLPatched.ReaderType, t) === t end - @test_throws AssertionError repr(convert(EzXML.ReaderType, -1)) - @test_throws AssertionError repr(convert(EzXML.ReaderType, 18)) + @test_throws AssertionError repr(convert(EzXMLPatched.ReaderType, -1)) + @test_throws AssertionError repr(convert(EzXMLPatched.ReaderType, 18)) sample2 = joinpath(dirname(@__FILE__), "sample2.xml") - reader = open(EzXML.StreamReader, sample2) - @test isa(reader, EzXML.StreamReader) + reader = open(EzXMLPatched.StreamReader, sample2) + @test isa(reader, EzXMLPatched.StreamReader) typs = [] names = [] depths = [] @@ -271,14 +271,14 @@ end push!(typs, typ) push!(names, nodename(reader)) push!(depths, nodedepth(reader)) - if typ == EzXML.READER_ELEMENT && nodename(reader) == "elm" + if typ == EzXMLPatched.READER_ELEMENT && nodename(reader) == "elm" push!(contents, nodecontent(reader)) push!(attributes, reader["attr1"]) end - @test isa(expandtree(reader), EzXML.Node) + @test isa(expandtree(reader), EzXMLPatched.Node) end - @test typs[1] === EzXML.READER_ELEMENT - @test typs[2] === EzXML.READER_SIGNIFICANT_WHITESPACE + @test typs[1] === EzXMLPatched.READER_ELEMENT + @test typs[2] === EzXMLPatched.READER_SIGNIFICANT_WHITESPACE @test names[1] == "root" @test names[3] == "elm" @test depths[1] === 0 @@ -288,53 +288,53 @@ end @test contents[2] == "some content 2" @test attributes[1] == "attr1 value 1" @test attributes[2] == "attr1 value 2" - @test open(collect, EzXML.StreamReader, sample2) == typs + @test open(collect, EzXMLPatched.StreamReader, sample2) == typs simple_graphml = joinpath(dirname(@__FILE__), "simple.graphml") - reader = open(EzXML.StreamReader, simple_graphml) - @test isa(reader, EzXML.StreamReader) + reader = open(EzXMLPatched.StreamReader, simple_graphml) + @test isa(reader, EzXMLPatched.StreamReader) typs = [] names = [] namespaces = [] for typ in reader push!(typs, typ) push!(names, nodename(reader)) - if typ == EzXML.READER_ELEMENT + if typ == EzXMLPatched.READER_ELEMENT push!(namespaces, namespace(reader)) end - @test isa(expandtree(reader), EzXML.Node) + @test isa(expandtree(reader), EzXMLPatched.Node) end - @test first(typs) === EzXML.READER_COMMENT + @test first(typs) === EzXMLPatched.READER_COMMENT @test first(names) == "#comment" - @test last(typs) === EzXML.READER_END_ELEMENT + @test last(typs) === EzXMLPatched.READER_END_ELEMENT @test last(names) == "graphml" @test first(namespaces) == "http://graphml.graphdrawing.org/xmlns" @test close(reader) === nothing - reader = open(EzXML.StreamReader, simple_graphml) + reader = open(EzXMLPatched.StreamReader, simple_graphml) typs = [] names = [] for typ in reader push!(typs, typ) push!(names, nodename(reader)) end - @test first(typs) === EzXML.READER_COMMENT + @test first(typs) === EzXMLPatched.READER_COMMENT @test first(names) == "#comment" - @test last(typs) === EzXML.READER_END_ELEMENT + @test last(typs) === EzXMLPatched.READER_END_ELEMENT @test last(names) == "graphml" @test close(reader) === nothing input = open(simple_graphml) - reader = EzXML.StreamReader(input) + reader = EzXMLPatched.StreamReader(input) typs = [] names = [] for typ in reader push!(typs, typ) push!(names, nodename(reader)) end - @test first(typs) === EzXML.READER_COMMENT + @test first(typs) === EzXMLPatched.READER_COMMENT @test first(names) == "#comment" - @test last(typs) === EzXML.READER_END_ELEMENT + @test last(typs) === EzXMLPatched.READER_END_ELEMENT @test last(names) == "graphml" @test isopen(input) @test close(reader) === nothing @@ -343,9 +343,9 @@ end input = IOBuffer(""" """) - reader = EzXML.StreamReader(input) + reader = EzXMLPatched.StreamReader(input) for typ in reader - if typ == EzXML.READER_ELEMENT + if typ == EzXMLPatched.READER_ELEMENT @test haskey(reader, "foo") @test !haskey(reader, "bar") @test reader["foo"] == "FOO" @@ -360,18 +360,18 @@ end """) names = String[] - reader = EzXML.StreamReader(input) + reader = EzXMLPatched.StreamReader(input) for typ in reader @test reader.:type === typ push!(names, reader.name) - if reader.name == "head" && reader.:type == EzXML.READER_ELEMENT + if reader.name == "head" && reader.:type == EzXMLPatched.READER_ELEMENT @test reader.depth == 1 @test reader.namespace == "http://www.w3.org/1999/xhtml" - elseif reader.name == "title" && reader.:type == EzXML.READER_ELEMENT + elseif reader.name == "title" && reader.:type == EzXMLPatched.READER_ELEMENT @test reader.depth == 2 @test reader.content == "Hey" @test reader.namespace == "http://www.w3.org/1999/xhtml" - elseif reader.:type == EzXML.READER_END_ELEMENT + elseif reader.:type == EzXMLPatched.READER_END_ELEMENT @test !hasnodecontent(reader) @test reader.content === nothing end @@ -379,28 +379,28 @@ end @test "head" ∈ names @test "title" ∈ names - @test_throws EzXML.XMLError iterate(EzXML.StreamReader(IOBuffer("not xml"))) + @test_throws EzXMLPatched.XMLError iterate(EzXMLPatched.StreamReader(IOBuffer("not xml"))) # memory management test for _ in 1:10 - reader = EzXML.StreamReader(IOBuffer("")) + reader = EzXMLPatched.StreamReader(IOBuffer("")) for typ in reader - if typ == EzXML.READER_ELEMENT && EzXML.nodename(reader) == "a" - a = EzXML.expandtree(reader) - b = EzXML.firstelement(a) + if typ == EzXMLPatched.READER_ELEMENT && EzXMLPatched.nodename(reader) == "a" + a = EzXMLPatched.expandtree(reader) + b = EzXMLPatched.firstelement(a) end end close(reader) end @test true - reader = EzXML.StreamReader(IOBuffer(""" + reader = EzXMLPatched.StreamReader(IOBuffer(""" """)) for typ in reader - if typ == EzXML.READER_ELEMENT + if typ == EzXMLPatched.READER_ELEMENT if nodename(reader) == "a" @test !hasnodevalue(reader) @test_throws ArgumentError nodevalue(reader) @@ -427,7 +427,7 @@ end @test nodeattributes(reader) == Dict{String,String}() @test countattributes(reader) == 0 end - elseif typ == EzXML.READER_END_ELEMENT + elseif typ == EzXMLPatched.READER_END_ELEMENT @test_throws ArgumentError eachattribute(reader) end end @@ -436,20 +436,20 @@ end # memory management test (XPath) # FIXME: support XPath #for _ in 1:10 - # reader = EzXML.StreamReader(IOBuffer("")) + # reader = EzXMLPatched.StreamReader(IOBuffer("")) # for typ in reader - # if typ == EzXML.READER_ELEMENT && EzXML.nodename(reader) == "a" - # a = EzXML.expandtree(reader) + # if typ == EzXMLPatched.READER_ELEMENT && EzXMLPatched.nodename(reader) == "a" + # a = EzXMLPatched.expandtree(reader) # b = findall("//b[1]", a) # end # end # close(reader) #end #@test true - reader = EzXML.StreamReader(IOBuffer("")) + reader = EzXMLPatched.StreamReader(IOBuffer("")) for typ in reader - if typ == EzXML.READER_ELEMENT && EzXML.nodename(reader) == "a" - a = EzXML.expandtree(reader) + if typ == EzXMLPatched.READER_ELEMENT && EzXMLPatched.nodename(reader) == "a" + a = EzXMLPatched.expandtree(reader) @test_throws ArgumentError findall("//b[1]", a, String[]) end end @@ -458,111 +458,111 @@ end # TODO: Activate this test. #@assert !isfile("not-exist.xml") - #@test_throws EzXML.XMLError open(EzXML.StreamReader, "not-exist.xml") + #@test_throws EzXMLPatched.XMLError open(EzXMLPatched.StreamReader, "not-exist.xml") end @testset "Constructors" begin n = XMLDocumentNode("1.0") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.DOCUMENT_NODE - @test document(n) === EzXML.Document(n.ptr) + @test nodetype(n) === EzXMLPatched.DOCUMENT_NODE + @test document(n) === EzXMLPatched.Document(n.ptr) n = HTMLDocumentNode(nothing, nothing) - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.HTML_DOCUMENT_NODE - @test document(n) === EzXML.Document(n.ptr) + @test nodetype(n) === EzXMLPatched.HTML_DOCUMENT_NODE + @test document(n) === EzXMLPatched.Document(n.ptr) n = HTMLDocumentNode("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", "-//W3C//DTD XHTML 1.0 Strict//EN") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.HTML_DOCUMENT_NODE - @test document(n) === EzXML.Document(n.ptr) + @test nodetype(n) === EzXMLPatched.HTML_DOCUMENT_NODE + @test document(n) === EzXMLPatched.Document(n.ptr) n = ElementNode("node") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.ELEMENT_NODE + @test nodetype(n) === EzXMLPatched.ELEMENT_NODE @test iselement(n) @test_throws ArgumentError document(n) n = TextNode("some text") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.TEXT_NODE + @test nodetype(n) === EzXMLPatched.TEXT_NODE @test istext(n) @test_throws ArgumentError document(n) n = CommentNode("some comment") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.COMMENT_NODE + @test nodetype(n) === EzXMLPatched.COMMENT_NODE @test iscomment(n) @test_throws ArgumentError document(n) n = CDataNode("some CDATA") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) === EzXML.CDATA_SECTION_NODE + @test nodetype(n) === EzXMLPatched.CDATA_SECTION_NODE @test iscdata(n) @test_throws ArgumentError document(n) n = AttributeNode("attr", "value") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test n.owner == n - @test nodetype(n) == EzXML.ATTRIBUTE_NODE + @test nodetype(n) == EzXMLPatched.ATTRIBUTE_NODE @test isattribute(n) @test_throws ArgumentError document(n) n = DTDNode("open-hatch") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test isdtd(n) @test n.owner === n - @test nodetype(n) === EzXML.DTD_NODE + @test nodetype(n) === EzXMLPatched.DTD_NODE @test nodename(n) == "open-hatch" @test_throws ArgumentError systemID(n) @test_throws ArgumentError externalID(n) n = DTDNode("open-hatch", "http://www.textuality.com/boilerplate/OpenHatch.xml") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test isdtd(n) @test n.owner === n - @test nodetype(n) === EzXML.DTD_NODE + @test nodetype(n) === EzXMLPatched.DTD_NODE @test systemID(n) == "http://www.textuality.com/boilerplate/OpenHatch.xml" @test_throws ArgumentError externalID(n) n = DTDNode("open-hatch", "http://www.textuality.com/boilerplate/OpenHatch.xml", "-//Textuality//TEXT Standard open-hatch boilerplate//EN") - @test isa(n, EzXML.Node) + @test isa(n, EzXMLPatched.Node) @test isdtd(n) @test n.owner === n - @test nodetype(n) === EzXML.DTD_NODE + @test nodetype(n) === EzXMLPatched.DTD_NODE @test systemID(n) == "http://www.textuality.com/boilerplate/OpenHatch.xml" @test externalID(n) == "-//Textuality//TEXT Standard open-hatch boilerplate//EN" doc = XMLDocument() - @test isa(doc, EzXML.Document) + @test isa(doc, EzXMLPatched.Document) @test doc.node.owner === doc.node - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE @test !hasroot(doc) @test_throws ArgumentError root(doc) doc = HTMLDocument() - @test isa(doc, EzXML.Document) + @test isa(doc, EzXMLPatched.Document) @test doc.node.owner === doc.node - @test nodetype(doc.node) == EzXML.HTML_DOCUMENT_NODE + @test nodetype(doc.node) == EzXMLPatched.HTML_DOCUMENT_NODE @test !hasroot(doc) @test_throws ArgumentError root(doc) doc = HTMLDocument("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", "-//W3C//DTD XHTML 1.0 Strict//EN") - @test isa(doc, EzXML.Document) + @test isa(doc, EzXMLPatched.Document) @test doc.node.owner === doc.node - @test nodetype(doc.node) == EzXML.HTML_DOCUMENT_NODE + @test nodetype(doc.node) == EzXMLPatched.HTML_DOCUMENT_NODE @test !hasroot(doc) @test_throws ArgumentError root(doc) end @@ -571,11 +571,11 @@ end doc = parsexml("") @test hasroot(doc) @test !hasdtd(doc) - @test isa(root(doc), EzXML.Node) + @test isa(root(doc), EzXMLPatched.Node) @test root(doc) == root(doc) @test root(doc) === root(doc) @test hash(root(doc)) === hash(root(doc)) - @test nodetype(root(doc)) === EzXML.ELEMENT_NODE + @test nodetype(root(doc)) === EzXMLPatched.ELEMENT_NODE @test nodepath(root(doc)) == "/root" @test nodename(root(doc)) == "root" @test nodecontent(root(doc)) == "" @@ -599,7 +599,7 @@ end """) @test hasroot(doc) @test hasdtd(doc) - @test isa(dtd(doc), EzXML.Node) + @test isa(dtd(doc), EzXMLPatched.Node) @test isdtd(dtd(doc)) @test dtd(doc) === dtd(doc) @test nodename(dtd(doc)) == "html" @@ -618,17 +618,17 @@ end """) r = root(doc) - @test nodetype(firstnode(r)) === EzXML.TEXT_NODE - @test nodetype(lastnode(r)) === EzXML.TEXT_NODE - @test nodetype(firstelement(r)) === EzXML.ELEMENT_NODE + @test nodetype(firstnode(r)) === EzXMLPatched.TEXT_NODE + @test nodetype(lastnode(r)) === EzXMLPatched.TEXT_NODE + @test nodetype(firstelement(r)) === EzXMLPatched.ELEMENT_NODE @test nodename(firstelement(r)) == "c1" - @test nodetype(lastelement(r)) === EzXML.ELEMENT_NODE + @test nodetype(lastelement(r)) === EzXMLPatched.ELEMENT_NODE @test nodename(lastelement(r)) == "c3" c1 = firstelement(r) @test hasnextnode(c1) @test hasprevnode(c1) - @test nodetype(nextnode(c1)) === EzXML.TEXT_NODE - @test nodetype(prevnode(c1)) === EzXML.TEXT_NODE + @test nodetype(nextnode(c1)) === EzXMLPatched.TEXT_NODE + @test nodetype(prevnode(c1)) === EzXMLPatched.TEXT_NODE @test hasnextelement(c1) @test !hasprevelement(c1) c2 = nextelement(c1) @@ -803,16 +803,16 @@ end @testset "Iterators" begin doc = parsexml("") - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachnode(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 0 @test nodes(root(doc)) == ns - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachelement(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 0 @@ -821,16 +821,16 @@ end doc = parsexml(""" """) - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachnode(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 2 @test nodes(root(doc)) == ns - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachelement(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 2 @@ -842,16 +842,16 @@ end """) - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachnode(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 5 @test nodes(root(doc)) == ns - ns = EzXML.Node[] + ns = EzXMLPatched.Node[] for (i, node) in enumerate(eachelement(root(doc))) - @test isa(node, EzXML.Node) + @test isa(node, EzXMLPatched.Node) push!(ns, node) end @test length(ns) == 2 @@ -893,14 +893,14 @@ end @test doc.encoding == "UTF-8" doc = parsexml("") - @test doc.node isa EzXML.Node - @test doc.node.type === EzXML.DOCUMENT_NODE + @test doc.node isa EzXMLPatched.Node + @test doc.node.type === EzXMLPatched.DOCUMENT_NODE @test doc.node.name === nothing @test doc.node.path == "/" @test doc.node.content == "" @test doc.node.namespace === nothing - @test doc.root isa EzXML.Node - @test doc.root.type === EzXML.ELEMENT_NODE + @test doc.root isa EzXMLPatched.Node + @test doc.root.type === EzXMLPatched.ELEMENT_NODE @test doc.root.name == "root" @test doc.root.path == "/root" @test doc.root.content == "" @@ -910,7 +910,7 @@ end doc = parsexml("""some content""") @test doc.root.content == "some content" attr = attributes(doc.root)[1] - @test attr.type === EzXML.ATTRIBUTE_NODE + @test attr.type === EzXMLPatched.ATTRIBUTE_NODE @test attr.name == "attr" @test attr.path == "/root/@attr" @test attr.content == "100" @@ -938,8 +938,8 @@ end @test doc.root.document === doc @test doc.root.parentnode === doc.node @test doc.root.parentelement === nothing - @test doc.root.firstnode.type === EzXML.TEXT_NODE - @test doc.root.lastnode.type === EzXML.TEXT_NODE + @test doc.root.firstnode.type === EzXMLPatched.TEXT_NODE + @test doc.root.lastnode.type === EzXMLPatched.TEXT_NODE @test doc.root.firstelement.name == "c1" @test doc.root.lastelement.name == "c3" @test doc.root.firstnode.nextnode === doc.root.firstelement @@ -964,8 +964,8 @@ end @testset "Construction" begin doc = XMLDocument() - @test isa(doc, EzXML.Document) - @test nodetype(doc.node) === EzXML.DOCUMENT_NODE + @test isa(doc, EzXMLPatched.Document) + @test nodetype(doc.node) === EzXMLPatched.DOCUMENT_NODE @test !hasroot(doc) @test_throws ArgumentError root(doc) r1 = ElementNode("r1") @@ -1259,7 +1259,7 @@ end @test findfirst("//bar", doc) === findall("//bar", doc)[1] @test findlast("//bar", doc) === findall("//bar", doc)[3] @test length(findall("/baz", doc)) == 0 - @test_throws EzXML.XMLError findall("//bar!", doc) + @test_throws EzXMLPatched.XMLError findall("//bar!", doc) @test findall("foo", root(doc)) == findall("//foo", doc) @test findfirst("foo", root(doc)) === findfirst("//foo", doc) @test findlast("foo", root(doc)) === findlast("//foo", doc) @@ -1301,14 +1301,14 @@ end @testset "Misc" begin @testset "show" begin doc = parsexml("""""") - @test occursin(r"^EzXML.Node\(\)$", repr(doc.node)) - @test occursin(r"^EzXML.Node\(\)$", repr(root(doc))) - @test occursin(r"^EzXML.Node\(\)$", repr(attributes(root(doc))[1])) - @test occursin(r"^EzXML.Document\(EzXML.Node\(\)\)$", repr(doc)) + @test occursin(r"^EzXMLPatched.Node\(\)$", repr(doc.node)) + @test occursin(r"^EzXMLPatched.Node\(\)$", repr(root(doc))) + @test occursin(r"^EzXMLPatched.Node\(\)$", repr(attributes(root(doc))[1])) + @test occursin(r"^EzXMLPatched.Document\(EzXMLPatched.Node\(\)\)$", repr(doc)) sample2 = joinpath(dirname(@__FILE__), "sample2.xml") - reader = open(EzXML.StreamReader, sample2) - @test occursin(r"^EzXML.StreamReader\(<[A-Z_]+>\)$", repr(reader)) + reader = open(EzXMLPatched.StreamReader, sample2) + @test occursin(r"^EzXMLPatched.StreamReader\(<[A-Z_]+>\)$", repr(reader)) close(reader) end @@ -1346,7 +1346,7 @@ end end # Check no uncaught errors. -@test isempty(EzXML.XML_GLOBAL_ERROR_STACK) +@test isempty(EzXMLPatched.XML_GLOBAL_ERROR_STACK) if Sys.isunix() julia = joinpath(Sys.BINDIR, "julia") From 43a9fe76559093a5390cfb2fcf681892d214cfe2 Mon Sep 17 00:00:00 2001 From: aminya Date: Sat, 29 Feb 2020 17:35:37 -0600 Subject: [PATCH 2/9] using Github Actions --- .appveyor.yml | 40 ------------------------------- .github/CompatHelper.yml | 27 +++++++++++++++++++++ .github/TagBot.yml | 10 ++++++++ .github/ci.yml | 28 ++++++++++++++++++++++ .github/docs.yml | 30 +++++++++++++++++++++++ .travis.yml | 26 -------------------- README.md | 3 +-- src/{EzXML.jl => EzXMLPatched.jl} | 0 8 files changed, 96 insertions(+), 68 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/CompatHelper.yml create mode 100644 .github/TagBot.yml create mode 100644 .github/ci.yml create mode 100644 .github/docs.yml delete mode 100644 .travis.yml rename src/{EzXML.jl => EzXMLPatched.jl} (100%) diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index e54175c..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -environment: - matrix: - - julia_version: 1.3 - - julia_version: latest - -matrix: - allow_failures: - - julia_version: latest - -platform: - - x86 # 32-bit - - x64 # 64-bit - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" diff --git a/.github/CompatHelper.yml b/.github/CompatHelper.yml new file mode 100644 index 0000000..7c17290 --- /dev/null +++ b/.github/CompatHelper.yml @@ -0,0 +1,27 @@ +name: CompatHelper + +on: + schedule: + - cron: '0 1 * * *' + issues: + types: [opened, reopened] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.3.1] + julia-arch: [x64] + os: [ubuntu-latest] + steps: + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + - name: Install dependencies + run: julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name = "CompatHelper", url = "https://github.com/bcbi/CompatHelper.jl.git"))' + - name: CompatHelper.main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JULIA_DEBUG: CompatHelper + run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/TagBot.yml b/.github/TagBot.yml new file mode 100644 index 0000000..00a23c4 --- /dev/null +++ b/.github/TagBot.yml @@ -0,0 +1,10 @@ +name: TagBot +on: + create +jobs: + TagBot: + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 0000000..10992ce --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,28 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.3' + - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-runtest@latest diff --git a/.github/docs.yml b/.github/docs.yml new file mode 100644 index 0000000..9082fe9 --- /dev/null +++ b/.github/docs.yml @@ -0,0 +1,30 @@ +name: Documentation + +on: + push: + branches: + - 'master' + - 'release-' + tags: '*' + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.3.1] + julia-arch: [x64] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + - name: Install dependencies + run: julia --project=docs -e 'using Pkg; Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --project=docs --color=yes docs/make.jl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 651d016..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Documentation: https://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux - - osx -julia: - - 1.3 - - nightly -matrix: - allow_failures: - - julia: nightly -env: - - JULIA_PROJECT="@." -notifications: - email: false -after_success: - - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' -jobs: - include: - - stage: "Documentation" - julia: 1.3 - os: linux - script: - - julia --project=docs/ docs/setup.jl - - julia --project=docs/ docs/make.jl - after_success: skip diff --git a/README.md b/README.md index 711df87..95bea79 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ EzXMLPatched.jl - XML/HTML tools for primates [![Docs Stable][docs-stable-img]][docs-stable-url] [![Docs Latest][docs-latest-img]][docs-latest-url] -[![TravisCI Status][travisci-img]][travisci-url] -[![Appveyor Status][appveyor-img]][appveyor-url] +![Build Status (Github Actions)](https://github.com/aminya/EzXMLPatched.jl/workflows/CI/badge.svg) [![codecov.io][codecov-img]][codecov-url] EzXMLPatched.jl is a package to handle XML/HTML documents for primates. diff --git a/src/EzXML.jl b/src/EzXMLPatched.jl similarity index 100% rename from src/EzXML.jl rename to src/EzXMLPatched.jl From fc6b8c46e695bf5bb7e9d25d9583b9e8866374d4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 29 Feb 2020 17:36:29 -0600 Subject: [PATCH 3/9] temp 1.0.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5b9ae14..7685349 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "EzXMLPatched" uuid = "ebbc4602-91c8-4f2e-9b89-acc792d9cec0" authors = ["Kenta Sato "] -version = "1.1.0" +version = "1.0.0" [deps] XML2_jll = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" From 5a8cf926e931d273a3ac5cf4a37c9e2dec8dcb17 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 29 Feb 2020 23:15:05 -0600 Subject: [PATCH 4/9] Delete CompatHelper.yml --- .github/CompatHelper.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/CompatHelper.yml diff --git a/.github/CompatHelper.yml b/.github/CompatHelper.yml deleted file mode 100644 index 7c17290..0000000 --- a/.github/CompatHelper.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: CompatHelper - -on: - schedule: - - cron: '0 1 * * *' - issues: - types: [opened, reopened] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.3.1] - julia-arch: [x64] - os: [ubuntu-latest] - steps: - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.julia-version }} - - name: Install dependencies - run: julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name = "CompatHelper", url = "https://github.com/bcbi/CompatHelper.jl.git"))' - - name: CompatHelper.main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JULIA_DEBUG: CompatHelper - run: julia -e 'using CompatHelper; CompatHelper.main()' From 7c0f313ca51386e5147ec0ddec62306ed3747d33 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 29 Feb 2020 23:15:17 -0600 Subject: [PATCH 5/9] Delete TagBot.yml --- .github/TagBot.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .github/TagBot.yml diff --git a/.github/TagBot.yml b/.github/TagBot.yml deleted file mode 100644 index 00a23c4..0000000 --- a/.github/TagBot.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: TagBot -on: - create -jobs: - TagBot: - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} From e7eb7e59fe2e4cb1e85b7794dff2505c479da047 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 29 Feb 2020 23:15:29 -0600 Subject: [PATCH 6/9] Delete ci.yml --- .github/ci.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/ci.yml diff --git a/.github/ci.yml b/.github/ci.yml deleted file mode 100644 index 10992ce..0000000 --- a/.github/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: CI -on: - - push - - pull_request -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - version: - - '1.3' - - 'nightly' - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest From 7f651247b405160675c64b5b9f872fa58cb6d406 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 29 Feb 2020 23:15:41 -0600 Subject: [PATCH 7/9] Delete docs.yml --- .github/docs.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .github/docs.yml diff --git a/.github/docs.yml b/.github/docs.yml deleted file mode 100644 index 9082fe9..0000000 --- a/.github/docs.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Documentation - -on: - push: - branches: - - 'master' - - 'release-' - tags: '*' - pull_request: - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.3.1] - julia-arch: [x64] - os: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.julia-version }} - - name: Install dependencies - run: julia --project=docs -e 'using Pkg; Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs --color=yes docs/make.jl From a8ba3684376ca0b47205ce2358823b047446a9b4 Mon Sep 17 00:00:00 2001 From: aminya Date: Sat, 29 Feb 2020 23:16:18 -0600 Subject: [PATCH 8/9] move to workflows folder --- .github/workflows/CompatHelper.yml | 27 +++++++++++++++++++++++++++ .github/workflows/TagBot.yml | 10 ++++++++++ .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/docs.yml | 30 ++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 .github/workflows/CompatHelper.yml create mode 100644 .github/workflows/TagBot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 0000000..7c17290 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,27 @@ +name: CompatHelper + +on: + schedule: + - cron: '0 1 * * *' + issues: + types: [opened, reopened] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.3.1] + julia-arch: [x64] + os: [ubuntu-latest] + steps: + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + - name: Install dependencies + run: julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name = "CompatHelper", url = "https://github.com/bcbi/CompatHelper.jl.git"))' + - name: CompatHelper.main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JULIA_DEBUG: CompatHelper + run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 0000000..00a23c4 --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,10 @@ +name: TagBot +on: + create +jobs: + TagBot: + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..10992ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.3' + - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-runtest@latest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..9082fe9 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,30 @@ +name: Documentation + +on: + push: + branches: + - 'master' + - 'release-' + tags: '*' + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.3.1] + julia-arch: [x64] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + - name: Install dependencies + run: julia --project=docs -e 'using Pkg; Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --project=docs --color=yes docs/make.jl From 9965f7ca5d282a44e4f1a675fcb2241afc2558a1 Mon Sep 17 00:00:00 2001 From: aminya Date: Sat, 29 Feb 2020 23:24:32 -0600 Subject: [PATCH 9/9] Update docs UUID --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 7136344..36ce090 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -EzXMLPatched = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" +EzXMLPatched = "ebbc4602-91c8-4f2e-9b89-acc792d9cec0" [compat] Documenter = "~0.24"