Rvmpow

Gem Version

rvmpow is usefull only if you:

Pow needs to know what ruby and gemset is being used. rvm users can provide this information manually or install rvmpow and it'll handle it for you, including adding the new configuration file to .gitignore and linking the new app for immediate browsing.

Words of caution

I tested on newly created and updated rails apps, a bare minimal rack "app" and a bare minimal Sinatra app. Feedback is more than welcome.

If you are already specifying the ruby version and gemset via .rvmrc or .ruby-version/.ruby-gemset or in your Gemfile, be aware that rvmpow uses Gemfile (which is a good thing if you're going to deploy to heroku for instance). rvmpow will not change the gemfile if ruby and gemset information is present. I advise to remove it prior to running rvmpow. If you use one of the other metioned methods, move or delete the files prior to running rvmpow.

Examples

Rails

~/Documents/Dev/Rails  

Sinatra

Minimal but working. (source)

Create a directory for your Sinatra app and do:

bundle init

Edit the Gemfile as follows:

source "https://rubygems.org"

  gem "sinatra"
  gem "rvmpow"

Back in the shell, run:

bundle install

Add the "app" file my_sinatra.rb :

require 'sinatra'

get '/' do
  'Welcome to Sinatra'
end

Add the config.ru file:

require './my_sinatra'
run Sinatra::Application

And let rvmpow do the rest:

~/Documents/Dev/Ruby/frank  

Rack

Minimal but working. (source)

Create a new directory for your Rack "app" with your app file my_app.rb:

class MyApp
  def call env
    [200, {"Content-Type" => "text/plain"}, ["Hi there!!! The time is #{Time.now}"]]
  end
end

Create config.ru to launch your app.

require './my_app'
run MyApp.new

Then let rvmpow do the rest.

~/Documents/Dev/Ruby/Rack  

Installation

Add this line to your application's Gemfile:

gem 'rvmpow'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rvmpow

Usage

Make sure you are in the root directory of your Rack app before running rvmpow

$ rvmpow init

To open the app in your default browser directly after initialization, run:

$ rvmpow init --show

To open the app after initialization, run:

$ rvmpow open

If needed, you can pick individual actions via rvmpow add or rvmpow remove.

rvmpow comes with extensive help built in, just run:

$ rvmpow

Contributing

  1. Fork it ( http://github.com//rvmpow/fork )
  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