Developing Ruby on rails application wouldn’t be that awesome if there weren’t simple and small enhancement tools making our RoR developer life easier.
Porter gem is basically such tool. It is not introducing or enabling you anything you couldn’t do by writing a dozen commands in a console but… why to write a dozen of commands if you can do it DRY, as Ruby on Rails teaches us? Porter Gem is basically enhancement for Capistrano which adds cap porterroduction task to this deploying tool. If everything is set up properly in your Ruby on Rails project, Porter gem will:

  • Dump a database with mysqldump command remotely issued by Capistrano to remote server and save the dump as an archived file.
  • Using scp, Porter is retrieving data dump from the server and decompressing it
  • Local dev database of a Ruby on Rails project is dropped, then recreated and then restored from the backup file.
  • Assets that are being stored in shared/public are rsnc’ed down to local Ruby on Rails project’s public directory
  • All Ruby on Rails rake tasks are included in restoring process of the db and re-syncing the assets without re-dumping the production db

As you can see, Porter is doing some heavy weight lifting for us here. It may be a nice addition for your everyday Ruby on Rails development.