RVM, Bundler and Ruby Tracker
August 11th, 2010
Lightning Talk at rorosyd
Here are the slides from a lightning talk I gave at rorosyd last night. Having found RVM, Bundler and Ruby Tracker to be a useful set of tools this year, I thought I’d take the opportunity to share my experiences. And, as I mentioned during the talk, kudos to Mikel Lindsaar for his blog post earlier this year which alerted me to the power of creating a .rvmrc file.
Ten Years On
February 10th, 2010
Ten years is a long time in technology.
Recently, on New Year’s Day, whilst waiting for the Spirit of Tasmania to leave Devonport after a family holiday, I was killing time on Twitter. Several tweets with the tag #10yearsago set me thinking. For a start, ten years ago I’m sure I wouldn’t have dreamed of using an application like Twitter on a device like an iPhone.
Turning my thoughts back in time, I wondered what was significant about my programming career at the turn of the century? After a little thought and stroking of my greying beard my response was that 10 years ago I was leaving mainframes behind and about to enter the world of EJBs. For me that was quite a milestone. After earning a living within the realm of IBM mainframe programming since 1983 and delving into object-orientation and the emerging world of web development during the 1990s, the transition to working full-time with Servlets and Enterprise JavaBeans was an exciting step.
Fast forward to the present and it would appear that I have left the Enterprise Java world behind. Over the last couple of years I haven’t used Java in anger, instead using Ruby as my language of choice in conjunction with frameworks like Rails and Sinatra for developing web applications.
You may have noticed that I’ve only mentioned server-side technologies so far. This is not just because I have felt more at home developing server-side rather than client-side software. When I started down my path of developing web applications, JavaScript was the subject of scorn for valid reasons that I won’t elaborate on here. However, in 2010 I can see that JavaScript is definitely growing in importance. Developer-friendly libraries such as JQuery that have been well tested on all major browsers have changed what JavaScript brings to the table. Ajax has earned it’s place in web applications. RaphaĆ«l is an example of sexy visual effects that can be added to a site via a JS library.
So I have becoming aware that I need to focus more on improving my JavaScript skills to better equip me to enhance user experiences of web applications via JS that runs in a web browser.
But it turns out that my reasons to learn more about Javascript aren’t confined to web browsers. Late last year I became aware of Node.js, which enables the development of event-driven servers using JavaScript. I’ve barely scratched the surface but I know that others, like Simon Willison, are very excited by Node.
Meanwhile, I’m going back to fundamentals and have started reading PPK on JavaScript to give me a more solid basis on which to build my JS skills.
So ten years since I left mainframes behind to enter the world of EJBs I love programming in Ruby and am giving more focus to JavaScript. As for trips down memory lane, maybe another time I’ll write about the technology I was using 20 years ago…
Configuring CapGun
October 10th, 2009
I’ve long been a fan of Capistrano, the Ruby deployment tool that is typically used for deploying Rails applications. And I’ve also been impressed by the work of Glenn Vanderburg and his colleagues at Relevance. So I took notice when I recently read about CapGun, which is useful for sending email notifications whenever a project is deployed.
The point of this post is that very recently I had the opportunity to install and configure CapGun for a client. The blurb on github told me how to install and configure CapGun. Under the heading of Usage I was encouraged to read the first paragraph:
Good news: it just works.
Well, almost. CapGun does “just work” once you’ve configured it correctly. Included in the config sample to be added to deploy.rb was:
# define the options for the actual emails that go out -- :recipients is the only required option set :cap_gun_email_envelope, { :recipients => %w[joe@example.com, jane@example.com] }
Unfortunately this was not quite complete enough for CapGun to work. Instead it died deep in the bowels of net/smtp.rb:
/usr/local/lib/ruby/1.8/net/smtp.rb:930:in `check_response': 555 5.5.2 Syntax error. 7sm1592402qwb.55 (Net::SMTPFatalError) from /usr/local/lib/ruby/1.8/net/smtp.rb:899:in `getok' from /usr/local/lib/ruby/1.8/net/smtp.rb:828:in `mailfrom' from /usr/local/lib/ruby/1.8/net/smtp.rb:653:in `sendmail' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:684:in `perform_delivery_smtp' from /usr/local/lib/ruby/1.8/net/smtp.rb:526:in `start' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:682:in `perform_delivery_smtp' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `__send__' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `deliver!' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `method_missing' from ./vendor/plugins/cap_gun/lib/cap_gun.rb:70
The lesson was that the :cap_gun_email_envelope needed to be configured with :from as well as :recipients. And the good news is that the people at Relevance have just accepted my documentation patch.
And the even better news is that now CapGun does “just work”. It’s a very handy tool for keeping everyone in a team informed about deployments in an automated and timely manner.
Inspirations for a Ruby DSL
September 6th, 2009
Recently, during discussions with a client about reducing the amount of boilerplate coding that recurs from time to time in the project, the idea of developing a Domain Specific Language (DSL) arose. If you’re wondering what a DSL is, here is what Martin Fowler has to say. Or, you may prefer this cheeky piece from Dr Nic Williams.
I’ve been intrigued by DSLs for some time but not had the motivation to develop one until now.
In preparation, I’ve gathered a list of resources for writing a DSL in Ruby.
Tutorials
- Russ Olsen’s two part article
- Chapter 16 on DSLs in Russ Olsen’s “Design Patterns in Ruby” book
- Mischa Fierer’s three part article about writing a clean Ruby DSL
Examples
- Pete Yandell’s machinist
- Javan Makhmali’s whenever, which provides a clean Ruby syntax for defining cron jobs
- Ben Schwarz’s smoke (also see this video)
- Marcus Crafter’s sprinkle (also see this presentation)
- Cucumber, the behaviour driven development DSL
I’m happy with that list of resources but if anyone has any other suggestions please feel free to comment.
My next challenge is to think about the problem domain and design an elegant syntax.
At Your Service
July 28th, 2009
Yes, currently I have hours free in my diary to be of service.
A web application development project that has been keeping me busy for a good part of the last year and a half appears to be reaching the point when the application will be launched in the very near future. I hope to be in a position to write more about that project soon.
Meanwhile, if you, your company or someone you know needs the services of a software developer with a passion for solving problems and helping people with software please get in touch. Maybe you already have an idea that needs to be transformed into software. Maybe you have problems with your existing software that need to be fixed. Or perhaps your software project needs more effective management. With more than 25 years of experience in the software industry there is a good chance that I can help. Elsewhere on this site you can find more information about my professional background and the sort of services I provide.
I look forward to hearing from you!
Navigation
Latest Blog Posts
- 11 Aug: RVM, Bundler and Ruby Tracker
- 10 Feb: Ten Years On
- 10 Oct: Configuring CapGun
- 6 Sep: Inspirations for a Ruby DSL
- 28 Jul: At Your Service
Syndication
Tags
actionwebservice automated testing bdd blog bundler capgun capistrano collaboration css cucumber deployment dsl estimating jaoo javascript osdc osdc2008au pdf prawn rails railscamp rake rest rorosyd rspec ruby ruby tracker rvm selenium services syntax highlighting tdd technology unconference wds08 web design webrat xml xml-rpc