feed_yamlizer 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,11 +29,15 @@ class FeedYamlizer
29
29
  @result
30
30
  end
31
31
 
32
+ def inner_text(string)
33
+ Nokogiri::HTML.parse(string).inner_text
34
+ end
35
+
32
36
  def add_feed_metaresult
33
- fields = [:title, :link, :xml_encoding]
34
- @result[:meta] = fields.reduce({}) {|memo, field|
35
- memo[field] = @feed[field]
36
- memo
37
+ @result[:meta] = {
38
+ :title => inner_text(@feed[:title]),
39
+ :link => @feed[:link],
40
+ :xml_encoding => @feed[:xml_encoding]
37
41
  }
38
42
  end
39
43
 
@@ -46,7 +50,8 @@ class FeedYamlizer
46
50
 
47
51
  def add_item_metaresult(item, index)
48
52
  fields = [:title, :author, :guid, :pub_date, :link]
49
- metaresult = fields.reduce({}) {|memo, field|
53
+ x = {:title => inner_text(item[:title])}
54
+ metaresult = fields.reduce(x) {|memo, field|
50
55
  memo[field] = item[field]
51
56
  memo
52
57
  }
@@ -56,7 +56,7 @@ class FeedYamlizer
56
56
  #@content << "<br/>"
57
57
  @content << ""
58
58
  when 'blockquote'
59
- @content << "[blockquote]"
59
+ @content << "[blockquote]\n"
60
60
  when 'ul', 'ol', 'dl'
61
61
  @content << "<#{name}>"
62
62
  when 'li', 'dt', 'dd'
@@ -1,3 +1,3 @@
1
1
  class FeedYamlizer
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-18 00:00:00 -05:00
17
+ date: 2011-02-19 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency