howdy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -24,10 +24,14 @@ Howdy enables "how" binary in your system. If for example you want to know what
24
24
 
25
25
  = Available Dictionaries
26
26
 
27
+ * http://urbandictionary.com
27
28
  * http://dictionary.com
28
29
  * http://dict.pl
29
30
  * http://ling.pl
30
31
 
32
+ = Contributors:
33
+ * Paweł Pacana http://github.com/pawelpacana
34
+
31
35
  == Note on Patches/Pull Requests
32
36
 
33
37
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/bin/how CHANGED
@@ -13,6 +13,7 @@ opts = OptionParser.new do |opts|
13
13
  when 'dict.pl': Howdy::Dictionary::DictPl
14
14
  when 'ling.pl': Howdy::Dictionary::LingPl
15
15
  when 'dictionary.com': Howdy::Dictionary::DictionaryCom
16
+ when 'urbandictionary.com': Howdy::Dictionary::UrbanDictionaryCom
16
17
  else raise Howdy::HowdyError, 'Choose one of available dictionaries'
17
18
  end
18
19
  Howdy::Dictionary.set(dict)
data/howdy.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{howdy}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mlomnicki"]
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/howdy/dictionaries/dict_pl.rb",
33
33
  "lib/howdy/dictionaries/dictionary_com.rb",
34
34
  "lib/howdy/dictionaries/ling_pl.rb",
35
+ "lib/howdy/dictionaries/urban_dictionary_com.rb",
35
36
  "lib/howdy/pair.rb",
36
37
  "spec/howdy_spec.rb",
37
38
  "spec/spec_helper.rb"
@@ -0,0 +1,16 @@
1
+ module Howdy
2
+ module Dictionary
3
+ class UrbanDictionaryCom < Base
4
+ url 'http://www.urbandictionary.com/define.php?term=#{user_query}'
5
+
6
+ def parse
7
+ document.css('table#entries tr td.text').each do |cell|
8
+ result << "#{cell.search('div.definition').children.collect { |e| e.content }.join}\n"
9
+ result << "#{cell.search('div.example').children.collect { |e| e.content }.join}\n\n"
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+
data/lib/howdy.rb CHANGED
@@ -5,6 +5,7 @@ require 'dictionaries/base'
5
5
  require 'dictionaries/dict_pl'
6
6
  require 'dictionaries/ling_pl'
7
7
  require 'dictionaries/dictionary_com'
8
+ require 'dictionaries/urban_dictionary_com'
8
9
 
9
10
  module Howdy
10
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howdy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mlomnicki
@@ -55,6 +55,7 @@ files:
55
55
  - lib/howdy/dictionaries/dict_pl.rb
56
56
  - lib/howdy/dictionaries/dictionary_com.rb
57
57
  - lib/howdy/dictionaries/ling_pl.rb
58
+ - lib/howdy/dictionaries/urban_dictionary_com.rb
58
59
  - lib/howdy/pair.rb
59
60
  - spec/howdy_spec.rb
60
61
  - spec/spec_helper.rb