Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
tree: 9fa01ebfd2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
README.md
Rakefile
readingtime.gemspec

README.md

Estimate Reading Time

I use iA Writer and find the estimated reading time feature pretty handy. I thought it would be cool to add at the top of my blog articles on the web as others do.

Full credit goes to Brian Cray for explaining how to do it in PHP.

How to Use

readingtime extends the Ruby String class, so you can call reading_time on any string object.

Example

@words = "Lorem ipsum dolor sit amet"
@words.reading_time
    => "0:1"

Bugs

  • As in the example, second ranges under ten seconds are formatted as 0:1 instead of 0:01
  • Ideally, reading_time should return a Time object so it can be formatted with strftime
Something went wrong with that request. Please try again.