June 20th, 2007

June Phoenix Rails Users Group - Alternative Ruby Web Frameworks

Tonight Jade and I gave a presentation on Alternative Ruby Web Frameworks at the Phoenix Rails Users Group. He kicked us off by showing how easy it was to build an application in Camping. I then followed up by showing off my new favorite framework, Merb. Both frameworks were a hit, and led us into a great conversation afterwards about when you might want to consider using an alternative to Rails.

While I don’t have any slides to upload, I do have a few resources which I found useful. The first of which is Ezra’s slides on writing custom Mongrel Handlers. I had the opportunity to see this presentation at SVRC which is what really turned me on to this framework. He does a great job explaining some of the weaknesses of Rails as well as why the need for Merb exists.

Once you’ve drank the kool-aid you’ll want to check out the development site. Here you’ll be able to keep up with all the latest changes as well as get instructions on how to check-out and build your Merb GEM from source (very important with a framework thats changing as fast as this one). Also, while you’re here be sure to download and check out the Merb sample app, mrblog.

After you’ve installed Merb you’re going to want to walk through Zack Chandler’s excellent tutorial and example app. He does a great job walking you through everything you need to know to hit the ground running.

If you get through all that and still have questions, which you probably will, hop onto #merb on Freenode. The channel is active and the community is quite friendly and willing to help.


Thanks again to everyone who came out to support the local Rails scene. Please join us next month where we’ll be talking about the Joys and Pains of ActiveScaffold!



May 19th, 2007

Rails Resources

While at RailsConf Jade and I managed to throw together a quick teaser for a new site we’re working on.

We hope that Rails Resources will grow to become a valuable resource for aspiring Rails hackers.

More details to come over the next two weeks.



April 13th, 2007

ZenTest 3.5 + RSpec 0.9 = AutoSpec

One thing I find with developers who are new to writing tests/specs is that they will often forget to run the test suite prior to checking in their changes. When you’re developing by yourself this is one thing, but when developing on a large team this can often cause shame and ridicule when you break the build. Ryan Davis has attempted to solve this problem which a great tool called autotest, which is part of the ZenTest suite of tools.

Autotest is a script which runs in the background monitoring your source directory, automatically running your test suite when it notices a file has been modified. This is a huge productivity gain as it allows you to focus on writing code and not have to worry about switching contexts to run your tests/specs.

Prior to the latest version you were required to install an additional plugin if you wanted to use autotest on your Rails project with RSpec (you are writing specs right?). Thankfully version 3.5 of ZenTest now includes a RSpecRailsAutotest runner which will monitor for changes in your Rails source and run the appropriate specs.

Unfortunately this first pass at RSpec support assumes that you have the gem installed, and doesn’t work if you’ve decided to include rspec and rspec_on_rails into your vendor/plugins directory. Thankfully due to the extensible nature of autotest this problem is easily fixed by adding the following to your ~/.autotest file:

1
2
3
4
5
6

Autotest.add_hook :initialize do |autotest|
  if autotest.is_a? RspecRailsAutotest
    autotest.spec_command = 'script/spec --options spec/spec.opts' if File.exist? 'script/spec'
  end  
end

This will force autotest to use the spec command that is installed within the script/ directory of your Rails project as well as have it use the options defined in spec/spec.opts.

Note that this assumes that you are using RSpec version 0.9 which includes the script/spec command. If not you’ll need to modify the spec_command line above to point towards vendor/plugins/rspec/bin/spec.

Happy (Auto)Specing!



October 28th, 2006

Desert Code Camp II

I had the opportunity to attend/speak at the fall Desert Code Camp today. Attendance at each of my talks was good, and the overall feedback was encouraging. I was up until 5:30 a.m. preparing, so I definitely appreciate the kind words. For those of you who attended I thank you, for those of you who couldn’t make it feel free to buy me a beer and I’d be more then happy to walk through my example app.

Full example source code can be downloaded from my public svn repository at http://svn.joshknowles.com/projects/contactulous/. The rake tasks I demoed can be found at http://svn.joshknowles.com/projects/plugins/rake_tasks.

Thanks again to Lorin for all his hard work putting this together. This guy definitely deserves a huge thank you for all the time he puts into supporting the development community.



September 25th, 2006

Microsoft Web Development Summit

I had the opportunity to travel up to Seattle to spend the last half of the week at Microsoft attending a Web Development Summit with a small collection of open source hackers. This was a unique and interesting 2 day event in which we were given the opportunity to interact with the members of the DevTools team as well as critique some of the upcoming web development technologies. I was a little leery coming in as I wasn’t sure what to expect, but I was pleasantly surprised that at no point during the event did I feel like I was being given a sales pitch or being asked to make the switch. While I myself don’t develop on Windows, many members of the Rails community do, thus by getting the opportunity to speak directly with the IIS and Visual Studio teams I am attempting to do my part to make Windows a viable platform for both development and deployment of Rails based web applications.

