mofo 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  gem 'echoe', '=1.3'
4
4
 
5
- version = '0.2.12'
5
+ version = '0.2.13'
6
6
 
7
7
  ENV['RUBY_FLAGS'] = ""
8
8
 
@@ -3,7 +3,6 @@ require 'microformat'
3
3
  require 'mofo/hcard'
4
4
  require 'mofo/rel_tag'
5
5
  require 'mofo/rel_bookmark'
6
- require 'digest/md5'
7
6
 
8
7
  class HEntry < Microformat
9
8
  one :entry_title, :entry_summary, :updated, :published,
@@ -24,6 +23,9 @@ class HEntry < Microformat
24
23
  end
25
24
 
26
25
  def to_atom(property = nil, value = nil)
26
+ require 'digest/md5'
27
+ require 'erb'
28
+
27
29
  if property
28
30
  value ||= instance_variable_get("@#{property}")
29
31
  return value ? ("<#{property}>%s</#{property}>" % value) : nil
@@ -34,9 +36,9 @@ class HEntry < Microformat
34
36
  #{atom_id}
35
37
  #{atom_link}
36
38
  #{to_atom :title, @entry_title}
37
- <content type="html">#{@entry_content}</content>
38
- #{to_atom :updated}
39
- #{to_atom :published}
39
+ <content type="html">#{ERB::Util.h @entry_content}</content>
40
+ #{to_atom :updated, @updated.try(:xmlschema)}
41
+ #{to_atom :published, @updated.try(:xmlschema)}
40
42
  <author>
41
43
  #{to_atom :name, @author.try(:fn)}
42
44
  #{to_atom :email, @author.try(:email)}
@@ -56,7 +58,7 @@ class Array
56
58
  <link type="text/html" href="#{first.base_url}" rel="alternate"/>
57
59
  <link type="application/atom+xml" href="" rel="self"/>
58
60
  <title>#{options[:title]}</title>
59
- <updated>#{first.updated || first.published}</updated>
61
+ <updated>#{(first.updated || first.published).try(:xmlschema)}</updated>
60
62
  #{entries}
61
63
  </feed>
62
64
  end_atom
@@ -44,10 +44,10 @@ context "A parsed hEntry object" do
44
44
  <link type="text/html" href="http://errtheblog.com/post/13" rel="alternate"/>
45
45
  <title>&ldquo;A Rails Toolbox&rdquo;</title>
46
46
  <content type="html">
47
- <img
47
+ &lt;img
48
48
  src=
49
49
  http://errtheblog.com/static/images/pink-toolbox.jpg
50
- <p>
50
+ &lt;p&gt;
51
51
  </content>
52
52
  <author>
53
53
  <name>Chris</name>
@@ -74,14 +74,10 @@ context "An hFeed" do
74
74
  <link type="text/html" href="http://errtheblog.com/post/13" rel="alternate"/>
75
75
  <title>Err the Blog</title>
76
76
  <content type="html">
77
- <img
77
+ &lt;img
78
78
  src=
79
79
  http://errtheblog.com/static/images/pink-toolbox.jpg
80
- <p>
81
- <pre>
82
- just a normal
83
- test okay
84
- </pre>
80
+ &lt;p&gt;
85
81
  </content>
86
82
  <updated>
87
83
  <author>
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: mofo
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.12
6
+ version: 0.2.13
7
7
  date: 2008-01-22 00:00:00 -08:00
8
8
  summary: mofo is a ruby microformat parser
9
9
  require_paths: