The kleinptr rprt

February 4, 2009

Erubis and Rails 2.2.2

Filed under: rails, Ruby — kleinptr @ 10:18 pm

So, I’ve been trying to get Erubis working on Rails 2.2.2 as part of my job at Yellowpages.  Apparently this is something no one told the internet to take care of for me when the latest release of Rails (2.2.2) came out.  So now its time to unravel the onion.

I’ve actually gotten the thing working, but only in development mode.  Production mode is not so happy.  However, in honor of full disclosure and knowledge sharing, I’m providing the code I have so far.

The hooks for the Erubis code into rails is in a file called rails_helper.rb, I was able to drop all of my code here.  The diff I have should get you running Erubis 2.6.2 in development mode.  However, precompilation (used in production mode) fails, so this is of less help.

The problem I’m havoing is that the view object is no longer available to TemplateHandlers.  I can hack the code (_pick_template in ActionView::Base) to have the view available, however, I haven’t been able to shove it in there when Rails precompiles templates.

The whole thing could be a waste of time.  I’ve done some testing, and I can’t really see any performance difference between ERB in Rails 2.1.1, 2.2.2, and Erubis 2.6.2 on Rails 2.1.1.  (yikes).  There does seem to be less IO with Erubis, but otherwise, I’m not sure yet that its even worth it.

Anyone else out there have experience either getting this working or discovering the performance difference is nil or negligible?

Advertisements

January 20, 2009

It LIVES!

Filed under: Uncategorized — kleinptr @ 3:07 am

ish

April 11, 2008

So many plugins, so little Time.

Filed under: rails, Ruby — kleinptr @ 3:33 pm

Started looking at some Rails plugins on Ruby Lodge last night.  Damn there are too many plugins out there which are interesting.

Schema Definition works similarly to auto-migrations except it actually builds the migration files for you.

Spider Test is an integration test spider which tests all of your page links.

Tarantula tries to break your site with crap form field filling.

Rails Spread is a Ruby messaging bus.

Sliding Session Timeout pushes your session timeout later after each page hit. (ie: its always 30 minutes after your last request)

Benchmark for Rails allows you to benchmark arbitrary methods in your application (like link_to)

Maintenance Server hooks you up with a light app server while your main Rails application is being tweaked by the server monkeys.

Here are a few gems.

MOle tracks user interactions (uses the DB, so not sure about performance)

RScribd is a Ruby library for communicating with Scribd

Anyone have experience with these?  Are they any good?  Why don’t we have a review site for Ruby libraries?  Or code libraries for that matter?

Hmm….

January 9, 2008

Charter Communications Upgrade

Filed under: Uncategorized — kleinptr @ 10:30 pm

I’ve been a Vonage user for about 4 years now.  I’m on the $15 plan since I don’t really use the phone THAT much.  Anyway, I got 2 letters today in the mail from Charter asking me to subscribe to their VOIP service.  The damned thing is terribly over priced ($30), so no way.  But I’m also tired of getting those letters, so I figured I’d give Charter a ring.

Ashley answered the phone immediately, and asked what I needed.  I asked her to stop sending me those VOIP letters, and she took me off the direct mail list.  YAY!

So far so good.  Well, as soon as we were saying our sweet goodbyes, she stopped me, and said they were discontinuing the 3MB service I am on (honestly, I thought I was on 6MB, but whatev).  They’re switching to a 5MB service, and would I like to switch for $1 more.

“Sure” I said.

She said she’d switch me, and oh and by the way, she’ll also drop $10 off my service for the next year.

Hmm…faster broadband, cheaper service, very efficient call if you asked me!

Woot!

Erps…Cocid(o|a)

Filed under: Food, Recipe — Tags: , , , — kleinptr @ 5:53 pm

So, today is my WFH day.  No, really.  Anyway, I got the fixins’ for cocid(o|a) a few days ago and decided since I was home to put it together.  I like to use the slow cooker for soups and such so the flavors really blend well.  I didn’t think about the wonderful smell I’m going to have to deal with all day!  It really is smelling wonderful in here.

Enough about my troubles, on to the soup!