The thing I enjoyed most about this event was the people, both the attendees as well as speakers. With a non-Microsoft attendee count of around 20 we had the opportunity to interact in a much more casual, intimate atmosphere then at a normal conference. Of these 20 the vast majority were PHP hackers including core-developers, speakers and authors. This was the first chance I’ve had to interact with anyone from the core PHP community and I have to say that I was quite impressed with their level of technical knowledge and pragmatism. In addition to this elite group of PHP gurus, also in attendance were Jason Gilmore (Open Source Editorial Director for Apress), Andrew Stopford (MbUnit maintainer and fellow TDD junkie), Keith Elder (self-proclaimed Dot Net Pimp), Christopher Schmitt (CSS God), John Bland II (fellow Phoenix hacker and all around Geek), Reg Charmy (Editor of Web 2.0 Central), Tim Heuer, Drew and Dave Bost (all Microsoft Developer Evangelists) as well as many others whose blogs I didn’t happen to get.

Microsoft definitely took this event seriously, and pulled out the big guns when it came to organizing the speaker line up. We had the privilege of being able to converse with industry legends such as Anders Hejlsberg, Don Box and Scott Guthrie. To complement this amazing lineup we also had access to the technical leaders for all of the major development teams (IE, IIS, Atlas, SQL Server, etc) and I was able to discuss getting official support for Rails development/deployment on both SQL Server as well as IIS. In addition to coming to the regular sessions Scott, Brad and many others even made themselves available during the after-hours events and were genuinely interested in our opinions in the current product line as well as what they could learn from the open source communities we represented. As a whole these guys have an intense technical understanding of the products they manage. In many cases they understand the competitive technologies, such as Rails and PHP, at a level higher then many of developers I come across. It always amazes me at the level of technical abilities that these Microsoft managers have been able to retain. They are a group of extremely passionate geeks who have managed to stay technical as they love what they do.

As far as the technologies being presented; I was impressed at times, bored at others. The organizers did a good job pulling together a wide variety of content, unfortunately there was a bit of overlap at times which I guess is to be expected when you have 12 technical sessions compiled by 12 different people. The only session which I completely zone out in was Workflow; not to say this isn’t a cool technology, or that the speaker did a poor job, it just wasn’t something that I’m interested in nor did I see the relevance to the event.

This event was it was completely jam packed, from 8 a.m. until 10 p.m. The side effect of this was that while I had hoped to take proper notes and blog along the way, but I never really had a chance to sit down and collect my thoughts. Below I’ve done by best to recall my thoughts on the majority of the technologies which we were shown in no particular order.

The most impressive session was on LINQ, which is technology which I’ve seen before. This query language continues to peak my interest as I’m very impressed with the ability at which it can combine disjoined data-sources, such as XML and SQL, through a natural easy to understand syntax. It was great to have Anders give this presentation as he took a bit of a different spin on it then when I saw Scott give it the week before. If you are doing any kind of database querying or XML parsing using Dot Net 2.0 I would definitely recommend downloading and checking out this cool new technology.

Atlas (to be re-named to something silly and utterly unrememberable) is another technology which I’d seen before, but am still very interested with. If you are an ASP.Net developer I highly recommend utilizing this library. Unfortunately I still see no real reason for those of us not using Microsoft technologies (ASP.Net / Visual Studio) to use this over something like Prototype/Scriptaculous, but I plan to keep an eye on it non-the-less.

For you designers in the crowd you should definitely check out the Expression Web Designer. Unlike Frontpage, this looks like a tool which a professional could actually enjoy using. This time around they have built with a strict adherence to XHTML/CSS which has resulted in a tool which I believe will be a true competitor of Dreamweaver.

The IIS team has come a long way since the 5.0 days. It appears as if they have totally overhauled the existing code-base to make way for a completely modularized architecture in which will allow for technologies such as Ruby and PHP to easily plug-in. I really liked the easy to use config UI which will allow you to manage remote sites over HTTP. I was also impressed with the ability to set per site/directory settings using a web.config file, this will allow for much easier deployment into a shared-hosting environment.

The IE 7 team stood up and apologized for the fact that they haven’t really done much over the last 5 years. That said, IE 7 is shaping up to be a great tool and has definitely come a long ways since the current revision. There are some features in there which are definitely copies of Firefox, and others which are original and very impressive. This update should definitely bring back some much-needed competition into a market in which tabs have been the only real innovation in the last 5 years. One thing to note is that it will be distributed via Windows Update to XP (SP2) machines, so if you’re a [Windows][] user make sure to keep you’re eyes peeled to the system-tray for that update icon during Q4 of this year.

