All Projects → janlelis → ruby_version

janlelis / ruby_version

Licence: MIT license
RubyVersion | Better than RUBY_VERSION

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ruby version

bncsutil
The Classic Battle.net™ client library
Stars: ✭ 19 (+35.71%)
Mutual labels:  version-check
LaunchGate
LaunchGate makes it easy to let users know when an update to your app is available.
Stars: ✭ 58 (+314.29%)
Mutual labels:  version-check

RubyVersion Gem Version

Provides a RubyVersion to simplify checking for the right Ruby version in your programs.

Setup

On your command-line:

$ gem install ruby_version

In Ruby:

require 'ruby_version'

Usage

# Output RUBY_VERSION
RubyVersion.to_s

# Check for the main version with a Float
RubyVersion.is? 2.1

# Use strings for exacter checking
RubyVersion.is.above '1.9.2'
RubyVersion.is.at_least '2.0.0' # or exactly, below, at_most

# You can use the common comparison operators
RubyVersion >= '1.8.7'
RubyVersion.between? '1.8.7', '1.9.2'

# Relase date checks
RubyVersion.is.older_than Date.today
RubyVersion.is.newer_than '2009-08-19'

# Misc Accessors
RubyVersion.major # => 1
RubyVersion.minor # => 8
RubyVersion.tiny  # => 7
RubyVersion.patchlevel # => 249
RubyVersion.description # => "ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]"

Also See

github.com/janlelis/ruby_engine | github.com/janlelis/ruby_info | github.com/rdp/os

J-_-L

Copyright © 2010-2014 Jan Lelis. MIT License. Originated from the zucker gem.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].