0.0
No commit activity in last 3 years
No release in over 3 years
Easily read your VERSION file and display it in different formats
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

version_reader Build Status Code Climate

Small Gem to read your version file.

Usage

Assuming you have a file ~/CoolApp/VERSION with the content of 0.4.2\n.

require 'version_reader'

version_reader = VersionReader.new('~/CoolApp/VERSION')
version_reader.normal # 0.4.2

Rails integration

If you add this gem to your Gemfile of a Rails application it will automatically define CoolApp::Application.version and fill in a Rails-flavored VersionReader instance.

Flavors

Flavors are an easy way to extend a VersionReader object with additional informations.

Rails

The Rails flavor adds some additional methods which also show some information about the current Rails-Environment.

rails_env

Always adds the current Rails-Environment to the version. Maybe useful to see whether this is staging or not :)

CoolApp::Application.version.rails_env

Output would be 0.4.2-development.

rails_env_without

Adds the current Rails-Environment if it does not match one of the given environments.

CoolApp::Application.version.rails_env_without(:production,:staging)

Output would be 0.4.2-development or 0.4.2 for staging and production.