… of many things …

January 13, 2010

Reimplementing in Scanty

Filed under: Computing, Ruby, Sinatra — Jason Rogers @ 12:41 am

Pretty soon, I will be taking down the WordPress implementation of this blog and moving it over to Scanty.

August 26, 2009

Add Support for HTTP OPTIONS Method to Sinatra Applications

Filed under: Computing, Ruby, Sinatra — Tags: — Jason Rogers @ 12:16 pm

March 14, 2009

Sinatra meets S5

Filed under: Ruby, Sinatra, Software — Tags: — Jason Rogers @ 10:18 pm

I recently did a presentation on Sinatra at my company (RiskMetrics Group). I thought it would be apropos to do the presentation with Sinatra. To that end, I have created a project on GitHub for this called Sinatra Based S5 Presentations – SinBaSP for short.

I know the name isn’t clever, but oh well. Feel free to fork it or send me patches (with tests/specs hopefully).

February 26, 2009

Capinatra deployment

Filed under: Capinatra, Capistrano, Ruby, Sinatra — Tags: — Jason Rogers @ 11:21 pm

Another fine example of using a tool that I didn’t fully understand… not a good idea.

I spent  two days trying to figure out why my Sinatra/Passenger build was not working properly and found out that it was due to one line (19 characters) in my Capfile…

require ‘capinatra’    

It turns out that Capinatra adds an “after hook” to the deployment process of Capistrano that writes the config.ru file to your destination server.  That’s typically OK except that I wanted to tweak my config.ru file.  So, I wrote my own and assumed that would be used during the deploy.  Nope.  Capinatra writes a new one every time based on its config.ru.erb template.  Doh!

So, lesson learned (again, for the umpteen-millionth time) to know your tools.  I wonder how many times I will have to re-learn that lesson.

February 24, 2009

Capistrano failure to deploy

Filed under: Capinatra, Capistrano, Ruby, Sinatra, Software — Tags: — Jason Rogers @ 10:14 am

I have Capinatra (0.1.0) installed and Capistrano (2.5.3).  While trying to deploy to production I got this error:

/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.3/lib/capistrano/configuration/namespaces.rb:188:in `method_missing’: undefined local variable or method `app_class’ for #<Capistrano::Configuration::Namespaces::Namespace:0×12060d8> (NameError)

The “fix” was to set the app_class variable in my Capfile (I’m using the DSL style of Sinatra, I don’t have a base class that extends Sinatra::Base).

set :app_class, ”

Powered by WordPress