NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| # I don't really see any services here. What I see is: | |
| # - Normal HTTP boundary stuff (params flash, redirect). | |
| # - Model creation and retrieval. | |
| # - Warden manipulation, which is an odd done but smells like boundary. | |
| # | |
| # I left all of the HTTP boundary stuff in the controller (and only the | |
| # controller). I moved the model creation/retrieval into simple class methods | |
| # in the models. I moved the warden manipulation stuff into | |
| # ApplicationController (with caveats that I'll discuss inline). | |
| # |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
@holman got a request about our deployment system, heaven
I know it's not a high priority, but has there been any activity on open-sourcing the core Heaven gem?
There is. I've been working on extracting the non-GitHub specific parts into two gems. This first is a CLI portion called hades. The second is an HTTP API portion called heaven.
When you open source something previously used as in internal tool like Heaven, Hubot, Boxen, etc., how do you manage and hook in the parts that need to stay internal?
Normally I focus around four questions:
| describe MailingList do | |
| let(:notifications) { double('notifications') } | |
| let(:user) { User.new } | |
| it 'registers a new user' do | |
| expect(notifications).to receive(:call).with(user, 'list_name') | |
| mailing_list = MailingList.new('list_name', notifications) | |
| mailing_list.add(user) | |
| http://www.infoq.com/presentations/Simple-Made-Easy | |
| http://www.infoq.com/presentations/integration-tests-scam | |
| http://blog.thecodewhisperer.com/2010/09/14/when-is-it-safe-to-introduce-test-doubles | |
| http://youtu.be/yTkzNHF6rMs | |
| http://pyvideo.org/video/1670/boundaries | |
| http://skillsmatter.com/podcast/ajax-ria/enumerators | |
| http://alistair.cockburn.us/Hexagonal+architecture | |
| http://c2.com/cgi/wiki?PortsAndAdaptersArchitecture | |
| http://www.confreaks.com/videos/977-goruco2012-hexagonal-rails | |
| http://www.confreaks.com/videos/1255-rockymtnruby2012-to-mock-or-not-to-mock |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
Find it here: https://github.com/bitemyapp/learnhaskell
| # config/routes.rb | |
| resources :documents do | |
| scope module: 'documents' do | |
| resources :versions do | |
| post :restore, on: :member | |
| end | |
| resource :lock | |
| end | |
| end |
Let me explain what we're trying to do, which may be crazy. But if it's not crazy, perhaps someone can tell us how to use AMQP to do it.
We have a Rails app that talks to a growing number of backend Clojure services.
It could talk to them via HTTP, but many of the messages don't need to be synchronous. They're "fire and forget". Hence AMQP.
For the synchronous messages, we observed two things:
Serializing and deserializing HTTP is surprisingly annoying, especially given Rails conventions.
Most of the time when we send a message that updates a resource, we don't need a synchronous acknowledgement right away. We only need to know that the update has happened at some point before we next read the resource.
| require 'curses' | |
| module Seeder | |
| extend self | |
| def generate_matrix | |
| rand(40..200).times.map { [rand(24), rand(48)] } | |
| end | |
| end | |
| class Universe |