Skip to content

Commit

Permalink
Split uri and uri-sexp
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow authored and dinosaure committed May 16, 2019
1 parent 66c82f8 commit 9a7daf1
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 20 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
global:
- PACKAGE="uri"
- POST_INSTALL_HOOK="opam --yes depext -yui react ssl lwt"
- PINS="uri-sexp:."
- REVDEPS="cohttp git github irmin syndic"
matrix:
- DISTRO=centos OCAML_VERSION=4.04
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.2.1 -
--------

* Move `Uri_sexp` to its own package `uri-sexp`. (#134 @Julow)

v2.2.0 2019-01-31
-----------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Once installed, there are three ocamlfind packages available for your use:

- `uri` - the base `Uri` module
- `uri.top` - the toplevel printers for use with [utop](https://github.com/diml/utop)
- `uri.sexp` - provides converters to and from s-expressions (via a `Uri_sexp.t` type alias)
- `uri-sexp` - provides converters to and from s-expressions (via a `Uri_sexp.t` type alias)
- `uri.services` - the `Uri_services` module that provides the equivalent of *[services(5)](http://man7.org/linux/man-pages/man5/services.5.html)*
- `uri.services_full` - the `Uri_services_full` module that provides a complete copy of the `/etc/services` file. This is quite large and normally not needed.

Expand Down
28 changes: 14 additions & 14 deletions lib/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(library
(name uri)
(public_name uri)
(wrapped (transition "Please switch to using Uri.Re instead of Uri_re"))
(modules uri uri_re)
(libraries re.posix stringext))
(name uri)
(public_name uri)
(wrapped (transition "Please switch to using Uri.Re instead of Uri_re"))
(modules uri uri_re)
(libraries re.posix stringext))

(library
(name uri_sexp)
(public_name uri.sexp)
(modules uri_sexp)
(preprocess (pps ppx_sexp_conv))
(libraries sexplib0 uri))
(name uri_sexp)
(public_name uri-sexp)
(modules uri_sexp)
(preprocess (pps ppx_sexp_conv))
(libraries sexplib0 uri))

(library
(name uri_top)
(public_name uri.top)
(modules uri_top)
(libraries uri compiler-libs))
(name uri_top)
(public_name uri.top)
(modules uri_top)
(libraries uri compiler-libs))
4 changes: 2 additions & 2 deletions lib/uri.ml
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ let of_string s =
* into a Pct.encoded and return an optional type (None if
* the component is not present in the Uri *)
let get_opt_encoded s n =
try Some (Pct.cast_encoded (Re.get s n))
try Some (Pct.cast_encoded (Re.Group.get s n))
with Not_found -> None
in
let get_opt s n =
try
let pct = Pct.cast_encoded (Re.get s n) in
let pct = Pct.cast_encoded (Re.Group.get s n) in
Some (Pct.decode pct)
with Not_found -> None
in
Expand Down
6 changes: 5 additions & 1 deletion lib_test/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(executables
(names test_runner)
(libraries uri uri.sexp uri_services oUnit sexplib0))
(modules test_runner uri_sexp)
(preprocess (pps ppx_sexp_conv))
(libraries uri uri_services oUnit sexplib0))

(rule (copy# ../lib/uri_sexp.ml uri_sexp.ml))

(alias
(name runtest)
Expand Down
24 changes: 24 additions & 0 deletions uri-sexp.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "David Sheets" "Rudi Grinberg"]
license: "ISC"
tags: ["url" "uri" "org:mirage" "org:xapi-project"]
homepage: "https://github.com/mirage/ocaml-uri"
bug-reports: "https://github.com/mirage/ocaml-uri/issues"
dev-repo: "git+https://github.com/mirage/ocaml-uri.git"
doc: "https://mirage.github.io/ocaml-uri/"
synopsis: "An RFC3986 URI/URL parsing library"
description: """
ocaml-uri with sexp support
"""
depends: [
"uri"
"dune" {build & >= "1.2.0"}
"ppx_sexp_conv" {build & >= "v0.9.0"}
"sexplib0"
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
3 changes: 1 addition & 2 deletions uri.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ depends: [
"ocaml" {>= "4.04.0"}
"dune" {build & >= "1.2.0"}
"ounit" {with-test & >= "1.0.2"}
"ppx_sexp_conv" {build & >= "v0.9.0"}
"ppx_sexp_conv" {with-test & >= "v0.9.0"}
"re" {>= "1.7.2"}
"sexplib0"
"stringext" {>= "1.4.0"}
]
build: [
Expand Down

0 comments on commit 9a7daf1

Please sign in to comment.