summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/echo/echo.md11
-rw-r--r--examples/echo/echo.subplot10
-rw-r--r--examples/muck/muck.md36
-rw-r--r--examples/muck/muck.subplot12
-rw-r--r--examples/muck/muck.yaml18
-rw-r--r--examples/seq/Cargo.toml4
-rw-r--r--examples/seq/seq-extras.rs6
-rw-r--r--examples/website/website.md12
-rw-r--r--examples/website/website.subplot10
9 files changed, 67 insertions, 52 deletions
diff --git a/examples/echo/echo.md b/examples/echo/echo.md
index 495a102..8849b4b 100644
--- a/examples/echo/echo.md
+++ b/examples/echo/echo.md
@@ -1,14 +1,3 @@
----
-title: "**echo**(1) acceptance tests"
-author: The Subplot project
-bindings: [echo.yaml]
-impls:
- bash: [echo.sh]
-...
-
-FIXME: This needs to move back into YAML: bibliography: [echo.bib]
-
-
Introduction
=============================================================================
diff --git a/examples/echo/echo.subplot b/examples/echo/echo.subplot
new file mode 100644
index 0000000..e8ae606
--- /dev/null
+++ b/examples/echo/echo.subplot
@@ -0,0 +1,10 @@
+title: "**echo**(1) acceptance tests"
+authors:
+ - The Subplot project
+markdowns:
+ - echo.md
+bindings:
+ - echo.yaml
+impls:
+ bash:
+ - echo.sh
diff --git a/examples/muck/muck.md b/examples/muck/muck.md
index b074424..0a28020 100644
--- a/examples/muck/muck.md
+++ b/examples/muck/muck.md
@@ -1,12 +1,3 @@
----
-title: Muck JSON storage server and API
-author: Lars Wirzenius
-date: work in progress
-bindings: [muck.yaml]
-impls:
- python: [muck.py]
-...
-
Introduction
=============================================================================
@@ -95,24 +86,19 @@ This chapter lists high level requirements for Muck.
Each requirement here is given a unique mnemonic id for easier
reference in discussions.
-**SimpleOps**
-
-: Muck must be simple to install and operate. Installation should be
- installing a .deb package, configuration by setting the public key
- for token signing of the authentication server.
-
-**Fast**
-
-: Muck must be fast. The speed requirement is that Muck must be able
- to handle at least 100 concurrent clients, creating 1000 objects
- each, and then retrieving each object, and then deleting each
- object, and all of this must happen in no more than ten minutes
- (600 seconds). Muck and the clients should run on different
- virtual machines.
+**SimpleOps** --- Muck must be simple to install and operate.
+ Installation should be installing a .deb package, configuration by
+ setting the public key for token signing of the authentication
+ server.
-**Secure**
+**Fast** --- Muck must be fast. The speed requirement is that Muck
+ must be able to handle at least 100 concurrent clients, creating
+ 1000 objects each, and then retrieving each object, and then
+ deleting each object, and all of this must happen in no more than
+ ten minutes (600 seconds). Muck and the clients should run on
+ different virtual machines.
-: Muck must allow access only by an authenticated client
+**Secure** --- Muck must allow access only by an authenticated client
representing a data subject, and must only allow that client to
access objects owned by the data subject, unless the client has
super privileges. The data subject specifies, via the access
diff --git a/examples/muck/muck.subplot b/examples/muck/muck.subplot
new file mode 100644
index 0000000..f6feb2a
--- /dev/null
+++ b/examples/muck/muck.subplot
@@ -0,0 +1,12 @@
+---
+title: Muck JSON storage server and API
+authors:
+ - Lars Wirzenius
+date: work in progress
+markdowns:
+ - muck.md
+bindings:
+ - muck.yaml
+impls:
+ python:
+ - muck.py
diff --git a/examples/muck/muck.yaml b/examples/muck/muck.yaml
index b22e088..967ab56 100644
--- a/examples/muck/muck.yaml
+++ b/examples/muck/muck.yaml
@@ -18,24 +18,34 @@
python:
function: fixme
regex: true
+ types:
+ json: text
- when: "I do PUT /res with Muck-Id: \\{(?P<id>\\S+)\\}, Muck-Revision: \\{(?P<rev>\\S+)\\}, and body (?P<json>\\{.*\\})"
impl:
python:
function: fixme
regex: true
+ types:
+ id: word
+ rev: word
+ json: text
- when: "I do GET /res with Muck-Id: \\{(?P<id>\\S+)\\}"
impl:
python:
function: fixme
regex: true
+ types:
+ id: word
- when: "I do DELETE /res with Muck-Id: \\{(?P<id>\\S+)\\}"
impl:
python:
function: fixme
regex: true
+ types:
+ id: word
- when: "I restart Muck"
impl:
@@ -58,15 +68,23 @@
python:
function: fixme
regex: true
+ types:
+ header: word
+ name: word
- then: "body matches (?P<json>\\{.*\\})"
impl:
python:
function: fixme
regex: true
+ types:
+ json: text
- then: "revisions \\{(?P<rev1>\\S+)\\} and \\{(?P<rev2>\\S+)\\} are different"
impl:
python:
function: fixme
regex: true
+ types:
+ rev1: word
+ rev2: word
diff --git a/examples/seq/Cargo.toml b/examples/seq/Cargo.toml
index 2d4696a..9915f94 100644
--- a/examples/seq/Cargo.toml
+++ b/examples/seq/Cargo.toml
@@ -8,7 +8,9 @@ license = "MIT-0"
[dev-dependencies]
subplotlib = { path = "../../subplotlib" }
-fehler = "1"
[build-dependencies]
subplot-build = { path = "../../subplot-build" }
+
+[dependencies]
+culpa = "1.0.1"
diff --git a/examples/seq/seq-extras.rs b/examples/seq/seq-extras.rs
index 79863fc..b2185fb 100644
--- a/examples/seq/seq-extras.rs
+++ b/examples/seq/seq-extras.rs
@@ -26,8 +26,7 @@ fn count_lines_in_stdout(context: &Runcmd, count: usize) {
// step error. This will be reported as the reason the
// scenario fails.
throw!(format!(
- "Incorrect number of lines, got {} expected {}",
- stdout_count, count
+ "Incorrect number of lines, got {stdout_count} expected {count}",
));
}
}
@@ -57,8 +56,7 @@ fn stderr_contains_two_things(context: &ScenarioContext, what: &str, other: &str
if !stderr_has_both {
throw!(format!(
- "Stderr does not contain both of {:?} and {:?}",
- what, other
+ "Stderr does not contain both of {what:?} and {other:?}",
))
}
}
diff --git a/examples/website/website.md b/examples/website/website.md
index e85249a..b72862d 100644
--- a/examples/website/website.md
+++ b/examples/website/website.md
@@ -68,11 +68,10 @@ download [website.md][], [website.yaml][], and [website.py][].
## Generate typeset documents
To generate typeset versions of this document, run the following
-commands:
+command:
~~~
$ subplot docgen website.md -o website.html
-$ subplot docgen website.md -o website.pdf
~~~
Open up the files to see what they look like.
@@ -174,12 +173,3 @@ achieve this, you should make the following changes:
[website.md]: https://gitlab.com/subplot/subplot/-/tree/main/examples/website/website.md
[website.yaml]: https://gitlab.com/subplot/subplot/-/tree/main/examples/website/website.yaml
[website.py]: https://gitlab.com/subplot/subplot/-/tree/main/examples/website/website.py
-
-
----
-title: Subplot website tutorial
-author: The Subplot project
-bindings: [website.yaml]
-impls:
- python: [website.py]
-...
diff --git a/examples/website/website.subplot b/examples/website/website.subplot
new file mode 100644
index 0000000..a39d4e3
--- /dev/null
+++ b/examples/website/website.subplot
@@ -0,0 +1,10 @@
+title: Subplot website tutorial
+authors:
+ - The Subplot project
+markdowns:
+ - website.md
+bindings:
+ - website.yaml
+impls:
+ python:
+ - website.py