…directly from rules defined using standard Ruby syntax (has its own esque grammar language). 's error messages are also significantly nicer than Treetop's when you inevitably run into trouble with your grammar as they're generated by Parslet itself and don't spring from Treetop's internally generated code.
So if you need to build a parser (or think you might ), check out Parslet - it has a great homepage with some useful documentation. …
Convention (stolen from Ruby) says that we should name our spec files ClassUnderTestSpec.m . Specs for categories will be named FoundationClass ExtensionSpec.m . We don't need public headers for specs.
The testing syntax itself is very block heavy. But other than that, it follows RSpec's syntax almost exactly.
The category method: Starting with the desired end state
We'll start in the same place as we would in Ruby. Given a string ("example string"), we expect …
Thanks to the following participants:
The idea for Hackday was simple: provide a free-of-charge, guided discussion on Ruby- and Rails-related topics that was open to the community. Our first topic, ' Refactoring Rails Controllers,' was chosen in response to conversations that had taken place during previous Hacknight events.
At Viget we get to work with Ruby and Rails everyday with other developers doing the same thing. This generates tremendous growth within each of us in the development lab. However, there …
Then in Ruby (at the application layer), we run the map to get the amounts and the inject to get the sum. Done. Not that bad but we can do better.
We want to avoid pulling all this data into memory just to get a single number. Let's have the database do the heavy lifting. class Campaign < ActiveRecord::Base # ... def funds_raised loans.sum(:amount) end end
With this implementation we have the database do the calculation. We get access to sum from ActiveRecord…
Introducing Hound - to automatically nag you about Ruby style guide violations in your commits.
Heartbleed should bleed - to death rant about the state of internet security, though I don't believe the web of trust approach is workable either.
Surviving - with Rails course from .
Tweet the following: Learn # Ruby on # Rails with @ engineyard http://bit.ly/02ror # Ride4Ruby [distance] [your gist] Extra credit. Obviously, the distance your bike will be traveling is farther than the distance between the start and end points. Share Ruby code for calculating the shortest distance between all points, for an extra special prize, which will be announced next week after we look through the submissions.
Ready. Set. Go!
Note: Submissions are closed at midnight tomorrow …
If you want to take a class to learn more about Ruby on Rails, check out the next Zero to Rails 3 Class offered virtually January 24 to January 27, 2011.
Ruby 2.1 - A look at the internals of ruby GC, some of the cases where it fails, and what you can do about it. : ready for production
How to Build a Ruby - A good walkthrough of the current state of gem building. With , , CI And Coveralls, Oh My!
Heartbleed Test - Find out whether a server is vulnerable to the recent devastating bug.