Hi there Dax!
I agree it was small but nice. We've talked about a lot of interesting subjects.
For those of you who couldn't make it to the Library, here's a little recap:
- Instance validations strategies on Ruby and my "validations4r" project: examples and code browsing.
- Differences between Haskell and Erlang.
- RSpec and Cucumber: is it conveniant? when and how to implement testing on existing projects, code browsing.
- Rails form inconsistencies and Dax's untitled project.
- Shoes example and code browsing.
- Erik's book about Computer Hardware and Software implementations.
- Rails vs. Merb vs. Sinatra
If I'm forgetting something about the meeting, please refresh my memory :)
From my part, yesterday I officially presented the projects I've been working on during the last couple of weeks. My focus is on the validation of Ruby built-in instances a la ActiveRecord as a complementary strategy to the ad-hoc type cheking and Duck Typing. The idea was born when Remco was looking at an example code and asked me why I want to validate the instances any method receives as an input.
The project "
validations4r" gathers Ruby built-in classes as group and defines rules that can be applied to it. The developer can validate an instance by its type and the conditions the developer passes as a block.
With this library you can go from writing a validation like this:
raise Error.new("an error message") unless ("hallo!".is_a?(String) &&
"hallo!".length == 10 &&
"hallo!".include?("!"))
To this code:
raise Error.new("an error message") \
unless validate("hallo!",:as=>:text){|v| v.size = 10; v.include = "!"}
This library is based on another project I wrote called "
validator". This is a DSL for writing validations of any kind. You just need to define a group, the classes this group should validate and any extra rule you require to validate an instance.
One interesting point for both project: they have been developed by using TDD and BDD approaches.
If you're interested in trying this libraries, you can either install the gems :
gem install rock-n-code-validator
gem install rock-n-code-validations4r
...or fork the code at the following Github links:
If anything, please let me know!
Best regards,
Javier.-
Tw. @monsieur_rock
MSN: monsieur_rock [at] hotmail [dot] com
LinkedIn:
http://www.linkedin.com/in/javiercicchelli