21 April 2014

The Ruby Reflector

Topic

Paul Gross

  Source Favicon
By Paul Gross of Paul Gross's Blog 7 months ago.
Email

This post is cross-posted at Development Hacks to Prevent Mistakes .

Bugs are an inevitable part of software development. We can do our best to write higher quality software but we can never fully escape the fact that we will release software that has problems. At Braintree, we deal with payments, so we're extra sensitive to bugs. Therefore, we've made some interesting choices on how to fight back. In some cases, we've done some crazy hacks in the name of code safety. I'll cover the most interesting ones in this post.

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog 1 year ago.
Email
  Source Favicon
By Paul Gross of Paul Gross's Blog over 1 year ago.
Email

This post is cross-posted at Scaling PostgreSQL at Braintree: Four Years of Evolution .

We love PostgreSQL at Braintree. Although we use many different data stores (such as Riak , MongoDB , Redis , and Memcached ), most of our core data is stored in PostgreSQL. It's not as sexy as the new NoSQL databases, but PostgreSQL is consistent and incredibly reliable, two properties we value when storing payment information.

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog almost 2 years ago.
Email

There are two main types of unit tests: state based and interaction based. State based tests rely on the verification of state. These tests typically perform some operation and then check the state of the resulting object:

user = User. new :title => 'manager' user. promote ! user. title . should == 'senior manager'

In contrast, interaction based tests rely on verification of the interaction between objects. This is generally done with mocks or stubs:

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog almost 2 years ago.
Email

If you're like me, you've switched all of your websites to paperless statements. No more bank, credit card, or utility statements arrive in the mail. But you would still like to have copies of these important documents, so you log in to each website and download the PDF statements.

Downloading these statements is tedious and time consuming. That's where statement_hoarder comes in. It automates this process across many different sites.

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog 2 years ago.
Email

This post is cross-posted at Data Migrations for NoSQL with Curator .

The NoSQL movement has brought us a wave of new data stores beyond the traditional relational databases. These data stores come with their own tradeoffs, but they provide some incredible benefits. At Braintree , we are moving in the direction of using Riak as our next generation data store. We love its focus on scalability and availability. Servers can fail without causing any downtime, and we can add more capacity by simply adding more servers to the cluster.

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog 2 years ago.
Email

This post is cross-posted at http://www.braintreepayments.com/devblog/untangle-domain-and-persistence-logic-with-curator .

The problem

Ruby on Rails is a great web framework, and we use it extensively at Braintree to build web apps. One criticism of Rails, however, is that it encourages tight coupling of domain and persistence layers. The convention in Ruby on Rails is for domain objects to extend ActiveRecord::Base and directly gain persistence. This makes …

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog over 2 years ago.
Email

I have wanted a Home theater PC for awhile to play movies, music, Hulu , and more through my TV. I thought briefly about buying a prebuilt device (like a Roku ), but I decided to hack one together myself. My main motivation was flexibility and the fact that I like to tinker. Furthermore, I wanted a device with a hard drive that I could load up with files and play directly to a TV.

I asked around for recommendations, and several of my coworkers recommended Zotac …

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog over 2 years ago.
Email

We have a suite of ruby applications at Braintree . There are many times when we need to run more than one of these apps at the same time. For example, we might need to run our login app in addition to whichever app we are working on.

We use foreman as our process launcher, but foreman does not handle running other projects in other rvm gemsets (and possibly ruby versions). One of my fellow developers, Tony Pitluga , released a gem called subcontractor that handles these cases.

pgrs.net Read
  Source Favicon
By Paul Gross of Paul Gross's Blog over 2 years ago.
Email

I just released version 1.0 of speclj-growl . This is a plugin for the speclj test framework for clojure which adds Growl popups for each spec run. For those unfamiliar with Growl , it is a notification system for Mac OS X which allows applications to show custom messages in system popups.

speclj comes with autotest built in. You can start an autotest process which will monitor the filesystem for changes. When tests or code change, the tests will …

pgrs.net Read