Hobo 0.6.1 released

Posted about 7 years back at The Hobo Blog

Not too bad – only one day later than advertised :-) It’s time to

gem update hobo

or

svn up vendor/plugins/hobo

Not content to fix a few of the problems in 0.6, we’ve added some major new features in 0.6.1

There’s a major overhaul to the Ajax part update mechanism. It’s now more secure and can cope with parts that need access to local variables.

Hobo now supports multiple user models, so you could for example have a separate model for regular users and administrators. Each has its own login and signup pages.

As always, see the changelog for the nitty gritty.

Hobo 0.6.1 released

Posted about 7 years back at The Hobo Blog

Not too bad – only one day later than advertised :-) It’s time to

gem update hobo

or

svn up vendor/plugins/hobo

Not content to fix a few of the problems in 0.6, we’ve added some major new features in 0.6.1

There’s a major overhaul to the Ajax part update mechanism. It’s now more secure and can cope with parts that need access to local variables.

Hobo now supports multiple user models, so you could for example have a separate model for regular users and administrators. Each has its own login and signup pages.

As always, see the changelog for the nitty gritty.

Weblog update

Posted about 7 years back at Revolution On Rails

Hey all I wanted to give you an update:

Three of our active contributors are moving on: Aaron, Eddie, and Val. They plan to stay active in the Rails community, as well as new areas like Facebook. You can follow their work at blog.hungrymachine.com. It has been a great pleasure to work with them and we wish them the best.

Weblog update

Posted about 7 years back at Revolution On Rails

Hey all I wanted to give you an update:

Three of our active contributors are moving on: Aaron, Eddie, and Val. They plan to stay active in the Rails community, as well as new areas like Facebook. You can follow their work at blog.hungrymachine.com. It has been a great pleasure to work with them and we wish them the best.

eRubyCon - Bruce Tate - Ruby on Rails Podcast

Posted about 7 years back at Ruby on Rails Podcast

Robert Stevenson interviews Bruce Tate about Changing the Present and Ruby in the enterprise.
From eRubyCon in Columbus, OH.

Methodphitamine - I'm hooked without even using it

Posted about 7 years back at The Hobo Blog

Now that is going straight into Hobo’s core extensions. Thanks for sharing Jay!

Meaning I can finally get rid of all that omap, oselect nonsense (if you didn’t notice those methods, don’t even ask, it was a bad idea. If you did and you use them - stop!)

Hmmm. Maybe it’s time to make this stuff available in a separate gem. HoboSupport? It’s starting to bug me when I’m in a non-Hobo script and all this stuff is missing.

p.s. Hobo 0.6.1 coming today!

Methodphitamine - I'm hooked without even using it

Posted about 7 years back at The Hobo Blog

Now that is going straight into Hobo’s core extensions. Thanks for sharing Jay!

Meaning I can finally get rid of all that omap, oselect nonsense (if you didn’t notice those methods, don’t even ask, it was a bad idea. If you did and you use them - stop!)

Hmmm. Maybe it’s time to make this stuff available in a separate gem. HoboSupport? It’s starting to bug me when I’m in a non-Hobo script and all this stuff is missing.

p.s. Hobo 0.6.1 coming today!

Ruby Hoedown Videos

Posted about 7 years back at Alloy Code - Home

The Ruby Hoedown conference sessions are now available online from the Confreaks website.

Personally, my top picks for “must view” are:

  1. Using C to tune your Ruby (or Rails) Application
  2. Charity testing workshop
  3. Exploring Merb

Interestingly, while I was listening to Ezra’s presentation on Merb the first time, I kind of missed the point. The real power and purpose of Merb didn’t start sinking in for me until the second day, when I realized that there was a much bigger audience for a thread-safe, ActionPack-decoupled, performance tuned web framework. The validity of Ezra’s talk was reinforced by others, particularly Bruce Tate, who helped push the point home that Rails was just one stop on the Ruby journey. And, of course, it’s especially timely, considering the current dust-up over Pete’s Swanky Framework

Ruby Hoedown Videos

Posted about 7 years back at Alloy Code - Home

The Ruby Hoedown conference sessions are now available online from the Confreaks website.

Personally, my top picks for “must view” are:

  1. Using C to tune your Ruby (or Rails) Application
  2. Charity testing workshop
  3. Exploring Merb

Interestingly, while I was listening to Ezra’s presentation on Merb the first time, I kind of missed the point. The real power and purpose of Merb didn’t start sinking in for me until the second day, when I realized that there was a much bigger audience for a thread-safe, ActionPack-decoupled, performance tuned web framework. The validity of Ezra’s talk was reinforced by others, particularly Bruce Tate, who helped push the point home that Rails was just one stop on the Ruby journey. And, of course, it’s especially timely, considering the current dust-up over Pete’s Swanky Framework

