Project

versionius

0.0
No commit activity in last 3 years
No release in over 3 years
Build version txt file in the public folder
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Versionius

Library for generating version file for the project. For example if you have several clients with standalone installation of your project and you are planning to check versions of the app and make deployments. You can add to the deployment hooks tasks version file builder and then access to this file through public folder.

Installation

Add this line to your application's Gemfile:

gem 'versionius'

And then execute:

$ bundle

Or install it yourself as:

$ gem install versionius

Usage

If you are using Rails 2 version you should add load method to your Rakefile:

  load "#{Gem.searcher.find('versionius').full_gem_path}/lib/tasks/deployments.rake"

Now we can create a custom deploy task for capistrano like that:

  before 'deploy' do
    sh <<-CMD
      rake versionius:minor
    CMD
  end

  after 'deploy' do
    run <<-CMD
      rake versionius:build
    CMD
  end

It will create a minor version of the project(new tag), make 'git push --tags origin master', generate new version.txt file in the public folder after deployment.

Also you can run code manually to generate version.txt file or create new tag.

  builder = Versionius::Builder.new('./', './public/')
  builder.run

  version = Versionius::Version.new('./')
  version.minor

Contributing

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