Skip to content

Commit

Permalink
Background.stdin_write docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Nov 29, 2024
1 parent 670d3c9 commit 9a2e138
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ This will generate a project folder with your project in it, and a markdown `REA
- Boot background processes such as a local server
- [background.start](#background)
- [background.stop](#background)
- [background.stdin_write](#background)
- [background.wait](#background)
- [background.log.read](#background)
- [background.log.clear](#background)
- [background.wait](#background)
- Take screenshots
- [website.visit](#screenshots)
- [website.nav](#screenshots)
Expand Down Expand Up @@ -424,6 +425,21 @@ You can make the background process wait until it receives a certain string in t
:::>> background.start("rails server", name: "server", wait: "Listening on")
```

You can send strings to the STDIN of the process:

```
:::>> background.start("heroku run bash", name: "heroku_run", wait: "$")
:::-- background.stdin_write("ls", name: "heroku_run")
```

- Arguments
- contents: Positional. The string to write to stdin
- ending: A string to append to the end of the contents, defaults to a newline
you could set it to something like ";" or an empty newline ""
- name
- wait
- timeout

You can stop the process by referencing the name:

```
Expand All @@ -433,6 +449,7 @@ You can stop the process by referencing the name:
- Arguments
- name


You can also get the log contents:

```
Expand Down

0 comments on commit 9a2e138

Please sign in to comment.