Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

jorinvo/textstat-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textstat-rb

Textstat is an utility to get statistics about text content.

The main reason behind this is me wanting to hack on a nice little project. Textstat happens to be well suited to explore new technologies. There's also a Go version of this project.

Setup

  • Make sure you have Ruby installed.
  • And download the code: git clone https://github.com/jorin-vogel/textstat-rb.git

Usage

Textstat can be used as a command-line tool or via its Ruby API.

Command-line

You can pass a path to a file:

bin/textstat spec/shakespeare.txt

Or stream content to Textstat:

echo 'some content' | bin/textstat
bin/textstat < spec/shakespeare.txt
cat spec/shakespeare.txt | bin/textstat

To analyze a whole folder you could run:

find . -type f -print0 | xargs -0 cat | bin/textstat

Ruby API

See the spec/textstat_spec.rb file for usage examples or explore the API.

It's less than 50 lines of code 😉

Development

Requirements

  • Ruby
  • Bundler (gem install bundler)

Setup

  • Run bundle inside the repo directory.

Workflow

  • Run guard.
  • Hit enter to run all tests.
  • Use the guard console to run arbitrary ruby code.
  • Tests auto-rerun when files are changed.
  • Put binding.pry in your code to stop at this point and open pry.

License

MIT

About

[archive] Textstat is an utility written in Ruby to get statistics about text content.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages