https://github.com/just3ws/data_helpers
Ruby command line utility to generate sample data for coding exercises
https://github.com/just3ws/data_helpers
Last synced: 4 months ago
JSON representation
Ruby command line utility to generate sample data for coding exercises
- Host: GitHub
- URL: https://github.com/just3ws/data_helpers
- Owner: just3ws
- License: gpl-3.0
- Created: 2017-01-23T15:32:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-12T15:38:01.000Z (over 4 years ago)
- Last Synced: 2025-02-23T05:49:01.519Z (4 months ago)
- Language: Ruby
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DataHelpers
Ruby command line utility to generate sample data for coding exercises
## Installation
- Clone the repo
- `./bin/setup`
- Run `bundle exec ./bin/dh`## Development
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
## Usage
Inside the cloned repo.
Examples:
- Print comma-delimited headers and one comma-delimited fields to `STDOUT`.
```shell
bundle exec ./bin/dh```
- Print pipe-delimited header and 100 pipe-delimited fields to `STDOUT`.
```shell
bundle exec ./bin/dh --lines 100 --delimiter pipe# Is equivalent to
bundle exec ./bin/dh -l 100 -d pipe
```- Print space-delimited fields without headers into file while displaying
verbose runtime information.```shell
bundle exec ./bin/dh --delimiter space --lines 10 --no-headers --verbose > example.txt
cat example.txt
```## Command Line Options
- Header and field data is written to `STDOUT`.
- Logging and error data is written to `STDERR`.### --help OR -h
Prints usage information.
### --verbose
Writes extra runtime information to `STDERR`.
### --delimiter [DELIMITER] OR -d [DELIMITER]
Name of the delimiter to use for output.
Allowed values:
- `comma`
- `pipe`
- `space`If no option provided then comma delimiter is default.
- `--delimiter comma` OR `-d comma`
Use ", " as delimiter between cells.
- `--delimiter pipe` OR `-d pipe`
Use " | " as delimiter between cells.
- `--delimiter space` OR `-d space`
Use single whitespace character as delimiter between cells.
### --lines NUMBER or -l NUMBER
The number of lines to generate.
Allowed values:
- non-negative integer >= 0
If no option provided then 1 is default.
### --prepend-headers
Field headers will be printed then fields will print as configured.
### --no-headers
Field headers will _not_ be printed before fields.
### --only-headers
Field headers will be printed followed and _no_ fields will be printed.