Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix advice_dog to accept an optional first-line argument

  • Loading branch information...
commit 3f2fb6ae0cfda0fbd9b5683ea44f08db5e96a452 1 parent c1455c2
@drbrain authored
Showing with 12 additions and 4 deletions.
  1. +5 −0 History.txt
  2. +7 −4 lib/meme.rb
View
5 History.txt
@@ -1,3 +1,8 @@
+=== 1.7.1 / 2011-03-18
+
+* Bug Fix
+ * Meme::advice_dog now accepts an optional first line.
+
=== 1.7 / 2011-03-18
* Minor enhancement
View
11 lib/meme.rb
@@ -16,7 +16,7 @@ class Error < RuntimeError; end
##
# Every meme generator needs a version
- VERSION = '1.7'
+ VERSION = '1.7.1'
##
# For statistics!
@@ -35,8 +35,11 @@ class Error < RuntimeError; end
#
# These can accept up to two lines of text
- def self.advice_dog name, id, template_name
- GENERATORS[name] = [id, 'AdviceDogSpinoff', template_name]
+ def self.advice_dog name, id, template_name, first_line = nil
+ template = [id, 'AdviceDogSpinoff', template_name, first_line]
+ template.compact
+
+ GENERATORS[name] = template
end
##
@@ -67,7 +70,7 @@ def self.vertical name, id, template_name
advice_dog 'J_DUCREUX', 1356, 'Joseph-Ducreux'
advice_dog 'KEANU', 47718, 'Keanu-reeves'
advice_dog 'MINECRAFT', 122309, 'Minecraft'
- advice_dog 'O-RLY-OWL', 117041, 'O-RLY-OWL','ORLY???'
+ advice_dog 'O-RLY-OWL', 117041, 'O-RLY-OWL', 'ORLY???'
advice_dog 'OBAMA', 1332, 'Obama-'
advice_dog 'PHILOSORAPTOR', 984, 'Philosoraptor'
advice_dog 'P_OAK', 24321, 'Professor-Oak'
Please sign in to comment.
Something went wrong with that request. Please try again.