Manfred Stienstra,
03 Jun 2010, 14:22 in tools, web, and ruby (edit).
I just pushed version 0.4 of the Nap gem. For those who don’t know: Nap is a really simple ReST API, basically a small wrapper around Ruby’s net/http.
New in this version is support for TLS client certificates, this means you can use certificates to authenticate with a server.
response = REST.get('https://example.com/pigeons/1',
{ 'Accept' => 'application/json' },
{ :tls_key_and_certificate_file => '/Users/Manfred/example.pem' }
)
response.body #=> {"pigeon":{"id":1}}
Eloy Duran,
02 Sep 2009, 17:20 in ruby on rails, tools, releases, os x, and rubycocoa (edit).
As Snow Leopard was released, I saw lots of talk on the interwebs about the Passenger preference pane not working on the new kitten OS. Which frankly was to be expected, but unfortunately Apple had not supplied me with a developer seed. Maybe next time…
Oh by the way, fun fact! What I did find is that NOT having your application up-to-date for a new OS release is actually pretty good marketing stuff. The Passenger preference pane had about 380 watchers for a while, but during the last few days we (finally) reached 400 watchers! Thanks a lot guys! Can’t wait for the next OS upgrade so we can beat Passenger with their 776 watchers ;-).
Now where was I… Ah yes.
The pain involved in the update:
So in order to help everybody out as soon as possible, I’ve created a version which will work on both PPC and Intel machines, as well as OS X 10.5 and 10.6. This means that it will want to load System Preferences.app in 32-bit mode. But since many preference panes currently need that, we didn’t deem it a show stopper.
The real problem in getting the Passenger preference pane to run in 64-bit mode would be that System Preferences.app wants to use the Objective-C garbage collector. And rightfully so. But the only way to support this easily would be to use MacRuby, which as of yet is not stable enough. But expect the next version of the preference pane to use MacRuby and be a happy 10.6 citizen.
One last note: Apple Help in a preference pane, ugh. As ironic as it may sound, there’s not much help out there, either in the form of documentation or on how to debug it. Expect a separate post on this.
Change goodies:
- Mac OS X 10.6 support, although still in 32-bit mode:
- Bundle RubyCocoa.framework in the preference pane. (Ticket #2 & #8)
- Made the Apple Help work on both 10.5 and 10.6.
- Added a check at launch, which verifies if all your application hostnames are registered in the hosts database (Directory Services). If not, add them. Obviously this is especially handy for people upgrading from 10.5 to 10.6, but also comes in handy when editing vhosts by hand.
- Added preference pane Info.plist keys so the help shows up in the Help menu.
- Use proper capitalization for the Apache conf ”
Directory” directive.
- When the user changes the path to an application, also replace this in the
@user_defined_data string. (Ticket #4)
- Various source cleanups.
Most users probably want to download the “stable” 1.3 release.
If you’ve added your hostnames to /etc/hosts in the meantime, then you can safely remove those again as the preference pane will add these to the hosts database on startup.
If you understand why stable has been quoted, you can track development and contribute on: http://github.com/alloy/passengerpane.
Please report any bugs you may find at: http://github.com/alloy/passengerpane/issues.
Eloy Duran,
02 Feb 2009, 10:02 in ruby on rails and tools (edit).
Today is a nice day.
Because Rails 2.3 release candidate 1 was just released which, amongst others, contains my patch to support nested model attributes in your model and view.
I’m not gonna go over it again, because there is already some good content out there:
Enjoy!
Eloy Duran,
03 Dec 2008, 17:47 in ruby on rails, tools, and releases (edit).
To get the latest version, please see the Passenger preference pane page.
X-Mas came early this year ;-)
Checkout the changelog:
- Rack support. Thanks to Kematzy for the original suggestion/work.
- Fixed “issue” people had with the default non-vhost based directory not working anymore. Thanks to “spike” for debugging this.
- Made the vhost config file extension configurable as well. Patch by Felipe Mathies.
- Backported RubyCocoa + Ruby 1.8.7 fix. Patch by Grant Hollingworth.
- Removed the “Allow mod rewrite rules” checkbox, we found it’s not worth the UI real estate.
Most users probably want to download the “stable” 1.2 release.
If you understand why stable has been quoted, you can track development and contribute on: github.com/alloy/passengerpane
Please report any bugs you may find at: fingertips.lighthouseapp.com/projects/13022
Eloy Duran,
19 Sep 2008, 18:10 in ruby on rails, tools, and releases (edit).
To get the latest version, please see the Passenger preference pane page.
Yes yes, it’s update time!
This version comes with important fixes and some requested improvements.
I’ll let the changelog speak for itself:
- Honor custom environments that a user might have set.
- Fixed problem with restarting Apache. After saving an application Apache should now automatically be restarted. Thanks to Ciarán Walsh.
- Added support for ServerAlias and add those entries to the hosts db.
- Reload the applications from disk when the preference pane is brought back to the front.
Any changes made to the vhosts from elsewhere will be reflected in the UI.
- Moved all hardcoded paths into a config module. Added a config for Apache 2 as installed by MacPorts. Thanks to Ciarán Walsh.
- The host table list was editable. Thanks to Ciarán Walsh.
- Fixed bugs in parsing custom user defined data in vhosts.
- Create a tmp dir before touching restart.txt if none exists.
- Replace underscores with hyphens in hostnames. Thanks to Bryan Liles.
Most users probably want to download the “stable” 1.1 release.
If you understand why stable has been quoted, you can track development and contribute on: github.com/alloy/passengerpane
Please report any bugs you may find at: fingertips.lighthouseapp.com/projects/13022
Eloy Duran,
24 Jun 2008, 14:24 in ruby on rails, tools, and releases (edit).
To get the latest version, please see the Passenger preference pane page.
We blogged how using Passenger made development easier, but being the Mac User Interface Junkies we are, we’d like to take it one step further.
This was a great opportunity to play with preference panes in RubyCocoa. Thanks to Jason Foreman, and his repository of templates, I didn’t have to spend a lot of time finding out how to initialize a prefPane bundle.
It turns out that creating basic features with a mediocre interface (the default stuff you get from Interface Builder) can be done fairly quickly. However, making it look and feel like a preference pane from the “OEM fruit company” is a different story. Who would have thought?! ;)

