Presentation given at October 2009 London Ruby User Group on three gems I have written:
Numerouno - English natural language parser
Baldrick - framework for readying RSS feeds and other sources to hack things together
Bumps - remote feature management for Cucumber
1. GemsI made some
Brent Snook
http://skillsmatter.com/podcast/ajax-ria/a-trio-of-gems
Friday, 16 October 2009
2. Brent who?
• Agile weenie from Melbourne,
Australia
• known to use Java when cornered
• available for dev, coaching, children’s
parties
• fuglylogic.com
• brentsnook
Friday, 16 October 2009
3. Numerouno
http://github.com/brentsnook/
numerouno
Friday, 16 October 2009
4. parse a number
require 'numerouno'
'five billion and forty two apples'.as_number
=> 5000000042
'65'.as_number
=> 65
require 'numerouno-parsing'
Numerouno.parse 'one hundred and ten things'
Friday, 16 October 2009
5. replace numbers
require 'numerouno'
'two bit varmint'.sub_numbers
=> '2 bit varmint'
require 'numerouno-parsing'
Numerouno.replace '2 bit varmint'
Friday, 16 October 2009
6. Cucumber steps
require 'numerouno'
Then /the meaning of life is (.+)/ do |number|
42.should == number.as_number
end
Then the meaning of life is forty two
Then the meaning of life is 42
Friday, 16 October 2009
7. Baldrick
http://github.com/brentsnook/
baldrick
Friday, 16 October 2009
9. cuppa.rb
require 'rubygems'
require 'baldrick_serve'
feed_url = 'http://search.twitter.com/search.atom?q=cup+of'
listen_to :feed, :at => feed_url
on_hearing /cup of (.*?)[.,]/ do |beverage, order|
puts "#{order[:who]} would like a cup of #{beverage}"
end
Friday, 16 October 2009
10. orders
=== brent on commodore64.:43215 ===
* [25-Feb-2009 10:17 PM] I’d like a
cup of tea, maybe a biscuit too
Friday, 16 October 2009
11. tasks
kettle.fill
kettle.switch_on
Friday, 16 October 2009
12. cuppa.rb
require 'rubygems'
require 'baldrick_serve'
feed_url = 'http://search.twitter.com/search.atom?q=cup+of'
listen_to :feed, :at => feed_url
on_hearing /cup of (.*?)[.,]/ do |beverage, order|
puts "#{order[:who]} would like a cup of #{beverage}"
end
Friday, 16 October 2009