Coder Social home page Coder Social logo

ruby_version's Introduction

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

J-_-L

Copyright (c) 2010-2014 Jan Lelis. MIT License. Originated from the zucker gem.

ruby_version's People

Contributors

janlelis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

metavida

ruby_version's Issues

Pre-built gems found in gem release

Hello,

There are some .gem files under the pkg directory in the gem release archive. I believe this to be an oversight?

I've used the following snippet to get rid of them while packaging the package for GNU Guix:

(add-after 'extract-gemspec 'delete-gem-files
                          ;; There are some pre-built files in the source, and
                          ;; registered in the .gemspec.
                          (lambda _
                            (delete-file-recursively "pkg")
                            (substitute* "ruby_version.gemspec"
                              (("\"pkg/ruby_version-1.0.0.gem\".freeze, ")
                               "")
                              (("\"pkg/ruby_version-1.0.1.gem\".freeze, ")
                               ""))))

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.