brant
Simple package migration management inspired from rails database migration management.
Installation
gem install brant
In config/environment.rb add -
gem.config('brant')
In the Rakefile add -
require 'brant'
require 'brant/tasks'
Usage
Create a new migration
script/generate brant_migration install_xml_package
Setup a new migration
class InstallXmlPackage < Brant::Migration
def self.up
system("sudo apt-get install xml2")
end
def self.down
system("sudo apt-get remove xml2")
end
end
Load rails environment for custom tasks (optional)
require 'config/environment'
class ProcessImages < Brant::Migration
def self.up
Image.last.process
end
def self.down
Image.last.mark_as_unprocessed
end
end
Run pending migrations
rake brant:migrate
Rollback last migration
rake brant:rollback
Contributing to brant
- Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
- Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright
Copyright © 2012 Denwen, Inc. See LICENSE.txt for further details.