Skip to content

{ Category Archives } Ruby

learning Ruby

Rails Rumble 2010

Wow, that was incredible fun.  Andrew Kavanaugh and I holed up in a Vegas hotel for the entire weekend to crank out a Rails application www.transcriptify.com for Rails Rumble. We were http://railsrumble.com/teams/double-down. We were so busy, we still haven’t put one penny in a slot machine yet.  This was also my very first rails application.  We created [...]

blenderfarmers.com

My brother Doug went to Full Sail film school and has recently gotten me into the hobby of making shorts in our fun time (www.simplemindedstudios.com).  Currently, we are making a short using my children as the actors.  We don’t have access to very many interesting places to film so we decided to create most of the sets [...]

Ruby ‘here document’

Ruby has a cool feature that allows you to embed a document inside your source code.  This is known as a ‘here document’.  The traditional way of defining a string is to assign a variable as follows: def myfunc mystring = “Here’s a great quote: \n\n\”We hold these truths to be self-evident, that all men [...]

Compiling wxruby on Snow Leopard

I am trying to compile wxruby on Snow Leopard.  I am running into issues because wxwidgets 2.8 which wxruby 2.0.1 is based upon only compiles in 32bit mode.  I can compile wxwidgets 2.8.11 using 32 bit mode.  When I try to compile wxruby, I get errors.  I’m not quite sure what I need to do [...]

Native Looking Mac App with Ruby

Ruby is really popular to make websites because of Rails, but I want to write a native looking application using Ruby.  I’ve discovered wxruby which is a really cool cross platform GUI library for use with Ruby.  It is built on wxWidgets which is a C++ library for making cross platform GUIs that appear native because [...]

Ruby on Rails Plugins

Not sure if this is worth doing or not since these ruby plugins change so frequently, but here are a list of plugins that I find interesting as a java guy coming up to speed in ruby on rails. Referential Integrity script/plugin install http://svn.hasmanythrough.com/public/plugins/validates_existence/ From “Learning Rails” by O’Reilly.  Page 149 Scaffolding ActiveScaffold.com Geo Coding [...]

HTML Dom in Ruby with Nokogiri

I recently needed to do a screen scrape of a website.  The page I’m trying to parse is marked as an “XHTML 1.0 Transitional”.  XHTML?  Should be easy.  Parse the doc, use XPath and I’ll be done. If you search “xml parser ruby”, the first result you will get is REXML.   I’ve read comparisons that [...]

Simulating a slow network on a Mac

I ran across these very handy commands to simulate a connection of only 4kbps.  This is helpful when developing mobile applications in particular because some cell connections are horrible. sudo ipfw pipe 1 config bw 4KByte/s sudo ipfw add 100 pipe 1 tcp from any to me 3000 There are several interesting parts to these [...]

Ruby on Rails Nested Resources, Namespaces, and RESTful

I am working on a website where I have an admin section to add data and public read only sections.  I like to have a clean hierarchy of URLs.  I first implemented it using the standard generator code.  I had a /restaurants and a /locations url for both.  Locations doesn’t make sense as a top [...]

Ruby on Rails shell commands

This is just a reminder to me about commands that I use. rails appname rake –tasks rake db:create rake db:drop rake db:migrate script/generate controller myobject script/generate model Person name:string age:integer script/generate scaffold Person name:string age:integer