From ee6db85dea0b5266054139c4b85b439f11928fbb Mon Sep 17 00:00:00 2001 From: "Austin G. Davis-Richardson" Date: Sun, 16 Oct 2011 19:47:44 -0400 Subject: [PATCH] actually, the origin used an s instead of a z --- lib/memetron/memes.rb | 2 +- readme.md | 10 ++++++++-- spec/memetron/matcher_spec.rb | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/memetron/memes.rb b/lib/memetron/memes.rb index 05cb2e5..04a163d 100644 --- a/lib/memetron/memes.rb +++ b/lib/memetron/memes.rb @@ -32,6 +32,6 @@ module Memetron :bear_grillis => /(.*) better drink my own piss/i, # I can haz cheeseburger - :i_can_haz => /I can haz (.*)/i + :i_can_haz => /I can ha[zs] (.*)/i } end diff --git a/readme.md b/readme.md index f909a7c..e5d1d34 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,8 @@ # Memetron 5000 -An attempt to replace Reddit with regular expressions. +Recognize common internet memes using regular expressions. + +## How ```ruby require 'lib/memetron' @@ -9,5 +11,9 @@ matcher = Memetron::Matcher.new matcher.match("North Korea is Best Korea") #=> :is_best -matcher.parse("North Korea is Best Korea") #=> ['North', 'Korea', 'Korea'] +mather.parse("Wrote a Ruby library, better drink my own piss") #=> ["Wrote a Ruby library,"] ``` + +## Why? + +For the lulz. \ No newline at end of file diff --git a/spec/memetron/matcher_spec.rb b/spec/memetron/matcher_spec.rb index 60aa3ab..3800167 100644 --- a/spec/memetron/matcher_spec.rb +++ b/spec/memetron/matcher_spec.rb @@ -158,8 +158,8 @@ subject.match("I can haz Ruby library?").should == :i_can_haz end - it "should not work with an s instead of a z" do - subject.match("I can has Ruby library?").should be_nil + it "should work with either has or haz" do + subject.match("I can has Ruby library?").should == :i_can_haz end it "is parsed" do