microformats 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 782c4644eac7e969915cb788d5e93849653e94dc
4
- data.tar.gz: d9e1cc5d37ee4115412431a6f56957abbfccc9b0
3
+ metadata.gz: 96d92a5bb4aaef19f5e6fa918cd5ffc556c76ec0
4
+ data.tar.gz: 8ab579244cd67680bbca05ee4d14700680676462
5
5
  SHA512:
6
- metadata.gz: 4f6ea2627813c51d87cd7bfd764c9f1966d0f0c5708023fd4a473c3aea157008b01df1a89f1d936f8b16c07dafb98e1f856151171f3fbcac1dfb8cf30faeae9f
7
- data.tar.gz: 61d6557764e72d320679b683f9de610a24682aa55227a2b2d35b9d13b2ccbd21ebbd8dc466d33238dccdb6bbc8b79ed35a0eb66fc176aaf82d1152575797a70c
6
+ metadata.gz: 6fa1e48cb0c84380e0d123ea89faa16192dd6ed2580348b14d170d82cac3b69100fbfaaf66a8d306989f39be8698d69af1167d3f9e6fd9cff24ea617f3dcca5f
7
+ data.tar.gz: 31a5ec4d62d21bcf985100eb27ec3dfc9d604c963a3a5e7260125f405cf14483451c713fc736cfec108aab62fa6297f791fa0d5c2fee5715616dbc71a0df1943
data/README.md CHANGED
@@ -34,9 +34,9 @@ Not Implemented:
34
34
 
35
35
  ## Current Version
36
36
 
37
- 4.0.2
37
+ 4.0.3
38
38
 
39
- ![Version 4.0.2](https://img.shields.io/badge/VERSION-4.0.2-green.svg)
39
+ ![Version 4.0.3](https://img.shields.io/badge/VERSION-4.0.3-green.svg)
40
40
 
41
41
 
42
42
  ## Requirements
@@ -90,14 +90,16 @@ module Microformats
90
90
  @rels[rel_value].uniq!
91
91
  end
92
92
 
93
- @rel_urls[url] = {} unless @rel_urls.has_key?(url)
94
-
95
- @rel_urls[url]['hreflang'] = rel.attribute('hreflang').value if @rel_urls[url]['hreflang'].nil? and not rel.attribute('hreflang').nil?
96
- @rel_urls[url]['media'] = rel.attribute('media').value if @rel_urls[url]['media'].nil? and not rel.attribute('media').nil?
97
- @rel_urls[url]['title'] = rel.attribute('title').value if @rel_urls[url]['title'].nil? and not rel.attribute('title').nil?
98
- @rel_urls[url]['type'] = rel.attribute('type').value if @rel_urls[url]['type'].nil? and not rel.attribute('type').nil?
99
- @rel_urls[url]['text'] = rel.text.strip if @rel_urls[url]['text'].nil? and not rel.text.empty?
100
- @rel_urls[url]['rels'] = rel_values
93
+ unless rel_values.empty?
94
+ @rel_urls[url] = {} unless @rel_urls.has_key?(url)
95
+
96
+ @rel_urls[url]['hreflang'] = rel.attribute('hreflang').value if @rel_urls[url]['hreflang'].nil? and not rel.attribute('hreflang').nil?
97
+ @rel_urls[url]['media'] = rel.attribute('media').value if @rel_urls[url]['media'].nil? and not rel.attribute('media').nil?
98
+ @rel_urls[url]['title'] = rel.attribute('title').value if @rel_urls[url]['title'].nil? and not rel.attribute('title').nil?
99
+ @rel_urls[url]['type'] = rel.attribute('type').value if @rel_urls[url]['type'].nil? and not rel.attribute('type').nil?
100
+ @rel_urls[url]['text'] = rel.text.strip if @rel_urls[url]['text'].nil? and not rel.text.empty?
101
+ @rel_urls[url]['rels'] = rel_values
102
+ end
101
103
 
102
104
  end
103
105
  end
@@ -1,3 +1,3 @@
1
1
  module Microformats
2
- VERSION = "4.0.2"
2
+ VERSION = "4.0.3"
3
3
  end
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <base href="http://example.org/">
4
+ <body>
5
+ <div class="h-card">
6
+ <a href="/" class="u-url p-name">
7
+ Jessica Lynn Suttles
8
+ </a>
9
+ <a href="http://flickr.com" class="u-url" rel="">
10
+ @jlsuttles
11
+ </a>
12
+ <a href="http://twitter.com/jlsuttles" class="u-url" rel="me">
13
+ @jlsuttles
14
+ </a>
15
+ <time class="dt-bday" datetime="1990-10-15">
16
+ October 15, 1990
17
+ </time>
18
+ <div class="e-content">
19
+ <p>Vegan. Cat lover. Coder.</p>
20
+ </div>
21
+ </div>
22
+ </body>
23
+ </html>
@@ -0,0 +1,41 @@
1
+ {
2
+ "items": [
3
+ {
4
+ "type": [
5
+ "h-card"
6
+ ],
7
+ "properties": {
8
+ "url": [
9
+ "http://example.org/",
10
+ "http://flickr.com",
11
+ "http://twitter.com/jlsuttles"
12
+ ],
13
+ "name": [
14
+ "Jessica Lynn Suttles"
15
+ ],
16
+ "bday": [
17
+ "1990-10-15"
18
+ ],
19
+ "content": [
20
+ {
21
+ "value": "Vegan. Cat lover. Coder.",
22
+ "html": "\n <p>Vegan. Cat lover. Coder.</p>\n"
23
+ }
24
+ ]
25
+ }
26
+ }
27
+ ],
28
+ "rels": {
29
+ "me": [
30
+ "http://twitter.com/jlsuttles"
31
+ ]
32
+ },
33
+ "rel-urls": {
34
+ "http://twitter.com/jlsuttles": {
35
+ "text": "@jlsuttles",
36
+ "rels": [
37
+ "me"
38
+ ]
39
+ }
40
+ }
41
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microformats
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-05-19 00:00:00.000000000 Z
13
+ date: 2017-05-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -183,6 +183,8 @@ files:
183
183
  - spec/support/cases/microformats.org/microformats-2/microformats-2-9.js
184
184
  - spec/support/lib/edge_cases/blank_href.html
185
185
  - spec/support/lib/edge_cases/blank_href.js
186
+ - spec/support/lib/edge_cases/blank_rel.html
187
+ - spec/support/lib/edge_cases/blank_rel.js
186
188
  - spec/support/lib/edge_cases/blank_src.html
187
189
  - spec/support/lib/edge_cases/blank_src.js
188
190
  - spec/support/lib/edge_cases/relative.html
@@ -541,6 +543,8 @@ test_files:
541
543
  - spec/support/cases/microformats.org/microformats-2/microformats-2-9.js
542
544
  - spec/support/lib/edge_cases/blank_href.html
543
545
  - spec/support/lib/edge_cases/blank_href.js
546
+ - spec/support/lib/edge_cases/blank_rel.html
547
+ - spec/support/lib/edge_cases/blank_rel.js
544
548
  - spec/support/lib/edge_cases/blank_src.html
545
549
  - spec/support/lib/edge_cases/blank_src.js
546
550
  - spec/support/lib/edge_cases/relative.html