Go get it

Posted about 7 years back at The Hobo Blog

And finally…

Also note we’re now on rubyforge so you could always just gem update hobo (subject to rubyforge delays – I only threw it up there one minute ago)

The demos on the site have not been updated, nor has the manual I’m afraid to say. But work on updating the manual is already underway so hopefully it won’t be all that long.

Have fun!

Go get it

Posted about 7 years back at The Hobo Blog

And finally…

Also note we’re now on rubyforge so you could always just gem update hobo (subject to rubyforge delays – I only threw it up there one minute ago)

The demos on the site have not been updated, nor has the manual I’m afraid to say. But work on updating the manual is already underway so hopefully it won’t be all that long.

Have fun!

Automated testing of websites via “real” users.

Posted about 7 years back at work.rowanhick.com

Of all the testing we can do, there's nothing quite like firing up your browser and navigating to the website in question, logging in and doing stuff. All of the integration tests, port tests, contrived "I'm alive" tests etc can give you an *indication* that your website code is all well and good. However what you really want to test is "can I jump to it, do x y z action, and complete those actions without it bombing out". We have a two options, we hire an army of minions who will do that for us every 15minutes on the dot OR we could do it automatically. How do we do this ? Well there are a number of ways. One option I'm going to walk through is using the magic genius of Safari Watir, RSpec tests, ruby, a few gems, cron and any Mac you can lay your hands on. We set this up a while ago monitoring some of our sites and it's great for finding out when something in your webstack has fallen over. For a < $1k investment it's a no brainer for any web site. Caveat - this ain't going to test your flash/flex content - this is just for HTML based sites. Read on... 1. Machine setup First, take one mac mini. We need to install ruby, ruby gems, rails, rspec, safariwatir, and rb-applescript bridge on it. Follow the Hivelogic narrative here for instructions on installing a full rails stack. Then just simply run these commands to finish off the last remaining gems. sudo gem install rspec sudo gem install safariwatir --include-dependencies 2. First website check So we've got our infrastructure setup. Now we need to write the scripts that actually run the test the site. These will fire up safari and tell it to navigate to various URL's, then check the content on the pages returned. So in true behaviour driven development style we write a spec that in plain english walks through the steps. It fires up a browser instance courtesy of Watir::Safari.new and uses it to navigate around pages. First let's create a file called check_google.rb like so: require 'rubygems' require 'safariwatir' context "With www.google.com" do before(:all) do @browser = Watir::Safari.new end it "can navigate to home page" do @browser.goto("http://www.google.com/") end it "homepage should not have a 404" do @browser.contains_text("404").should == nil end #it "should throw an contrived error, when seeing if yahoo is on main page" do # @browser.contains_text("www.yahoo.com").should == true #end after(:all) do @browser.close end end Now if we run spec check_google.rb we get output as follows: RowanH$ spec check_google.rb .. Finished in 2.818356 seconds 2 examples, 0 failures Fantastic, it's what we expect google is alive and tickety-boo. Now to check the failure scenario, uncomment the yahoo test: RowanH$ spec check_google.rb ..F 1) 'With www.google.com should throw an contrived error, when seeing if yahoo is on g main page' FAILED expected: true, got: nil (using ==) ./test_mysite.rb:18: Finished in 2.837444 seconds Cool, we know what a failure looks like. 3. Turning your console output into a email message We're not going to be logging in and doing this all the time, so we want to be emailed of success/failures. We are going to use a custom formatter for RSpec, which can make our output look a lot more interesting and pop it into an email. As I was running these scripts on a machine with a full rails stack I used ActiveMailer for sending emails.. (you'll see why in a minute) so let's create a custom formatter that will format our output for mailing. Lets call it mail_formatter.rb and pop it into the same place as our existing scripts - as follows. require 'rubygems' require 'action_mailer' #actual email thingy ActionMailer::Base.server_settings[:address] = 'domain@myhost.com' class Emailer < ActionMailer::Base def test_email(text, status) subject "TEST Autotest Status - #{status}" from "mytestbox@myhost.com" recipients "me@myhost.com" body text end end class MailFormat < Spec::Runner::Formatter::BaseTextFormatter def start(spec_count) @mail_output = String.new @mail_output << "Test started \n" @mail_status = "Tests OK" end def add_behaviour(name) @mail_output << "\n #{name}\n" end def example_failed(example, counter, failure) @mail_output << " - #{example.description} FAILED \n" @mail_status = "#{counter} tests FAILED" end def example_passed(example) @mail_output << " - #{example.description} PASSED \n" end def dump_summary(duration, spec_count, failure_count, something_else) @mail_output << "\n" @mail_output << "Finished in #{duration} seconds " @mail_output << "#{spec_count} test#{'s' unless spec_count == 1}, #{failure_count} failure#{'s' unless failure_count == 1}" Emailer.deliver_test_email(@mail_output, @mail_status) end end Right so this time if we a new command like so, to require the mail_formatter, and output in mail format, we should by rights receive an email: RowanH$ spec check_google.rb -r mail_formatter.rb -f MailFormat 1) 'With www.google.com should throw an contrived error, when seeing if yahoo is on main page' FAILED expected: true, got: nil (using ==) ./test_mysite.rb:18: (we still get our console output if we get a failure) 5. Automating it Okay so wrap that lot up in a shell script, and call it via cron (hey I'm not going to write *everything* out here), and you've now got a simple script that's calling up your website and checking it. 6. Extending it If you browse around for some of the safari-watir examples out there then you'll see more of how to access specific fields and named form elements - this will let you actually login and do stuff on your site(s) your testing. 7. Extra Credit - Screenshots!! Okay, we've got our system emailing us every test. But what would be really cool is if it actually sent us a screenshot everytime something turned to custard and failed so we could see what actually went wrong. Well... it's suprisingly easy. We're going to use OSX's inbuilt screencapture utility and fire off a shell command to capture a png file everytime something goes wrong. Then pop those in as attachments to our status email. Modify the code like so: In the Emailer.test_mail method, add a parameter images, and pop this code at the bottom of the method: if ( images ) for image_name in images attachment :content_type => "image/png", :filename => image_name , :body => File.read("/Users/rowanh/Desktop/failed_images/#{image_name}") end end So this will allow our email method to read in a list of images and attach them to mail message. Next we want to update our formatter. For the start method add the following: @failed_image_count = 0 @failed_images = Array.new Add a new method like so : def take_screenshot() @failed_image_count += 1 screenshot_name = "failure_#{@failed_image_count}.png" system "screencapture /Users/rowanh/Desktop/failed_images/#{screenshot_name}" @failed_images << screenshot_name end Next update example_failed so it takes_screenshot. Finally in the deliver_test_email method, pop in the @failed_images array. Conclusion Bingo! you now have a hugely useful tester, that runs away, tests your website, tells you and will actually show you what went wrong. For not a whole lot of investment. Off to setup a continuous integration machine that actually does this for each build........ Credit: http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir http://redsquirrel.com/cgi-bin/dave/projects/watir

