hentry_consumer 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,7 +22,7 @@ serialized h-entry objects. The returned Object structure looks something like t
22
22
 
23
23
  ## Current Version
24
24
 
25
- 0.3.2
25
+ 0.4.0
26
26
 
27
27
 
28
28
  ## Requirements
@@ -4,7 +4,6 @@ module HentryConsumer
4
4
  alias_method :emails, :email
5
5
  alias_method :urls, :url
6
6
 
7
-
8
7
  def to_json(*a)
9
8
  {:items =>
10
9
  [{
@@ -17,6 +17,7 @@ module HentryConsumer
17
17
  def to_html
18
18
  self.entries.collect(&:to_html).join
19
19
  end
20
+ alias_method :to_s, :to_html
20
21
 
21
22
  def to_json(*a)
22
23
  json = {:items =>
@@ -26,6 +27,6 @@ module HentryConsumer
26
27
  }]
27
28
  }.to_json(a)
28
29
  end
29
-
30
+
30
31
  end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module HentryConsumer
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -12,15 +12,19 @@ describe HentryConsumer::HFeed do
12
12
  it { json["items"].first["properties"]["entries"].first["items"].first["type"].should include "h-entry" }
13
13
 
14
14
  end
15
- # <article class=\"h-entry\"><h1 class=\"p-name\">Senior Cat Living</h1>
16
- # <article class=\"h-entry\">\n <h1 class=\"p-name\">Senior Cat Living</h1>\n
15
+
16
+ describe "to_s" do
17
+ let(:string) { feed.to_s }
18
+ it "should have nicely formatted content" do
19
+ string.should match feed.to_html
20
+ end
21
+ end
22
+
17
23
  describe "html" do
18
- describe "html" do
19
- let(:html) { feed.to_html }
24
+ let(:html) { feed.to_html }
20
25
 
21
- it "should match the example html" do
22
- html.gsub(/\\n|\s/, '').should eq File.open("spec/support/example.html").read.gsub(/\\n|\s/, '')
23
- end
26
+ it "should match the example html" do
27
+ html.gsub(/\\n|\s/, '').should eq File.open("spec/support/example.html").read.gsub(/\\n|\s/, '')
24
28
  end
25
29
  end
26
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hentry_consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-19 00:00:00.000000000 Z
12
+ date: 2012-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri