TheCWLZone 2.0

Welcome to the new look and feel of  TheCWLZone.com I decided to use nanoc, a Ruby-based static site generator to create the 2.0 version of my web site. I use nanoc to build content, run the content through the nanoc compiler and then run git to upload the generated HTML pages to my site’s public directory. I use a number of web tools to create various effects on the site. See the “Generated by” section of the footnotes at the bottom of the pages for a complete list. I have decided to continue to use the WordPress blog tool even though nanoc has some very powerful built-in blogging features. I… Read More

Continue Reading

Rails Time Extension Edge Case

I love the extensions that Rails has for the Ruby Time object (see ActiveSupport::CoreExtensions::Integer::Time) – you can do calculations like Time.now + 1.month, (4.months + 5.years).from_now, and other cool things. In my last post, I mentioned working with an application that uses a subscription service. One of the things I want to do is send the subscriber an e-mail when the current subscription is about to expire. (I am not comfortable with the concept of auto-renewal; customers should have the right to “opt in” on the continuation of a subscription. Just personal preference.) So I set up a cron job that tests subscription expiration dates. Here’s the one that checks… Read More

Continue Reading

Ouch. Tricky Rails Multiparameter Bug In Attribute Writers

I’m building a web site with a subscription-based payment system using ActiveMerchant. The first rule is, don’t put any user financial information into your local database, just pass the user input to your payment system (i.e. Pay Pal, Authorize.net, etc.). So how do you handle this information? attr_accessor to the rescue. You can have something like this: Now you can work with the users credit card number (as just one example) without commiting it to the Subscription table. But – one thing you need is the card expiration date. You can get that information from the user in a drop down menu in the view: This is a multiparameter situation,… Read More

Continue Reading

A New Look for the Web Site

My mostly static web site was hacked together about 5 years ago with straight HTML tags using the XEmacs editor. To say the least, it was starting to look pretty frayed around the edges, not to mention boring. My ISP doesn’t support Rails sites well – they are a shared hosting ISP, with the main mission to be as inexpensive as possible, and they do that very well. Works for me. So, I started looking around for something that could generate and maintain a static web site. I found this article on Andy Atkinson’s blog; a nice overview of 5 Ruby-based generators. Sweet! Andy wasn’t real impressed with webgen, but… Read More

Continue Reading

Rewind Ruby 1.9.1 (or “Put The Candle Back”)

I updated all the gems for my current Rails development project that is using Ruby 1.9.1. This also included an upgrade to Phusion Passenger 2.2.5. Then I upgraded to Ruby 1.9.1-p243, which promptly crashed Passenger when I did a session request through Authlogic 2.1.2. Ouch. So, I reinstalled Ruby 1.9.1-p129, and all is well again. Oddly enough, there is no uninstall switch in the Ruby-for-Linux tar ball Makefile. The default install location is /usr/local, so I can keep the Fedora 8 version of Ruby 1.8.6 (via the RPM package system) intact, but I wasn’t sure what would happen if I simply re-installed the older Ruby 1.9.1 version under /usr/local. As… Read More

Continue Reading