Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oldness

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oldness

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

oldness

Oldness is a library and shell command that places the age of a published work on a semi-arbitrary five-star scale.

Installation

 gem install oldness

 require 'oldness'

Usage

CLI

 $ oldness list
 animation
 comic
 film
 history
 literature
 novel
 philosophy
 rpg
 scifi
 videogame
 $ oldness rate comic 1987-10
 ****
 $ oldness ranges movie
 *****: 1894-02-05..1972-09-14
 **** : 1972-09-14..1998-11-27
 ***  : 1998-11-27..2007-08-22
 **   : 2007-08-22..2010-07-21
 *    : 2010-07-21..2012-01-04
 $ oldness first philosophy
 Tale of Genji (1010), by Murasaki Shikibu

Library

Declaring the existence of a medium is easy; you don't need a national reputation as a culture critic or scholar.

 class Rubies < Medium
   began Date.new(1979)
 end

Although of course it would be better if you could point to a particular work that you saw as kicking things off.

 class RockNRoll < Medium
   began Date.new(1944), :with => "Strange Things Happen Every Day", :by => "Sister Rosetta Tharpe"
 end

Mediums know how to rate by date.

Rubies.rate(Date.new(2010, 8, 29)) # => 3
Rubies.rate("2012-1-4") # => 1

They also know what dates fall under what ratings.

Rubies.ranges[5] #=> #<Date: 1979-01-01>..#<Date: 2001-01-02>

And, if you've told them, they remember their roots.

RockNRoll.first.title #=> "Strange Things Happen Every Day"
Rubies.first.by #=> "Unknown"

Just a reminder: mediums are timeless, so they never need to be instantiated.

FAQs

Package last updated on 04 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc