Skip to content

Ramblings

Musings of Matt Williams
  • Blog
  • About
  • Chibi
  • Ruby Blender
  • Archives
  • Log in
 
Less
More
Trim
Untrim
« Older
Home
Loading
Newer »
Archive for August, 2008
25Aug08 Ruby Corner Feed
administrivia
0 Comments

I’m not sure why, but the Ruby Corner is always picking up on my next-to-last post.  Weird.  I wonder if it’s something I’m not doing properly or what……

25Aug08 Break my code, please
gotchas programming ruby
1 Comment

There’s a number of things we can should take into account when writing code — boundary cases, etc., that can make or break a programme.  Yes, testing is important, but I think that developing good defensive programming practices is even more important.  That said; I present the following, fragile, code.  Just about every line has a case where it can fail.  Can you break my code?  I’ll post some test cases which cause it to fail later.

And for those looking for the next installment of O_RLY?, it’s coming soon; I’ve been embroiled in a hideous move.

Continue reading ‘Break my code, please’

22Aug08 Ruby’s ObjectSpace: Subclasses
ruby
5 Comments

One of the (imho) lesser used pieces of the Ruby language is ObjectSpace.  In this article I’ll show one of the things you can do with it — get all the subclasses of a class.
Continue reading ‘Ruby’s ObjectSpace: Subclasses’

20Aug08 Oooh Shiny! Magpies don’t know what’s just enough!
Just Enough Programming
0 Comments

I’ve done it.  I’ve been guilty of ooh shiny development.  You know, those projects where you use the latest and greatest library, tool, or infrastructure not because it’s the best thing to do but because it’s the cool thing to do. Continue reading ‘Oooh Shiny! Magpies don’t know what’s just enough!’

19Aug08 rspec, restful_authentication, and login_required
rails tips
6 Comments

This is partly for myself, and partly for anyone after me…..

I have a controller generated via rspec_scaffold — yes, I know, it might not be what all the cool kids are doing, but it works.  I also have restful_authentication set up to use rspec.  So, when I go to add before_filter :login_required, autotest frowns at me.  After much trial and error, and googling (with false hits and things that didn’t work), I finally achieved a smiley face with the following added to my controller’s spec:

  before :each do
   @current_user = mock_model(User, :id => 1)
   controller.stub!(:current_user).and_return(@current_user)
   controller.stub!(:login_required).and_return(:true)
  end
  fixtures :users
19Aug08 autotest reminder (or why did it go boom?)
gotchas rails ruby tips
0 Comments

autotest / zentest are really useful tools.  However, it’s important to remember to run migrations for the test database — otherwise your tests will fail (miserably!)

I’ve found the following to be helpful for using autotest:

  • Getting started with Autotest – Continuous Testing
  • Autotest RSpec Notifications for Ubuntu « My Pragmatig life
19Aug08 Computer Books which have made me who I am….
books Computers
0 Comments

We all have our favorite books, the ones which we won’t let them pry away from our fingers until they’re cold.  Those books which have shaped us, molded us, made us.  The ones for which we’ve bought the first, second, third, and fourth editions.  And not just because you’ve “gotta catch them all”, but because you genuinely enjoy the book and want to keep up to date with it.

Here are some of mine:

Continue reading ‘Computer Books which have made me who I am….’

18Aug08 7 Ruby tools which are gems and why I like them
ruby
1 Comment

Rubygems, those magickal behind-the-sceneslibraries we all use without thinking too much about them deserve some love.  I’m singing the praises of 7 rubygems out of those installed on my laptop (this isn’t to say that I love them more than others). What are some of y’all’s favorite gems?

Continue reading ’7 Ruby tools which are gems and why I like them’

17Aug08 .irbc contents
Uncategorized
2 Comments

I think that irb is one of the most useful tools in the rails toolbox. It allows me to quickly determine how something works, sample results (for putting into blogs, don’tcha know) and makes me a more effective ruby developer.

One of the nice things about irb is it’s .irbrc file where you can place startup commands.  I’d like to share mine (and ask for others to share their favorite .irbrc tools/contents.

Continue reading ‘.irbc contents’

15Aug08 Just Enough Programming: The missing cornerstone
Just Enough Programming programming
0 Comments

I was just speaking with a coworker about JEP. In the course of our conversation I realized that in my list of the foundations of JEP, I had left off what is perhaps the most important one of all — Pragmatism. If I were to sum up and explain JEP in one word it would have to be pragmatism. Pragmatism implies using sensible solutions to solve problems. Pragmatism stresses being practical over principles or ideologies.

In short, are we trying to solve problems, or are we building edifaces to what Neal Ford refers to as the programming priesthood?

 
Browse Archives »
  • administrivia (6)
  • books (1)
  • Computers (2)
  • css (3)
  • eating crow (1)
  • games (1)
  • glassfish (1)
  • gotchas (18)
  • howto (2)
  • idiocy (3)
  • javascript (4)
  • jboss (6)
  • jruby (7)
  • Just Enough Programming (7)
  • life hacking (2)
  • mini sagas (1)
  • miscellany (1)
  • monitoring (1)
  • mysql (1)
  • philosophy (4)
  • php (1)
  • programming (17)
  • rails (7)
  • rants (2)
  • refactoring (1)
  • ruby (14)
  • tips (9)
  • tools (2)
  • torquebox (1)
  • Uncategorized (9)
  • UNIX (1)
  • utilities (3)
  • web (5)
  • web design (3)
 

Latest

  • JBoss Client Jars for Messaging
  • rsh hates nohup
  • Torquebox and Cygwin: Take I
  • Rails & JRuby in a Jar
  • Fractal Terrain Generation
  • Quick thought on programming and distractions
  • Using jnp as a JBoss heartbeat
  • z-index and events
  • JBoss port confusion
  • SSL Joys

Flickr

layout_newm3headerTerrain Testa

Blogroll

  • Development Blog
  • Documentation
  • Plugins
  • Suggest Ideas
  • Support Forum
  • Themes
  • WordPress Planet

Search

Browse by Category

  • administrivia (6)
  • books (1)
  • Computers (2)
  • css (3)
  • eating crow (1)
  • games (1)
  • glassfish (1)
  • gotchas (18)
  • howto (2)
  • idiocy (3)
  • javascript (4)
  • jboss (6)
  • jruby (7)
  • Just Enough Programming (7)
  • life hacking (2)
  • mini sagas (1)
  • miscellany (1)
  • monitoring (1)
  • mysql (1)
  • philosophy (4)
  • php (1)
  • programming (17)
  • rails (7)
  • rants (2)
  • refactoring (1)
  • ruby (14)
  • tips (9)
  • tools (2)
  • torquebox (1)
  • Uncategorized (9)
  • UNIX (1)
  • utilities (3)
  • web (5)
  • web design (3)

Browse by Tag

  • 1.2.6
  • 2.1
  • administrivia
  • autotest
  • books
  • controller
  • css
  • feed-normalizer
  • feeds
  • gotchas
  • idiocy
  • irb
  • Java
  • javascript
  • jboss
  • jruby
  • just enough programming
  • mini sagas
  • open-uri
  • philosophy
  • php
  • pragmatism
  • programming
  • quotations
  • rails
  • rants
  • reading
  • restful_authentication
  • rspec
  • rss
  • ruby
  • rubygems
  • scriptaculous
  • setup
  • simplicity
  • sprites
  • statemachine
  • tips
  • treetop
  • utilities
  • web
  • web design
  • websense
  • yaml
  • zentest

Browse by Month

  • November 2010 (1)
  • August 2010 (1)
  • June 2010 (1)
  • March 2010 (1)
  • September 2009 (1)
  • August 2009 (2)
  • July 2009 (2)
  • May 2009 (1)
  • April 2009 (1)
  • February 2009 (4)
  • January 2009 (2)
  • December 2008 (2)
  • November 2008 (5)
  • October 2008 (3)
  • September 2008 (12)
  • August 2008 (28)
 
 
  • Blog
  • About
  • Chibi
  • Ruby Blender
  • Archives
  • Log in
 


Theme Design by Jay Kwong | Powered by WordPress and K2

 

Home Top Archives Entries FeedComments Feed