April 13, 2012

SocketRocket and PrivatePub

At work we’re using Ryan Bates excellent Private Pub gem to push updates from background workers to web clients. Our client wanted an iOS App as well and since I recently read about SocketRocket I was wondering if I could keep the current infrastructure and push data to the iOS App as well. The web app consists of a Ruby on Rails 3.2 frontend which utilizes Resque for long running background jobs. Read more

March 10, 2012

Replacing pow.cx

EDIT There is an updated version available which does not setup nginx as a system service. Instead HAProxy is used to allow a proper WebSocket setup. If you like to follow along just setup named properly. Pow is a nice Rack server. You can’t work with it while offline but that didn’t bother me much. Then it started randomly crashing on me & using 99% of my CPU. That’s when I started testing alternative setups to get rid of pow. Read more

March 2, 2012

Migrating Monolith Rails 2.x Apps to Rails 3.x

This is a follow up on my post made on 30th October 2011, Migrating Monolith Rails 2.x Apps. I’m going to walk through the basic steps necessary to make rubycas work with existing Devise authentication data, more specific Devise v1.0.11. To enable rubycas-server to work with your existing user data we are going to create a custom authenticator: # encoding: UTF-8 require 'casserver/authenticators/sql' require 'devise/encryptors/base' require 'devise/encryptors/sha1' class CustomAuthenticator < CASServer::Authenticators::SQL # snip from devise lib def secure_compare(a, b) return false unless a. Read more

February 25, 2012

Using foreman and supervisord for process monitoring

note: this post was updated on 05.03.2012 to reflect changes made to supervisord support. When I’m developing a Ruby on Rails application I like having my external services configured inside my SCM. This eases the burden of documenting what must be executed in order to have a fully running application. It also helps deploying the application to the production- or staging environment since foreman supports exporting to process monitoring tools like upstart. Read more

January 30, 2012

handlebars routes assets has been renamed!

I renamed my Rails asset-pipeline routing integration gem to asset_pipeline_routes, after merging changes from @ubermajestix. You can find it on https://github.com/nicolai86/asset_pipeline_routes or https://rubygems.org/gems/asset_pipeline_routes. Besides renaming the gem I also took my time to add some small changes: asset_pipeline_routes requires Rails v 3.2.0 or greater all generated methods now take a parameter which is used to generate the resulting route. E.g. given resources :users in your routes.rb Read more

November 3, 2011

Deploying hubot with capistrano and forever

Just recently github released their hubot into the wild. Hubot really is a nice piece of software. There’s even a really easy way to deploy it to Heroku. But wait… what if you want to deploy to your own server? Here’s one way using capistrano & forever. But first: a complete capistrano example: set :application, "hubot" set :scm, :git set :ssh_options, { forward_agent: true } set :branch, "master" set :deploy_to, "/home/hubot" set :deploy_via, :remote_cache set :repository, "git@your-server. Read more

October 30, 2011

Migrating Monolith Rails 2.x Apps to Rails 3.1: setting up rubycas-server

I’m planning on publishing a series of posts about how to properly set-up a working Single-Sign-On server and integrating it with Rails 2.3 Apps as well as Rails 3.1 Apps. My goal is to show you how to migrate a huge “old” Rails 2.3 Apps into multiple new & smaller Rails 3.1 Apps. For some time, these new Apps will coexist with the old system, until the old App is replaced in its entirety by new Apps. Read more

October 6, 2011

Asset Pipeline and I18n using jQuery-localize

After last months Frozenrails conference I tried to replicate the goals of Jeff Casimirs “Blow Up Your Views” talk using the Rails Asset Pipeline. The first step was using HAML and Handlebars in the asset pipeline to have most ActionView Helpers at your disposal. There was only one problem I did not address at all in my last post, localization. At work I talked a lot with Marc Schwering (@dgAlien) about this; separating views, data-models and localization looks like a good solution to us. Read more

September 21, 2011

Rails 3.1 Asset Pipeline and JavaScript Templates

Backbone.JS on Rails 3.1 asset pipeline Today I want to share a small proof of concept with you, taken from Jeff Casimirs talk at Frozenrails 2011: complete decoupling of controllers and views in Rails. So all the controllers do is to serve and consume JSON data. The front-end is build around this data. Now you might ask: “Why should I want to do THAT?”. For one, the way view rendering currently works in Rails isn’t very object-oriented. Read more

August 19, 2011

building JavaScript mashups

Adding browser-independent features to websites ‘you did not build’ is possible - the only drawback is that the user must willingly choose to enable your mashup. Here’s one way to do it: develop a small mashup - whatever you want to build, minify it and wrap it in a closure like this: All this example does is to alert “Hello World” on the page it is executed on. Read more

© Raphael Randschau 2010 - 2022 | Impressum