Mongrel 0.3.13.4 Released for Unix

Posted by jpb Fri, 22 Sep 2006 20:36:19 GMT

Bug fixes. This release fixes the problem of Start, Restart, Stop, and Stats class names clashing with people’s Rails models.

Posted in  | Tags ,  | no comments | 527 trackbacks

Build a Rails Engine

Posted by jpb Fri, 14 Jul 2006 23:18:50 GMT

There’s a good tutorial on creating your own engines for rails at AlterThought.

Posted in  | Tags , ,  | 1 comment

TextMate footnote plugin

Posted by jpb Tue, 11 Jul 2006 13:01:05 GMT

This plugin adds clickable links to the Rails backtrace when an error occurs, and clickable “footnotes” to the bottom of each page (in development mode only) that open the view or controller for the current page in Textmate.

In your plugins directory, install with:

svn export svn://syncid.textdriven.com/svn/opensource/textmate_footnotes/trunk textmate_footnotes

Posted in  | Tags ,  | 1 comment

19 Rails tricks most rails coders don't know

Posted by jpb Sat, 08 Jul 2006 22:20:15 GMT

Peter Cooper has a great article on his blog about Rails techniques that are underused at Ruby Inside.

Posted in  | Tags  | 1 comment

The Web is a pipe

Posted by jpb Fri, 30 Jun 2006 00:33:10 GMT

James Duncan Davidson has an interesting essay on The Web is a Pipe at his blog.

He brings up a lot of good points, especially about long-term support of your web application, that are applicable to things other than just Rails.

Posted in  | Tags ,  | no comments

Paypal and Rails

Posted by jpb Sun, 25 Jun 2006 21:56:41 GMT

I was putting Paypal functionality into a Rails site I’m working on, using the paypal gem (which works great, btw), and ran into an annoying feature of the Paypal sandbox. I was looking at my sandbox Paypal transactions and they were all coming back “Pending” rather than “Completed”

It turns out that when you create a user in the Paypal sandbox for testing, if you only create a dummy bank account for it, any transactions you try to do with it will come back via IPN as pending, rather than completed. If you want your test transactions to come back with a “Completed” status, you have to add a fake credit card account to the sandbox user. I guess the fake banks don’t clear the echecks ;-).

Posted in  | Tags ,  | no comments | 511 trackbacks

Ruby on Rails meets DB2

Posted by jpb Sun, 25 Jun 2006 14:41:23 GMT

IBM has an article on developing DB2 applications with Ruby on Rails here.

It includes a link to their DB2 adapter for Ruby.

Posted in  | Tags ,  | no comments

TextMate backtrace plugin

Posted by jpb Wed, 21 Jun 2006 13:03:00 GMT

This makes the backtraces in error pages into clickable links that jump you directly to the line of the relevant source file. Too useful for words. In your vendor/plugins directory, install with:

svn export svn://syncid.textdriven.com/svn/opensource/textmate_footnotes/trunk textmate_footnotes

Posted in ,  | Tags ,  | no comments

Got tired of having to manually drop tables when working on migrations

Posted by jpb Thu, 15 Jun 2006 06:16:00 GMT

I kept having typos in my migrations, and it turned out to be easier to just zap all the tables and re-run rake migrate than to undo just enough of the migration to get the db back to the way the migration was expecting.

Anyway, so I wrote this wipedb script that reads database.yml so you don’t need to maintain the database user & password in multiple places.


#! /usr/bin/env ruby
#
# $Id: wipedb 1171 2006-06-10 16:36:57Z jpb $
#
# Copyright 2006 J. P. Block <jpb@ApesSeekingKnowledge.net>

require 'ostruct'
require 'optparse'
require 'yaml'

class MyArgs
  MODENAMES = %w[development test production]

  # return structure showing what opts were picked

  def self.parse(args)
    options = OpenStruct.new
    options.mode = 'development'
    options.debug = 0

    opts = OptionParser.new do |opts|
      opts.banner = "Usage: script/wipedb [options]" 
      opts.separator "" 
      opts.separator "Specific options:" 
      mode_list = MODENAMES.join(',')
      opts.on("-m MODENAME", "--mode MODENAME", MODENAMES, "Select mode",
                      "  (#{mode_list})") do |the_mode|
        options.mode = the_mode
      end
      opts.on("-d", "--debug", "Turn on debug") do
        options.debug = 1
      end
      opts.on_tail("-h", "--help", "Show this message") do
        puts opts
        exit
      end

      opts.on_tail("--version", "Show version") do
        puts "$Id: wipedb 1171 2006-06-10 16:36:57Z jpb $" 
        exit
      end
    end

    opts.parse!(args)
    options
  end # parse()
end

options = MyArgs.parse(ARGV)

mode = options.mode

config = YAML.load_file('config/database.yml')

database = config[options.mode]['database']
host = config[options.mode]['host']
password = config[options.mode]['password']
username = config[options.mode]['username']

if options.debug == 1:  
  puts "mode: #{mode}" 
  puts "database: #{database}" 
  puts "host: #{host}" 
  puts "username: #{username}" 
  puts "password: #{password}" 
end

zap_list = `mysqldump -u #{username} -p#{password} --complete-insert --add-drop-table --quick --single-transaction #{database} | grep DROP`

zapper = IO.popen("mysql -u #{username} -p#{password} #{database}", "w+")
zap_list.each do |z|
  zapper.puts(z)
end
zapper.close_write


Posted in , ,  | Tags , , ,  | no comments

O'Reilly Dev Center article on running Rails on OS X Server

Posted by jpb Thu, 30 Mar 2006 11:02:00 GMT

Quick howto on installing & running Rails applications on OS X Server. Read the details.

Posted in ,  | Tags , ,  | 1 comment

Older posts: 1 2