Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fransan6/ruby-wc
Ruby version of *nix command `wc`
https://github.com/fransan6/ruby-wc
rspec ruby unix
Last synced: about 1 month ago
JSON representation
Ruby version of *nix command `wc`
- Host: GitHub
- URL: https://github.com/fransan6/ruby-wc
- Owner: fransan6
- Created: 2024-01-25T12:56:26.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-19T20:11:05.000Z (7 months ago)
- Last Synced: 2024-09-30T03:41:06.559Z (about 2 months ago)
- Topics: rspec, ruby, unix
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Usage
Ruby version of \*nix command `wc` with options `-c`, `-l`, `-m` and `-w` to analyse a file:
- `-c` prints the byte count
- `-l` prints the line count
- `-m` prints the character count
- `-w` prints the word countLeaving out the option gives you `-l`, `-w` and `-c`.
**How to run**
`./rwc [option] [filename]`, for example: `./rwc -c myfile.txt`
It also supports reading from the standard input when pipe is used:
`cat myfile.txt | ./rwc -m`
### Instruction
To run this from your local environment, make sure Ruby 3.3.0 is installed. Clone the repository, run `bundle install` and you are good to go.