Posts tagged Ruby

Feb28

Ruby whenever and day of month crontab syntax

Ruby cron | comments

Whenever by Javan Makhmali is an excellent way to manage the cron tasks that relate to your ruby app. It provides a very powerful and readable ruby syntax for planning a job schedule.

Continue reading »

Mar03

HOWTO commit an incremental Rails upgrade to SVN

Ruby Rails Subversion | comments

My relationship with Subversion is an ever growing one. Right now it is growing itself straight into git. I’m not sure how happy Subversion is with me. It’s complicated.

Continue reading »

Feb28

Move server configuration files into your repository

capistrano rails ruby scm svn Ruby Rails SVN SCM Capistrano | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/45/139177165_e3855c6686_m_d.jpg" width="240" height="180" alt="Dung repository" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/cheesygarlicboy/">Chambo25</a></div>
Continue reading »

Feb19

Calling MailBuild AddWithCustomFields with Ruby

MailBuild Ruby SOAP | comments

Today I had a fun trial-and-error exploration of Ruby SOAP messaging. By “fun” I mean “hair-rippingly excruciating.”

Basic SOAP calls are pretty easy with the wsdlDriver inherent in Ruby. Here’s how you’d wrap MailBuild’s Subscriber.Add function in Ruby:

Continue reading »

Jan02

Integrating Rails and WordPress

WordPress Ruby on Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/4/9183721_1ec8cf6ef4_m.jpg" width="240" height="180" alt="Mad code rewrite" /><br />
  <div class="text-backing"> </div>
  <div class="text">Photo by <a href="http://flickr.com/photos/zhartley/">zhartley</a></div>
Continue reading »

Dec26

assert_select selectors using regular expressions

Ruby on Rails Ruby Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/49/172347516_064bd42d14_m.jpg" width="240" height="180" alt="Assertive" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/schwarzerwolf/">ausi_blackwolf</a></div>
Continue reading »

Nov28

Rails before_destroy gotcha

Ruby Rails programming | comments

So there’s a Category that has many Expenses. The expenses for a category are destroyed when the category is destroyed. Elsewhere in my logic I would like to know if the category is removable based on whether it has any expenses and, if it does, whether any of the expenses it has are greater than zero.

Continue reading »

Nov12

A Rails way to popup secondary windows

Ruby Rails JavaScript | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm3.static.flickr.com/2104/1797707604_870dc2f9b1_m.jpg" width="240" height="161" alt="Popup Problems" /><br />
  <div class="text-backing"> </div>
  <div class="text">Photo by <a href="http://flickr.com/photos/rubbertoe/">rbatina</a></div>
Continue reading »

Nov09

RuntimeError: expected > (got ...

Ruby Rails | comments

Does that title make sense to you? If not, you’re not alone. I dealt with that bit of text for several hours the other day. It’s the beginning of an error message that my pea-sized brain could not parse for the life of me. I received the message while running a simple test involving an assert_select.

Continue reading »

Oct22

Ruby console spacebar problems

Ruby Rails irb script/console readline spacebar problem | comments

Since early this summer, I have had a severely annoying problem with my Ruby consoles (irb and script/console). My spacebar quit functioning, making quick testing of Ruby and Rails functionality quite limited and in some cases impossible. I’ll give you two versions of my story. First the short version.

Continue reading »

Oct15

When single-table inheritance attacks

Rails Ruby single-table inheritance STI | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/31/46196140_010d9aeff9_m.jpg" width="240" height="180" alt="Broken Ping-Pong Table" /><br />
  <div class="text-backing"> </div>
  <div class="text">Photo by <a href="http://flickr.com/photos/darlingsnail/">DarlingSnail</a></div>
Continue reading »

Oct08

has_many_polymorphs and checkboxes

Rails Ruby has_many_polymorphs | comments

Previously I discussed getting my feet wet with has_many_polymorphs. In that article I promised a follow-up dealing with checkboxes in a polymorphic world. As I started keying the article, I ran into a much better description of the overall issue by Dylan Fareed (I presume) at I Am Still Alive. Take a look at his has_many_polymorphs overview.

Continue reading »

Oct01

A model diagram for your Rails application

Ruby on Rails Rails model visualization data diagram class visualization class diagram Ruby on Rails Rails model visualization data diagram class visualization class diagram | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/218/507682952_8b4eda2922_m.jpg" width="240" height="160" alt="51907_35.jpg" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/always13/">always13</a></div>
Continue reading »

Sep12

Rails auto select text field tag

Ruby on Rails Rails Ruby on Rails Rails | comments

On a recent project, I needed to simulate the YouTube-ish text field selection box. You know the one where you can easily select and copy a link or embed code to send on to your friends. You click in the box, the text is automatically selected, and you can quickly copy the text.

Continue reading »

Sep05

TextMate find in project slow in Rails

TextMate Rails Ruby on Rails TextMate Rails Ruby on Rails | comments

Update: Don’t bother with the crap I spewed below. Just head over to Rail Spikes. There are a couple options if you read the post and comments.

Continue reading »

Aug29

Adding a mongrel instance to a Slicehost Rails app

Ruby on Rails mongrel Slicehost Ruby on Rails mongrel Slicehost | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/204/524123975_bed8ab7cbb_m.jpg" width="240" height="160" alt="Cindy" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/georgiap/r">caribbean</a></div>
Continue reading »

Aug27

Make sure to properly scope your Ruby mixins

Ruby on Rails Ruby Rails Ruby on Rails Ruby Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm2.static.flickr.com/1012/1025919868_ebf0df1a71_m.jpg" width="240" height="160" alt="Matt - rifle" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/amagill/">AMagill</a></div>
Continue reading »

Aug20

Ignoring English articles with regular expressions

Ruby on Rails regular expression Ruby on Rails regular expression | comments

During some freelance work, we had a special requirement that I imagine a lot of people run into. A list of items returned from the database needed to be sorted by name while ignoring English articles: “a,” “an,” and “the.” Though I hate them with a passion, I knew regular expressions were the solution.

Continue reading »

Aug06

Rails maintenance page with images and styles

Ruby on Rails Apache Ruby on Rails Apache | comments

Recently I implemented a true maintenance page on Scrawlers using Mike Clark’s excellent HOWTO. Clark’s directions show you how to create a more dynamic maintenance page than the standard HTML version we all know and love. It’s a good technique.

Continue reading »

Jul30

Don't forget the return value on Rails callbacks

Ruby on Rails programming Ruby on Rails programming | comments

This morning I spent a good while hashing on a problem in some new code I’m updating for a freelance project. I added a couple callbacks to an ActiveRecord model, and things that previously worked were broken. Unfortunately there were no errors in the model or exceptions in the system to give me a hint as to what went wrong. When I finally uncovered the problem, I was thankful that it was something I had never run into before.

Continue reading »

Jun27

Exporting your Netflix queue with Ruby

Ruby Netflix Ruby Netflix | comments

I have been with Netflix for over seven years now. Or I should say, I had been up until last Friday. Ultimately, it came down to none of us having enough time to actually watch DVDs from Netflix. When time was available to view films, we either needed to kowtow to The Kid’s viewability needs (she’s only 3, after all) or else we had such a large pool of movies we haven’t seen that larger immediate choice became key.

Continue reading »