Blog Posts
Extending Date/Time Formats in Rails 3
08/12/2011 15:28 |
|
One of the many under-the-hood changes in Rails 3.x involves how date and time formats are extended. This is still done in an initializer, but the Rails classes have changed. Here’s how it was done in Rails 2.x (for example): # Rails 2.x # /config/initializers/date_formats.rb ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!( :teg_compact => "%m/%d/%Y %H:%M", :teg_long => "%d %B %Y - %H:%M", :teg_date => "%m/%d/%Y", :teg_label => "%d%B%Y-%H%M" ) And here’s how it’s done in Rails 3.x: ...Read more |
RSpec Request Specs vs Cucumber
08/11/2011 17:21 |
|
Cucumber has major mind-share these days. Rails 3 in Action and The RSpec Book illustrate how behavior-driven development can be done alternating between integration/acceptance tests and unit tests via Cucumber and Rspec. Not everyone is such a fan of Cucumber, though. Ryan Bates favors using RSpec request specs instead, and DHH thinks that Cucumber and even RSpec are spurious. After struggling with Cucumber for a while, we agree with the latter view. The main problem with Cucumber is that its attempt to provide a near-natural language DSL (Gherkin) for integration testing is too clever by half. Gherkin is thoroughly brittle in that can only parse statements defined in step definitions, which in turn make Ruby calls using Capybara (or Webrat). Any breaking test leaves you scratching your head wondering whether it is due to a problem with the Gherkin, the step definition, or the underlying code. ...Read more |
Rails 3.1 Dev Setup
08/08/2011 10:29 |
|
Now that Rails 3.1 is nearing release, we’ve finally decided to migrate from 2.x development into the sunshine of the new Rails 3 world. We’re less embarrassed to be such late adopters than perhaps we should be, since at last year’s Golden Gate Ruby Conference at least half the people we talked with hadn’t yet started to move to Rails 3. But the time finally now seems right. References and ResourcesBeyond the infinite sources of tips and explanations about Rails 3 that Google reveals, here are some references that we’ve found to be particularly useful:
What is missing right now is an updated version of Deploying Rails Applications, since the old nginx-mongrels stack has fallen out of favor (and indeed mongrel doesn’t appear to work at all with the new rack-based middleware in Rails 3). ...Read more |
New Web Site
03/12/2010 16:32 |
|
At long last, a break in other more pressing projects has allowed us to update this web site, replacing the older one based on OpenACS with a true “eat your own dog food” Ruby on Rails site. Some things did not survive the transition — notably some of the demos (the Seattle Angina Questionnaire and Q-Assessor) and nearly all of the commentaries. Those of you who recall (or check Google’s cache while it lasts) will know that those commentaries tended to be quite political in nature. We haven’t substantively changed our views on things; we’ve just decided not to be so public about them. Instead, what posts will occur in this space will focus on technical issues. The process of moving to Rails has provided many topics worthy of comment, though most have been covered before and more definitively elsewhere. Some thoughts may show up here anyway. ...Read more |
RAID1 on Debian Sarge Redux - SATA drives and 2.6.x kernel
01/02/2007 21:14 |
|
In an earlier discussion, we described how to install RAID1 on a by-now older Debian Sarge box using a 2.4.x kernel and IDE drives. While the basic approach remains similar, we ran into issues installing on a new “9G” Dell box (SC440) which has SATA drives and the Intel ICH7 controller. Here is a step-by-step summary of how we got this to work. The discussions by “philcore:http://www.debian-administration.org/users/philcore "here”:http://www.debian-administration.org/articles/238 and here (along with reader comments) are probably the most useful information, and ultimately helped guide this approach. Lots of other discussions can be found by Googling on various combinations of “raid1”, “sata”, “sarge”, “grub”, “initrd”, etc — but most of those discussions are somewhat out-of-date. NB: supposedly the current Sarge installer can create RAIDs for you, but this was not at all apparent to me, and when I tried to use the installer tool to “configure RAID” with a half-completed install, it blew up most spectacularly. This doesn’t seem ready for prime-time yet. So here’s one approach that worked on this particular box. ...Read more |
RAID1 on Debian Sarge
07/05/2005 15:31 |
|
A RAID device is a Redundant Array of Independent Disks. The concept was developed in 1987 at UC Berkeley and involves the creation of a virtual disk from multiple small disks in order to deliver improved performance and reliability. There are many flavors of RAID and lots of variations in how to implement it. We detail here a specific instance we use: software RAID1 using IDE disks on a Dell PowerEdge box running Debian “sarge” loaded with grub, managed by mdadm, using the ext3 journaling file system. OverviewFirst, a list of references. None of these use exactly the combination of choices we use, but they provide all the pieces of information that are necessary:
So here is the process to convert an existing (or new) Debian box to software RAID1: ...Read more |