urban 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +3 -0
  2. data/lib/urban.rb +1 -1
  3. data/lib/urban/version.rb +1 -1
  4. metadata +1 -1
data/README CHANGED
@@ -1,3 +1,6 @@
1
1
  Known words with bad markup for testing
2
2
  http://www.urbandictionary.com/define.php?term=minal
3
3
  http://www.urbandictionary.com/define.php?term=ugly-hot
4
+ http://www.urbandictionary.com/define.php?term=bolen
5
+ http://www.urbandictionary.com/define.php?term=chinalian
6
+
@@ -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')).humanize.gsub(/\. \w/) { |char| char.upcase }
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
 
@@ -1,3 +1,3 @@
1
1
  module Urban
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: urban
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tom Miller