Thijs doing interface design with the latest available technologies. Can you spot the advanced z-index technique he used? Hint: Starts with a P.
Anyways, back to the introduction; after roughly 2 weeks we give you an OS X System Preferences pane that will configure Apache and set up a local hostname for running any Rails application using Phusion Passenger. Getting your Rails app up and running is now a matter of seconds.
Most users probably want to download the “stable” 1.0 release.
If you understand why stable has been quoted, you can track development and contribute on: github.com/alloy/passengerpane
Please report any bugs you may find at: fingertips.lighthouseapp.com/projects/13022
Note that Passenger preference pane requires OS X 10.5.2 (or at least 10.5.0 and install RubyCocoa 0.13.2 yourself) and Passenger 2.0.1.
Manfred Stienstra,
11 Oct 2007, 21:39 in ruby on rails and tools (edit).
A lot of people are on Rails Edge nowadays. Besides all the nifty new features they also encounter bugs. There are two ways to work around these bugs:
- Lock your Rails external to an older revision or freeze it to vendor
- Find a patch on Trac or write one of your own and apply it
If you decide to apply patches, you’re going to need some help. Our solution is to put all the patches that need to be applied in vendor/patches and put the following Rake task in lib/tasks/patches.rake:
task :patch => 'patches:apply'
namespace :patches do
desc "Apply all patches from vendor/patches to root"
task :apply do
Dir.chdir(RAILS_ROOT) do
Dir["vendor/patches/*"].each do |patch|
system "patch -p0 < \"#{patch}\""
end
end
end
desc "Revert all patches applied in vendor/plugins and vendor/rails" +
"through SVN"
task :revert do
system "svn revert --recursive vendor/plugins vendor/rails"
end
end
Assuming you’re using Capistrano 2, you can add the following to your deployment recipe to automatically run the patches for each deployment.
after "deploy:update_code", "deploy:patch"
namespace :deploy do
task :patch, :roles => :app do
run "rake patches:apply"
end
end
Now all you have to do is make sure that all the patches apply cleanly and remove them when they’re accepted into Rails.
Thijs van der Vossen,
23 Oct 2006, 15:39 in ruby on rails and tools (edit).
This is from a nice new app we’ve been working on for the last month or so. Any idea what it is and who we’re building this for?

