Posted by Jeremy Voorhis
Tue, 09 Jan 2007 19:30:00 GMT
or, awk’s not dead
At Values of n, we branch our codebase to create a safe environment for experiments or non-trivial changes to Stikkit. After spending a week on the east coast for holidays, I had the cough pleasure of merging over a weeks’ changes into my branch to keep current.
In my first approach, I tried merging everything at once. I ended up catching a multitude of conflicts – some of which made no sense since I was missing a weeks’ worth of context in a fast-paced environment. Clearly that was not the way to go.
My second attempt: divide and conquer. Using our revision history to look up changesets, I merged a day’s worth of changes at a time. Because a small number of issues tend to prevail on any given day, this allowed me to deal wih actual conflicts as they came. Actual, meaningful conflicts as opposed to conflicts in binary files or code I haven’t touched.
For reverting and resolving files I had no interest in, I learned the smallest bit of
awk.
svn st | awk '/^C/ { print "svn revert " $2 | "sh"; print "svn resolved " $2 | "sh" }'
This handy one-liner finds all conflicted files from the output of
svn status, reverts them, and resolves them, allowing me to proceed. Other
awk invocations resolved conflicts for a particular set of files by copying them from another directory and resolving. Familiarity with tools like
lex and
racc made
awk a cinch to learn and more useful than I would have guessed.
Open question: what small-time automation do you rely on to support regular development?
9 comments
Posted by Jeremy Voorhis
Thu, 28 Dec 2006 20:46:00 GMT
As you might guess, I’ve been tremendously busy between launching Stikkit, running my first Craft Workshop (a success!), writing a book, and keeping up with holiday plans. I’m breaking the silence, however, with a short list of THINGS I FIGURED OUT.
- I’m 100% more productive when I’ve had my morning coffee. Bad sign?
- When working from home, I can use the time spent commuting to catch up on my reading. I’m currently reading On Certainty by Ludwig Wittgenstien and a novel by Salman Rushdie.
- While we usually wear a t-shirt and jeans at the office, occasionally wearing a necktie feels good.
- One-on-one training and teaching a group are two vastly different activities. A good way to keep things flowing is to pair up students who can help each other.
- Stikkit is great for travel plans. Pasting in my JetBlue itinerary and inviting friends and family just works.
1 comment
Posted by Jeremy Voorhis
Thu, 02 Nov 2006 16:36:00 GMT
In my workshop, Understanding Web Architecture Through Ruby on Rails, I will delve straight into web architecture before discussing Rails at all. Here are 5 reasons why:
You should study web architecture if you want to…
- get a fresh perspective on Rails, and a better understanding of how the components of the model-view-controller pattern can fit together in a web framework.
- strive for coherence and good style at all levels of your application.
- share meaning with your users by exposing your domain model clearly to your users.
- learn how to take advantage of HTTP’s functionality and semantics, without spending days combing over RFCs.
- make applications that are available to agents other than web browsers, like feed readers or 3rd party apps, without duplicating code.
2 comments
Posted by Jeremy Voorhis
Wed, 18 Oct 2006 15:22:00 GMT
Most Rails projects that I work on these days are on some revision of edge Rails, depend on a few plugins and a development team of more than one. To keep up with the changes, I run the doc:rails and doc:plugins tasks semi-frequently, and I always make an effort to document the application code I write for posterity’s sake.
To make the documentation more usable – for myself, anyways – I created a task called doc:all that compiles the documentation for Rails, plugins and application code in one place. By doing so, I can usually find what I’m looking for quickly by using Ctrl-f find in my browser. Perhaps you’ll find this Rake task useful too.
As an added bonus, the task will use Jamis Buck’s RDoc template as seen at rails.rubyonrails.org if it is available at RAILS_ROOT/doc/jamis.rb. Enjoy.
Files
4 comments
Posted by Jeremy Voorhis
Tue, 17 Oct 2006 15:37:00 GMT
As of yesterday, I am officially a member of Values of N.

