Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Robert Williams's Profile

GitHub User: robwilliams

Site: http://www.stinkyinkshop.co.uk

Comments by Robert Williams

Avatar

Oh and if you want it to work without rails:

ruby
class Object

  include Rails::ConsoleMethods if defined?(Rails)

  def vim(method_name)
    file, line = method(method_name).source_location
    fork do
      exec("vim +#{line} '#{file}'")
    end
    Process.wait
    reload! if defined?(Rails)
  end

  alias :v :vim
end
Avatar

Try the following:

ruby
if defined?(Rails)
  class Object

    include Rails::ConsoleMethods

    def vim(method_name)
      file, line = method(method_name).source_location
      fork do
        exec("vim +#{line} '#{file}'")
      end
      Process.wait
      reload!
    end

    alias :v :vim
  end
end

Remove the reload bits if you don't require them.

Avatar

Mixing capistrano and puppet/chef could be an option. As you said, creating users , installing packages and ensuring they stay installed are what tools like puppet/chef are made for. On the other hand configuring anything app specific i.e. nginx host, unicorn and so forth is easier using capistrano because it is more closely related to the application.