Update: First right answer gets two great books. Can’t tell you what they are about without giving away the answer, I’m afraid…
Manfred Stienstra,
28 Aug 2006, 16:50 in ruby on rails and tools (edit).
In march I wrote a post about our fcgi monitoring and management tool Fcgimon. Today I fixed some rough edges and decided to call this version 1.0.
The biggest change is the way Fcgimon gathers and presents it’s data from `ps`. Earlier versions would just find all the dispatchers and spawners in the process list and show them. This means that not running application would just not show up in the list. Fcgimon now shows the status of all the configured projects, which makes it easier to detect broken spawners. Fcgimon will still show all fcgi processes and spawners outside of the configured projects, but under the normal list and with a small warning.
Minor changes include memory usage information and in general nicer output.

If you like what you see you can download Fcgimon from our Subversion repository.
https://fngtps.com/svn/server-scripts/trunk/fcgimon/
Manfred Stienstra,
19 May 2006, 17:35 in tools and web (edit).
This week I wrote a small web tool in Camping but when I wanted to secure it a little bit I noticed that there was no default way to do HTTP basic authentication. So I wrote some code to do just that. Actually I wrote a lot of documentation and a little bit of code.
With just some downloading and three simple steps you can add basic authentication to you application.
Download the basic_authentication.rb file.
require 'basic_authentication'
- Mixin the BasicAuth module:
module Blog
include Camping::BasicAuth
end
- Define how you want to authenticate users:
module Blog
def authenticate(u, p)
[u,p] == ['admin','secret']
end
module_function :authenticate
end
And you’re ready to start not letting people into you application. If anyone has a better idea on how and where to define the authenticate method, please drop me a line.
You can use this code under the same restrictions as the Camping framework. Now let’s just hope Why doesn’t sue me for using the Camping module (:
Update: Thijs found a bug in the header handling. The link above has been updated. I will try to give this code a home somewhere and some proper version information when I have some time.
Manfred Stienstra,
16 Mar 2006, 17:25 in ruby on rails and tools (edit).
When we started using Switchtower Capistrano to deploy our projects, we had some trouble with Lighttpd herding the fcgi processes. Because the standard Capistrano tasks expect the processes to be managed externally anyway, we decided to stop using Lighttpd for this.
Most of the existing tools for managing fcgi processes are designed to do complex stuff like load balancing across different servers. What we needed was a simple tool for managing multiple Rails applications on a single server. So we wrote Fcgimon.
Fcgimon manages fcgi processes using the spinner and spawner scripts that come with Ruby On Rails.

You specify all Rails applications and the number of fcgi processes you want to have running in a configuration file. Then use fcgimon to start or stop all fcgi processes for any single application, or start and stop all applications at once.
Fcgimon also generates snippets that can be included in the main Lighttpd configuration file. This makes it much easier to keep the number of running fcgi processes and the ports listed in the Lighttpd configuration file in sync.
You can download the latest version of Fcgimon from our Subversion repository. Please give it a try and tell us what you think.
Thijs van der Vossen,
06 Jan 2006, 20:23 in tools (edit).
Allan on the sales figures for Textmate:
[…] the serial number on your license (should you have bought one) is the actual customer number, so this will tell you how many licenses were sold before you purchased yours.
I’ve got 619. What’s your number?
Manfred Stienstra,
04 Jan 2006, 15:35 in tools (edit).
Yesterday Kevin dropped a message asking for more vim mapping.
I was wondering how much could be done using vim scripts, it looks like I wasn’t the only one. Felix Ingram apparently created a TextMate snippet emulation script, as far as I can see it’s a script to emulate the tabbing through arguments in a snippet.
Manfred Stienstra,
16 Dec 2005, 11:08 in ruby on rails and tools (edit).
For the last few months I’ve been using TextMate on my iBook and on the Lil’ Mac at work. I’ve grown accustomed to the various ‘insert snippet’ commands available in TextMate. Unfortunately Vim doesn’t have these commands and I find myself inserting ^Z in my views.
However, Vim configuration is powerful enough to implement these commands. Make sure you’re in command mode and do the following:
:imap <C-z> <lt>%= %><Left><Left><Left>
:imap <C-x> <lt>% %><Left><Left><Left>
This will allow you to insert <%= %> and <% %> into your files during insert mode. It is also possible to insert these commands in ~/.vimrc so you don’t have to define them every time you launch vim.
You can find the other mapping syntax rules on the vim.org website and in your vim help files.