mofo 0.2.13 → 0.2.14

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.13'
5
+ version = '0.2.14'
6
6
 
7
7
  ENV['RUBY_FLAGS'] = ""
8
8
 
@@ -11,15 +11,16 @@ class HEntry < Microformat
11
11
  many :entry_content => :html, :tags => RelTag
12
12
 
13
13
  after_find do
14
+ @domain = @base_url.sub /http:\/\/([^\/]+).*/, '\1'
14
15
  @updated ||= @published if @published
15
16
  end
16
17
 
17
18
  def atom_id
18
- "<id>tag:#{@base_url.sub('http://','')},#{Date.today.year}:#{Digest::MD5.hexdigest(entry_content)}</id>"
19
+ "<id>tag:#{@domain},2008-01-22:#{Digest::MD5.hexdigest(entry_content)}</id>"
19
20
  end
20
21
 
21
22
  def atom_link
22
- %(<link type="text/html" href="#{@base_url}#{@bookmark}" rel="alternate"/>)
23
+ %(<link type="text/html" href="http://#{@domain}#{@bookmark}" rel="alternate"/>)
23
24
  end
24
25
 
25
26
  def to_atom(property = nil, value = nil)
@@ -56,7 +57,6 @@ class Array
56
57
  <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
57
58
  #{first.atom_id}
58
59
  <link type="text/html" href="#{first.base_url}" rel="alternate"/>
59
- <link type="application/atom+xml" href="" rel="self"/>
60
60
  <title>#{options[:title]}</title>
61
61
  <updated>#{(first.updated || first.published).try(:xmlschema)}</updated>
62
62
  #{entries}
@@ -63,14 +63,19 @@ end
63
63
 
64
64
  context "An hFeed" do
65
65
  setup do
66
- $hentries ||= HEntry.find(:all => fixture(:hatom), :base => 'http://errtheblog.com')
66
+ $hentries ||= HEntry.find(:all => fixture(:hatom), :base => 'http://errtheblog.com/posts/rss')
67
+ end
68
+
69
+ specify "should know its atom id" do
70
+ $hentries.first.atom_id.should == "<id>tag:errtheblog.com,2008-01-22:a7ec6beee025594bbed6817b361e0e45</id>"
71
+
67
72
  end
68
73
 
69
74
  specify "should know its Atom representation" do
70
75
  to_atom = $hentries.to_atom(:title => 'Err the Blog')
71
76
  expected = <<-end_atom
72
77
  <entry>
73
- <id>tag:errtheblog.com,2008
78
+ <id>tag:errtheblog.com,2008-01-22:
74
79
  <link type="text/html" href="http://errtheblog.com/post/13" rel="alternate"/>
75
80
  <title>Err the Blog</title>
76
81
  <content type="html">
@@ -90,7 +95,6 @@ context "An hFeed" do
90
95
  <?xml version="1.0" encoding="UTF-8"?>
91
96
  <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
92
97
  <link type="text/html" href="
93
- <link type="application/atom+xml" href="
94
98
  </feed>
95
99
  end_atom
96
100
 
metadata CHANGED
@@ -3,8 +3,8 @@ 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.13
7
- date: 2008-01-22 00:00:00 -08:00
6
+ version: 0.2.14
7
+ date: 2008-01-23 00:00:00 -08:00
8
8
  summary: mofo is a ruby microformat parser
9
9
  require_paths:
10
10
  - lib