I’ve been tasked with building up the infrastructure of Stikkit, the “little yellow notes that think”. Stikkit is a remarkable personal information-wrangling product, but you don’t need to take my word for it. On 7 November, Stikkit will takeoff from the Web 2.0 Conference Launch Pad.
Values of N was founded by Rael Dornfest and is based here in Portland, OR.
I’m fortunate to be on a wonderful team with some highly talented and motivated individuals. Their enthusiasm is contagious.
Anticipating some questions that may arise, here is my professional status.
5 comments
Posted by Jeremy Voorhis
Mon, 16 Oct 2006 17:14:00 GMT
Today is 16 October, and the last day for early registration for Craft: Understanding the Web Through Ruby on Rails. Early registration is set at a low $350, but will climb to $450 tomorrow.
If you or your team want to deepen your understanding of Ruby on Rails, domain modeling and web architecture, and benefit from some guided hands-on experience, I advise you to register today!
no comments
Posted by Jeremy Voorhis
Wed, 11 Oct 2006 17:38:00 GMT
I am hosting a Ruby on Rails workshop titled Understanding Web Architecture Through Ruby on Rails here in Portland, Oregon on 9-10 November. If you are deciding whether or not to attend, but are unsure what it’s all about, allow me to explain.
Many developers encounter Ruby on Rails for the first time via the numerous screencasts and tutorials that are available. Without doubt, this media demonstrates the productivity of Ruby on Rails, but within a limited realm. Application design is not always trivial, and it is easy to paint yourself into a corner with a new technology. Understanding Web Architecture… jumpstarts your Rails development career by giving me an outlet to share knowledge I have accumulated the hard way.
Understanding Web Architecture… also goes beyond the basics to focus on RESTful application design, what benefits it brings, and how it can be implemented in your Ruby on Rails applications from the start. I will be discussing domain modeling techniques, and how domain modeling can be applied to the higher level of web resources. To demonstrate the power in this approach, we will build a simple time-tracking application with both a browser interface and extend it to expose a web services api.
Finally, what sets this workshop apart is not an emphasis on familiarity of the Rails api, but a deeper understanding of how it works, what ideas have shaped it and where it may be going.
See you there!
2 comments
Posted by Jeremy Voorhis
Wed, 04 Oct 2006 15:41:00 GMT
Portland, Oregon is fortunate to have a beautiful Ruby users group, and last night’s meeting confirmed that to me even more. For those of you who couldn’t be there, or would simply like to peek inside, here is a quick summary.
Mercurial
John Labowitz clued us in about Mercurial, a decentralized scm tool in the same class as Darcs and BZR. The tool is still rather young, but seems to be improving rapidly. After covering some of its features and their usage, John deployed a Rails app from a Mercurial repository with a relatively simple Capistrano recipe. After listening, here is my take on Mercurial:
- Decentralized – every working copy is a branch
- Patches may be cherrypicked a la Darcs
- Commands and output mirror Subversion when reasonable – svn users should be at home with the command line tool
- Changesets are given a local revision number, for those of us who still think in Subversion
I’ve not used decentralized scm for programming-in-the-large, but have been using Darcs for one-off personal projects. Next time, I’ll kick the tires on Mercurial myself.
OS X Sync Services
Ben Bleything gave a talk about implementing Ruby applications that use Apple’s Sync Services. (I am not an OS X hacker myself, and I was mostly satisfied when Ben said Sync Services is like the windows registry, but for data.)
A Sync Services application typically has its own data store, but subscribes to updates from Sync Services and occasionally publishes its own. The examples that Ben showed involved observing the changes pushed by Sync Services via Growl notifications, and manipulating OS X address book entries via Ruby.
The examples also gave us a taste of Ruby/Cocoa; if there is a wrapper for the library you need, things are good. If not, you need to fire up the Objective-C documentation and translate the interface to something the Ruby/Objective-C bridge can understand. (Ben, help me out if I’ve messed anything up :)
Craftsmanship
After the talks, the group faithfully migrates to the Lucky Lab brewpub. Informally, I got a chance to talk to some fellow group members about the Rails workshop I will be holding in November. The name I have chosen for the series is Craft, referencing the passionate developer’s sense of craftsmanship as well as his desire to create.
Eric Wilhelm, joint member of PDX.rb and the Portland Perl Mongers, brought it to my attention that the last PDX Perl Mongers meeting held a panel on craftsmanship. The panel included Bricolage developer and esteemed acquaintance David Wheeler, bicycle machinist Dan Falck, and science fiction author David D. Levine. The podcast is available via the meeting page.
Props for taking the interdisciplinary approach!
Posted in PDX.rb, Ruby | 6 comments