hentry_consumer 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,28 +1,40 @@
1
1
  # H-Entry Consumer
2
2
 
3
- A Ruby gem to parse HTML containing one or more Microformat 2 h-entry elements, returning an a collection of
4
- serialized h-entry objects. The returned Object structure looks something like this:
5
-
6
- - HFeed
7
- - HEntry
8
- - [name]
9
- - [summary]
10
- - [email]
11
- - [content]
12
- - [author]
13
- - bookmark
14
- - HCard
15
- - [categories]
16
- - {}
17
- - HEntry
18
- - ...
19
-
20
- [Microformats 2 h-entry](http://microformats.org/wiki/microformats-2#h-entry)
3
+ A Ruby gem to parse HTML containing one or more
4
+ [microformats 2 h-entry elements](http://microformats.org/wiki/microformats-2#h-entry),
5
+ returning an a collection of serialized h-entry objects.
6
+
7
+ The returned Object structure looks something like this:
8
+
9
+ ```ruby
10
+ { :items => [{
11
+ :type => ["h-entry"],
12
+ :properties => {
13
+ :bookmark => "http://foo.bar/baz/qux",
14
+ :published_at => "2012-11-16T05:20:18Z",
15
+ :name => ["Foo Bar"],
16
+ :summary => ["Baz Qux"],
17
+ :content => ["<p>all of the html inside of it</p>"],
18
+ :categories => {
19
+ "Category" => "http://foo.bar/category"
20
+ },
21
+ :author => [{
22
+ :type => ["h-card"],
23
+ :properties => {
24
+ :name => ["Foo Bar"],
25
+ :email => ["foo@bar.com"],
26
+ :url => ["http://foo.bar"]
27
+ }
28
+ }]
29
+ }
30
+ }
31
+ }
32
+ ```
21
33
 
22
34
 
23
35
  ## Current Version
24
36
 
25
- 0.5.3
37
+ 0.6.0
26
38
 
27
39
 
28
40
  ## Requirements
@@ -52,12 +64,20 @@ gem install hentry_consumer
52
64
 
53
65
  ## Usage
54
66
 
67
+ Write some HTML marked up as a microformats 2 h-entry
68
+ * [An example](https://gist.github.com/4085498)
69
+ * [Oh look another example](https://gist.github.com/88d6d476483e9528fb3a)
70
+
55
71
  ```ruby
56
72
  require "hentry_consumer"
57
- HentryConsumer.parse(File|URL)
73
+
74
+ feed = HentryConsumer.parse("path/to/file") || HentryConsumer.parse("http://foo.bar")
75
+
76
+ feed.entries.each do |entry|
77
+ puts entry.name.first
78
+ puts entry.author.first.name
79
+ end
58
80
  ```
59
- [Example Gist of HTML with h-entry posts](https://raw.github.com/gist/3835447/7128a66a3ac7e971a82daac5fa2076d17b88e435/gistfile1.html)
60
- [Another Example Gist of HTML with h-entry posts](https://gist.github.com/88d6d476483e9528fb3a)
61
81
 
62
82
  ## Authors
63
83
 
@@ -86,6 +106,8 @@ guard
86
106
  ### Releases
87
107
 
88
108
  ```bash
109
+ vi lib/hentry_consumer/version.rb # change version
110
+ vi README.md # change version
89
111
  rake release
90
112
  ```
91
113
 
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.version = HentryConsumer::VERSION
9
9
  gem.authors = ["Bookis Smuin", "Jessica Lynn Suttles"]
10
10
  gem.email = ["vegan.bookis@gmail.com", "jlsuttles@gmail.com"]
11
- gem.description = %q{A hATOM feed parser}
12
- gem.summary = %q{Takes in HTML containing an h-feed classed element and returns serialized data based on the Microformat 2 hEntry specs}
11
+ gem.description = %q{A microformats 2 h-entry parser}
12
+ gem.summary = %q{Parses HTML containing one or more h-entry elements and returns serialized data based on the microformat 2 spec}
13
13
  gem.homepage = "https://github.com/G5/hentry_consumer"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
@@ -1,7 +1,7 @@
1
1
  module HentryConsumer
2
2
  class FormatRules
3
3
  REQUIRED = []
4
- UNIQUE = [:uid, :bookmark]
4
+ UNIQUE = [:uid, :bookmark, :url, :urn]
5
5
 
6
6
  class << self
7
7
  def required?(format)
@@ -1,3 +1,3 @@
1
1
  module HentryConsumer
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.3
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-16 00:00:00.000000000 Z
13
+ date: 2012-12-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.2.1
111
- description: A hATOM feed parser
111
+ description: A microformats 2 h-entry parser
112
112
  email:
113
113
  - vegan.bookis@gmail.com
114
114
  - jlsuttles@gmail.com
@@ -150,25 +150,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- segments:
154
- - 0
155
- hash: 3466350580781628104
156
153
  required_rubygems_version: !ruby/object:Gem::Requirement
157
154
  none: false
158
155
  requirements:
159
156
  - - ! '>='
160
157
  - !ruby/object:Gem::Version
161
158
  version: '0'
162
- segments:
163
- - 0
164
- hash: 3466350580781628104
165
159
  requirements: []
166
160
  rubyforge_project:
167
161
  rubygems_version: 1.8.24
168
162
  signing_key:
169
163
  specification_version: 3
170
- summary: Takes in HTML containing an h-feed classed element and returns serialized
171
- data based on the Microformat 2 hEntry specs
164
+ summary: Parses HTML containing one or more h-entry elements and returns serialized
165
+ data based on the microformat 2 spec
172
166
  test_files:
173
167
  - spec/lib/hentry_consumer/format_rules_spec.rb
174
168
  - spec/lib/hentry_consumer/h_card_spec.rb