Stuffs:

  • 1lb beef shank (with bone)
  • 1 onion
  • a few small red potatoes
  • a few large carrots
  • 1 can chicken broth
  • fresh rosemary, sage, oregano, whatever you have
  • 1 clove crushed garlic
  • seasonings (salt, pepper, chili powder, etc)

Saute some of the onion with the garlic in a little oil.  Cube the shank and brown it on all sides, seasoning the meat at will.  I prefer to season the meat as a brown because the flavor sticks better.

Once the meat is browned, you can stick it with the garlic and onion in your slow cooker (I mentioned you needed on of those right?).  You can now saute the rest of the onion.  As you’re doing that, put a little water in your pan and scrape those lovely meat remains from the pan.  You really should keep that flavor in the dish.  Add this to your pot as well.

Cut up the rest of the ingredients into large pieces and toss them in as well.  Feel free to season what’s in the pot with salt and pepper, and you can through in your herbs if you want those added flavors.

Now, add your broth and enough water to cover the stuff in the pot.

Set for 8-10 hours and enjoy (or be tortured by) the aromas!

Once its done, serve over rice with tortillas.

Lazysphere is giving me a headache

Filed under: Uncategorized — Tags: , , — kleinptr @ 5:21 pm

I couldn’t agree more with Steve Rubel’s post on the Lazysphere.  Lately I’m just not reading blogs anymore (vs skimming them), because they’re all redundant.  I feel like I’ve seen everything so far.  I’m playing around lately with AideRSS, and, though don’t like their mechanism for reading (they depend on other aggregators so they don’t get huge traffic I suppose), they have the right idea.  Skim through the crap for me so I can get to the good stuff.  It’s just hard to figure out what the good stuff is.  I’m sure Ilya Grigorik has a few ideas about how to do it.

Only problem now is, according to Steve, I’m not sure I should be posting this as I’m just dittoing him.  No biggie I suppose, you won’t be reading this anyway.

January 8, 2008

Now they tell me!

Filed under: Uncategorized — kleinptr @ 5:02 am

If it wasn’t enough that Blu-Ray is winning over all of the studios, now if you have a PS3, all you gotta to get get a Blu-Ray movie onto your PSP is stick in the disc, and attach your PSP and it’ll lap over the data. That’s just PHAT!

Via Kotaku

January 5, 2008

Why to Lose DRM Then?

Filed under: Uncategorized — Tags: , — kleinptr @ 5:31 am

It looks like the last of the big DRM players (Sony-BMG) is joining in with the rest of the kids and scrapping DRM.  I really don’t think they’ve been won over to the freedom of DRM free music, but rather, the capitalism of DRM-free music.  As with vinyl, 8-tracks, tapes, and CDs before, we now have a collection of DRM’d audio which is effectively the latest legacy audio format.  Now, they’re going to get us to all buy all of our lovely music yet again!

Dammit, this is the last time!  As far as I can tell anyway…until they figure out how to make analog quality digital music.

Bah, I’m not having any of it.  Long live the subscription!

December 16, 2007

Where’s my Google Reader API?

Filed under: Uncategorized — kleinptr @ 11:44 pm

I spent a little time today playing with Google’s Ajax Feed API.  Its fine and dandy for doing simple interfaces which don’t require the use of very many feeds.  It also doesn’t require anything but Javascript.

However, towards the end of ’05, there was speculation that a Google Reader API was going to be exposed in the same way they expose their Google Maps API.  I’m working on a new aggregator in my spare time (or at least thinking about doing it), but I don’t wanna deal with all of the scalability issues with pulling down all those damned articles.  I’ve done that before, and its a pain.

The API that exists now is undocumented and unsupported, I’m just wondering if they are going to get around to it.  Its been two years, and I for one am ready for the real thing!

December 15, 2007

Snazzy Snazzy Resource

Filed under: rails — Tags: — kleinptr @ 10:53 pm

Giles Bowkett and I have been hacking together a very nice improvement to ActiveRecord which allows much deeper creation of an ActiveRecord object (it allows associations in the params hash).

This is most useful when using ActiveResource to create your objects.

Get your app snazzy with:

script/plugin install http://snazzy-resource.googlecode.com/svn/trunk/snazzy_resource/

Check out Giles’ post for more lowdown.

Older Posts »

Blog at WordPress.com.