Mar 27

Ruby without Rails

Web at 21 Social, Belfast

At our first meetup we covered an introduction to Ruby the language and one of the major uses of it, Ruby on Rails.

The reality is, this is just the tip of the iceberg. This is a chance to see what Ruby without Rails can let you do. For this evening we have two short talks that cover different approaches in using Ruby to develop web applications.

An introduction to Sinatra

A look at a more lightweight web framework for Ruby, Sinatra. Sinatra is a Domain Specific Language (DSL) for quickly creating web applications in Ruby with minimal effort. By Steven Wilkin.

Minimalist Rails and Rack

We're going to look at what is possible when you take the Rails stack to the bare minimum. We'll also take a detour to Rack, the modular web server interface Rails now supports and the flexibility and power that provides. By David Rice of Rumble Labs.

After the talks, it will be time to get hacking. Pick a project. Anything you like! There will be experienced Rubyists on hand to help out and answer questions.

So come along, sit down with a beer and get coding.

Sponsors

We're looking for sponsors for the bar and maybe some food. So if you're keen to help out, please leave a commment or get in touch.

Event added over 5 years ago by Simon Hamilton in  

6 Comments so far

David Rice

David Rice

Technical Director at Rumble Labs

My slides from Minimalist Rails talk @belfastruby last night. http://speakerdeck.com/u/davidjrice/p/minimalist-rails

Steven's slides from his Introduction to Sinatra
http://belfast-ruby-sinatra.heroku.com/

Also if you enjoyed mine or Steven's talk please take a moment and rate the talks on http://speakerrate.com/events/1290

over 5 years ago

Colin Mitchell

It's only the second meeting, and already BelfastRuby has come off the Rails... :-)

But in a good way....

over 5 years ago

David Kennedy

Hacking suggestion: I'm keen to compare notes with anyone else trying to speed up a sluggish Rails test suite. I think I'm Doing It Wrong - my spec_helper.rb is hideous and I'm resorting to using TCS Ruby to knock a few seconds off Rake runs. We have a lot of request specs admittedly, but it seems like my Model tests in particular should be much faster.

I'm more than happy to show folks what we do and see if together we can't improve what seems like a pretty standard setup. Our recipe usually includes RSpec, Guard, Spork, Capybara, Shoulda, FactoryGirl, DatabaseCleaner, SimpleCov, lions, tigers and bears, oh my!

I'll slap a big TESTING sticker on myself (well, maybe on my laptop) for the meetup if anyone wants to chat.

over 5 years ago

David Rice

David Rice

Technical Director at Rumble Labs

David, definitely bring your laptop. We've some experience in performance optimisation of automated tests here at Rumble Labs! Testing is a subject we definitely want to cover in future thanks for the offer showing what you do we're using pretty similar stuff.

You may also want to look at [autotest](http://github.com/grosser/autotest) which scans your filesystem for changes and runs associated tests. Also [autotest-fsevent](http://github.com/svoop/autotest-fsevent) to speed things up by taking advantage of Mac OSX filesystem events. Finally [autotest-growl](http://github.com/svoop/autotest-growl) so you don't have to switch out of your editor to see notifications of your test run!

The biggest piece of advice I can give you is to drop that database. It's your biggest bottleneck here. We try to write database agnostic applications, their easier to test. Unit tests (models) shouldn't touch the database as we don't need to test **ActiveRecord**. The database is the biggest bottleneck here, but we can do some things.

* Run your tests in a [sqlite in-memory database](http://calicowebdev.com/2011/01/25/rails-3-sqlite-3-in-memory-databases/)
* Don't use fixtures
* Optimise how you create only the data you need in your specs as you need it
* Don't Record.create when Record.new will do

Finally, if it's not fast enough. You should investigate using [mocks and stubs](http://rubydoc.info/gems/rspec-mocks/frames) to isolate yourself from the database and you'll find those minutes turn to milliseconds.

over 5 years ago

David Kennedy

Thanks David - great advice!

We use Guard(/fsevent/growl) rather than autotest, but otherwise I'm reasssured that my plan lines up well with your suggestions; dropping the DB is *definitely* the aim here! We like TDD so every second saved on a test run feels good. Making the tests (even) fast(er) is definitely one of the biggest issues we've faced switching to RoR.

See you, and hopefully a few more interested folks, on the 27th.

over 5 years ago

Chris Smith

Tut tut... It no work in IE8! ;-)

SCRIPT5007: Unable to get value of the property 'keyCode': object is null or undefined
showoff.js, line 428 character 2

over 5 years ago

Add your comment