No commit activity in last 3 years
No release in over 3 years
Provides a RubyVersionReader class to simplify reading the .ruby-version and .ruby-gemset files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 10.1
~> 3.0
~> 2.4
 Project Readme

RubyVersionReader¶ ↑

Provides a RubyVersionReader to simplify reading of .ruby-version and .ruby-gemset files in your programs.

Setup¶ ↑

On your command-line:

$ gem install ruby_version_reader

In Ruby:

require 'ruby_version_reader'

Usage¶ ↑

# Initialize your reader
reader = RubyVersionReader.new

# The current base path where .ruby-version files are being looked for
reader.path

# Access .ruby-version and .ruby-gemset data
reader.to_s #=> 'ruby-1.8.7-p249@rvr_gemset'
reader.full_version #=> '1.8.7-p249'
reader.gemset #=> 'rvr_gemset'

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

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

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

# Misc Accessors
reader.engine #=> 'ruby'
reader.major # => 1
reader.minor # => 8
reader.tiny  # => 7
reader.patchlevel # => 249

Credit¶ ↑

Basic RubyVersionReader comparison logic from github.com/janlelis/ruby_version which originated from the zucker gem.

Copyright © 2014 Marcos Wright-Kuhns. MIT License.