urban 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -0
- data/lib/urban.rb +1 -1
- data/lib/urban/version.rb +1 -1
- metadata +1 -1
data/README
CHANGED
data/lib/urban.rb
CHANGED
@@ -9,7 +9,7 @@ module Urban
|
|
9
9
|
url = URI.encode('http://www.urbandictionary.com/random.php')
|
10
10
|
doc = Nokogiri.HTML(open(url))
|
11
11
|
word = clean_text(doc.at_css('.word')).humanize
|
12
|
-
definition = clean_text(doc.at_css('.definition')).
|
12
|
+
definition = clean_text(doc.at_css('.definition')).gsub(/\s{2,}/, ' ').gsub(/^\s*\w|\.\s+\w/) { |char| char.upcase }
|
13
13
|
puts "#{word}: #{definition}"
|
14
14
|
end
|
15
15
|
|
data/lib/urban/version.rb
CHANGED