Переглянути джерело

Update README and Dockerfile

master
mtardy 4 роки тому
джерело
коміт
033294715f
2 змінених файлів з 19 додано та 17 видалено
  1. +1
    -1
      Dockerfile
  2. +18
    -16
      README.md

+ 1
- 1
Dockerfile Переглянути файл

@ -7,6 +7,6 @@ RUN wget -qO- https://www.piumarta.com/software/peg/peg-0.1.18.tar.gz | tar xz \
&& mv /peg-0.1.18/leg /usr/bin/ \
&& rm -r peg-0.1.18
# Add project files and compile
WORKDIR /javascrypt
WORKDIR /sandbox
COPY . .
RUN make

+ 18
- 16
README.md Переглянути файл

@ -1,14 +1,14 @@
# Javascrypt
# Sandbox
## Build the project
### Requirements
Please install [peg/leg](https://www.piumarta.com/software/peg/) manually or with Homebrew:
Please install [peg/leg](https://www.piumarta.com/software/peg/) manually or with a package manager, for example with Homebrew:
```bash
$ brew install peg
```
Please install [the Boehm-Demers-Weiser conservative garbage collector](https://www.hboehm.info/gc/) manually or with Homebrew:
Please install [the Boehm-Demers-Weiser conservative garbage collector](https://www.hboehm.info/gc/) manually or with a package manager, for example with Homebrew:
```bash
$ brew install bdw-gc
```
@ -23,30 +23,32 @@ $ make
The Docker image provides a ready to go environment to experiment with the project. Just build the image locally and run an interactive shell inside the container:
```bash
$ docker build . --tag mtardy/javascrypt
$ docker run -it mtardy/javascrypt
$ docker build . --tag mtardy/sandbox
$ docker run -it mtardy/sandbox
```
---
## Usage
### Single input
You can pass your program:
* via the standard input
```bash
$ echo "a=2+3 a*2" | ./calc
$ echo "a=2+3 a*2" | ./parse
```
or
```bash
$ ./calc < file
$ ./parse < file
```
## Tests
Simple tests:
* via a file
```bash
$ tests/test.sh
$ ./parse file
```
Custom test:
### Multiple inputs
You can also pass multiple files and use `-` in any order as the standard input when mixing files and standard input, for example:
```bash
$ ./calc < tests/test.txt
$ ./parse file1 - file2 < file3
```
```bash
$ echo "a=2+3 a*2" | ./parse file1 file2 -
```

Завантаження…
Відмінити
Зберегти