In the areas of dynamic languages Microsoft is still weak, but Jim Hugunin has done an amazing job on Iron Python and they appear to be heading in the right direction. My only complaint with this session was that Jim focused the Q&A time entirely around PHP and basically blew off my questions of when we would see official support from Microsoft for additional dynamic languages such as Ruby.

While the above mentioned talks were great, the most entertaining session had to be when Don Box discussed “Why Microsoft Sucks”. During the open-forum Don asked the crowd what Microsoft could do to better enhance the developer experience. After a series of legitimate suggestions; such as true SSH access, getting rid of the registry, proper console and scripting support someone threw out “make it free”. Don then went into a tirade (in jest of course) in which he said, “F@k you! F@k you! F*@ you! I have a family to feed, do you want to see them on the street? Is that what you’re asking for?” This was a truly hilarious response to a silly remark, and definitely a nice break from the technical demos.

In addition to all of these sessions we heard about CodePlex (cool), WorkFlow (boring), CardSpace (cool), WCF (cool) as well as many, many others. Check some of the additional trip-notes provided below for additional technical details as well as others opinions on this unique event:

So with all of this excitement over [Micrsoft][] technolgies there are those of you which may be questioning my loyalty and direction moving forward… Well fear not my fellow Rubyists for I have no intention of trading in my PowerBook and copy of TextMate for VisualStudio. I do however appreciate the willingness of everyone I met to listen to, and engage with, the Open Source development community. Microsoft appears to be moving in the right direction which in the end will help all web developers, Microsoft or not. Overall I came away from this event with much greater respect for the Microsoft development teams and hopefully was able to peak the interests of a few key people to get proper support for Rails on IIS and SQL Server. Many thanks to Sanjoy and Tanya for putting on a great event, as well as to Tim for the invite. I look forward to coming back in the spring to see the results of our feedback!



August 14th, 2006

Development Environment

Recently Robby convinced me that I should be using DarwinPorts as opposed to the src based configuration that had worked so well for me in the past. So with the help of a few good tutorials I deleted my /usr/local/ directory and made the plunge. After about a week now, having fully played with the new environment, I’ve got to say that if you haven’t tried out DarwinPorts you really should take the time to switch. I know it seems a bit odd that all your files are in this weird /opt directory (at least it was for me), but trust me the dependency management and install/update process is definitely worth the switch.

What follows is a brief recap of my installation process. Nothing here is original, it is all derived from the articles mentioned above, I just wanted to consolidate the information for my own archiving benefit.

Note: The following assumes you are running Mac OSX 10.4 (Tiger)

Install Xcode

Install the Application Image available from the Xcode section of the Apple Developer Connection website (ADC login required).

Install DarwinPorts

Install the Application Image available from the Downloads section of the DarwinPorts website.

Update PATH

echo ‘export PATH=”/opt/local/bin:/opt/local/sbin:$PATH”’ >> ~/.bash_profile

Update DarwinPorts

sudo port selfupdate

Install Ruby & Required RubyGems

sudo port install ruby
sudo port install rb-rubygems
sudo gem install -y rake
sudo gem install -y capistrano

Install RubyCocoa

sudo port install rb-cocoa

Install SQLite

sudo port install swig
sudo port install sqlite3
sudo port install rb-sqlite3

Install MySQL

sudo port install mysql5 +server
sudo port install rb-mysql5
sudo mysql_install_db5 –user=mysql
sudo launchctl load -w /Library/LaunchDaemons/org.darwinports.mysql5.plist

Secure MySQL

cat /etc/my.conf
[mysqld]
skip-thread-priority
skip-networking

Install Subversion

sudo port install subversion +tools

That’s it for now. I’ll update soon with lighttpd, Mongrel, etc. (currently I’m going old-school and running all local dev off of Webrick).

[Update 08/15/2006: Added install of RubyCocoa]



May 30th, 2006

Agile Development with Ruby on Rails

I’m going to be giving a workshop entitled Agile Development with Ruby on Rails June 3rd & 10th in Coeur d’ Alene, ID. This is an invite-only event sponsored by the good folks at Radsoft. If you’re going to be in the Spokane/CDA area, and are interested in attending, please let me know and I’ll try and secure you a spot.

Full details below:

Agile Development with Ruby on Rails

  • Two-Day Ruby on Rails workshop
  • 9:00am - 3:00pm, June 3rd/10th, 2006
  • Radsoft Office, Coeur d’ Alene, ID
  • Invite-Only, Free to attend, Lunch Provided
  • Bring-Your-Own-Laptop
  • Contact Josh Knowles for more details