Refactoring OnStomp
Lately, I’ve been giving some thought to a few issues with the OnStomp gem and how I want to address them. I’ll start by over-explaining the issues, and then wrap up with how I plan to address them.
the two halves of my tasty brain
Lately, I’ve been giving some thought to a few issues with the OnStomp gem and how I want to address them. I’ll start by over-explaining the issues, and then wrap up with how I plan to address them.
While lurking on the #ruby-lang channel on freenode.net,
oddmund suggested creating a method_missing
handler that would “auto-correct” misspelled method. His suggestion was of
course a joke, but it was a pretty good one, so
he implemented it. I provided
my own implementation, along with some other
terrible ideas.
A follow up to Properties of Code: Functional Complexity
is coming. It’s much less “mathy” than its predecessor but serves as a
jumping off point for the next in the series. However, there is something
that has been nagging at me after watching some of the talks at this year’s
RailsConf. It’s a ubiquitous and seemingly trivial thing, but it bothers
the hell out of me: ActiveSupport::Concern
.
So, true to my nature of nothing ever being quite “good enough” I’m already looking to add new features to OnStomp as well as making plans for what version 2.0 will look like.
I had been pretty happy using Enki to drive this site. It’s minimal but sufficient, and very easy to tweak. However, one of Enki’s major design decisions drove me into the loving arms of Jekyll: the use of OpenID for authentication. To be fair, I’m mostly pissed at myOpenID, which has failed to authenticate me several times over the last few months and today appears to have lost my account entirely (sort of.) Nonetheless, Enki relies on OpenID for authentication, and myOpenID divorced me, took the kids, and sold my house.
The OnStomp gem version 1.0.0 has been released. It deprecates my previous Ruby stomp client Stomper.
After a significant re-tooling of Stomper’s IO handling, I’ve got something that seems very fast and very stable, using non-blocking IO.
In working out the particulars of a failover extension to Stomper, I discovered a few subtle but frustrating bugs. As a result, I pushed out 3 versions of the Stomper gem today. This may be the greatest accomplishment of my life.
I’m probably just late to the party, but at least with Ruby 1.8.7 and 1.9.2, there’s nothing special that has to be done for each of these examples to produce the same output:
After PostgreSQL has been installed with ports, pg_config
and other tools
can be found in "/opt/local/lib/postgresql84/bin"
. Add this path to
$PATH
and set ARCHFLAGS="-arch x86_64"
.
When setting up OpenSSL validation in Ruby, I ran into a few issues. I’ll revisit this post later, but for my own memory, here’s the big one:
Why spend our free time doing things we enjoy when it could be better spent fighting with calculating machines?
The following code assumes that there is a subdirectory named certs
containing known certificates in PEM format, and a subdir keys
containing the client’s private RSA key. Further, there are lots of comments
specific to my actual needs, namely exporting keys generated in Java using
keytool
for an Apache ActiveMQ message
broker. Lastly, to use the ca_path
method, the certs
directory needs to
be properly indexed using c_rehash
(make sure the underlying version of
openssl
matches the version Ruby’s OpenSSL extension was built against,
otherwise the hash algorithm may not be the same.)