@media Ajax Is Scarily Good

Posted about 7 years back at danwebb.net - Home

@media Ajax It seems that the @media Ajax site has just been updated. I was looking forward to it before but more speakers have been added including Brendan Eich who, according the abstract, will be demonstrating a working version of Tamarin in Firefox!

Also, Dojo’s Alex Russell, jQuery’s John Resig, YUI’s Douglas Crockford and Prototype’s erm, me will be representing the major libraries and then there’s the Ajaxians, Ben and Dion stepping up for a keynote. Finally, Mr Jeremy Keith will be hosting the hot topics panel in the traditional @media style – Hot Topics panel + JavaScript people should be quite explosive. As it was put in the Prototype Core Campfire the other day, “The JavaScript community is not so much of a community, more of a debating society” It’s going to be excellent. Of course, as it’s in London town you know we’ll be sinking a good few pints after. It will be a rare chance to get together with fellow scriptie types this side of the pond and the only pub conversation you’ll ever be allowed to mention closures in….surely that’s a good thing?

There are still early bird tickets left until the end of august so get your arse down to the site and sign up.

My presentation, Metaprogramming JavaScript, is for all those people who moan that they never learn things at conferences. It’s journey into the deep innards of JavaScript and I’ll be explaining the some of the metaprogramming techniques used in YUI, Prototype and Low Pro along with really getting into advanced JavaScript concepts like prototype inheritance, functional programming and closures. I defy you to turn up and not learn something new.

NHRuby: Shoes. And Belts. And You!

Posted about 7 years back at zerosum dirt(nap) - Home

If you’re in the greater NH/Maine/Mass seacoast area, don’t forget to check out tomorrow’s NHRuby group. Sir Brian DeLacey will be visiting us from Boston and talking about Shoes, the Ruby desktop UI toolkit from the ever-enigmatic _why.

If there’s time left to spare, I’ll probably spend some time blathering on about how you should participate in the upcoming Rails Rumble. Believe me, after seeing some of the prizes, you’re going to want to get in on the action. I was dead f**king serious about that championship belt. You’ll see.

Episode 67: restful_authentication

Posted about 7 years back at Railscasts

Need multiple user authentication? If so, the restful_authentication plugin is a great way to go. It will generate some basic authentication code for you which is good starting point to your authentication system. Watch this episode for details.