Project

versioner

0.0
No commit activity in last 3 years
No release in over 3 years
Easily manage a version number for your Rails app. The version is stored in a YAML file within your app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.2.8
~> 1.1.1
~> 1.1.0
~> 0.9.1
~> 2.11.4
~> 0.3.4
~> 0.3.33

Runtime

~> 3.0
 Project Readme

versioner

This gem allows you to easily add, update, and retrieve a version number for your Rails application.

Installation

Add this line to your application's Gemfile:

gem 'versioner'

And then execute:

$ bundle

Or install it yourself as:

$ gem install versioner

Then run the installer:

$ rails generate versioner:install

This adds these files:

  • [RAILS_ROOT]/config/versioner.yml - This is where the version number is stored.
  • [RAILS_ROOT]/config/initializers/versioner.rb - This is where you can configure options. The only option available right now is storage_path, which allows you to change the location of versioner.yml.

Usage

Version numbers follow the format Major.Minor.Patch. A major goal of this project is to follow Semantic Versioning conventions: if minor is incremented, reset the patch to 0; if major is incremented, reset both minor and patch to 0.

Force a new version number like this:

$ rake versioner:force[1,0,3]

Then you can update it:

$ rake versioner:increment_major
$ rake versioner:increment_minor
$ rake versioner:increment_patch

And get it:

$ rake versioner:version

Within your Rails app, you can use the following to get your app's version as a string:

Versioner.version

Details

Right now, the version is stored in YAML format, by default under config/versioner.yml. This location can be changed in config/initializers/versioner.rb.

More storage back-end options are coming.

Roadmap

  • Fully support Semantic Versioning (patch & build commands)
  • Git integration (set build to current git revision, automatic git tagging)
  • Support for other frameworks (e.g., Sinatra)
  • More storage back-ends

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT