microformats 4.0.6 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +10 -0
  3. data/.gitignore +33 -15
  4. data/.rspec +3 -2
  5. data/.rubocop +3 -0
  6. data/.rubocop.yml +22 -0
  7. data/.ruby-version +1 -0
  8. data/.simplecov +11 -0
  9. data/.travis.yml +16 -2
  10. data/CONTRIBUTING.md +103 -0
  11. data/Guardfile +2 -2
  12. data/LICENSE +116 -0
  13. data/README.md +112 -172
  14. data/Rakefile +6 -7
  15. data/bin/microformats +10 -9
  16. data/lib/microformats.rb +15 -14
  17. data/lib/microformats/absolute_uri.rb +4 -8
  18. data/lib/microformats/format_parser.rb +271 -251
  19. data/lib/microformats/parser.rb +39 -39
  20. data/lib/microformats/parser_core.rb +142 -109
  21. data/lib/microformats/property_parser.rb +42 -65
  22. data/lib/microformats/results/collection.rb +19 -38
  23. data/lib/microformats/results/parser_result.rb +25 -37
  24. data/lib/microformats/results/property_set.rb +24 -31
  25. data/lib/microformats/time_property_parser.rb +130 -104
  26. data/lib/microformats/version.rb +1 -1
  27. data/logo.svg +23 -0
  28. data/microformats.gemspec +35 -33
  29. metadata +122 -445
  30. data/LICENSE.md +0 -36
  31. data/spec/lib/microformats/absolute_uri_spec.rb +0 -56
  32. data/spec/lib/microformats/parser_spec.rb +0 -132
  33. data/spec/lib/microformats_spec.rb +0 -33
  34. data/spec/spec_helper.rb +0 -10
  35. data/spec/support/cases/microformats.org/microformats-2/microformats-2-0.html +0 -2
  36. data/spec/support/cases/microformats.org/microformats-2/microformats-2-0.js +0 -9
  37. data/spec/support/cases/microformats.org/microformats-2/microformats-2-1.html +0 -2
  38. data/spec/support/cases/microformats.org/microformats-2/microformats-2-1.js +0 -10
  39. data/spec/support/cases/microformats.org/microformats-2/microformats-2-2.html +0 -5
  40. data/spec/support/cases/microformats.org/microformats-2/microformats-2-2.js +0 -11
  41. data/spec/support/cases/microformats.org/microformats-2/microformats-2-3.html +0 -17
  42. data/spec/support/cases/microformats.org/microformats-2/microformats-2-3.js +0 -20
  43. data/spec/support/cases/microformats.org/microformats-2/microformats-2-4.html +0 -16
  44. data/spec/support/cases/microformats.org/microformats-2/microformats-2-4.js +0 -24
  45. data/spec/support/cases/microformats.org/microformats-2/microformats-2-5.html +0 -7
  46. data/spec/support/cases/microformats.org/microformats-2/microformats-2-5.js +0 -11
  47. data/spec/support/cases/microformats.org/microformats-2/microformats-2-6.html +0 -9
  48. data/spec/support/cases/microformats.org/microformats-2/microformats-2-6.js +0 -18
  49. data/spec/support/cases/microformats.org/microformats-2/microformats-2-7.html +0 -9
  50. data/spec/support/cases/microformats.org/microformats-2/microformats-2-7.js +0 -18
  51. data/spec/support/cases/microformats.org/microformats-2/microformats-2-8.html +0 -9
  52. data/spec/support/cases/microformats.org/microformats-2/microformats-2-8.js +0 -17
  53. data/spec/support/cases/microformats.org/microformats-2/microformats-2-9.html +0 -9
  54. data/spec/support/cases/microformats.org/microformats-2/microformats-2-9.js +0 -17
  55. data/spec/support/lib/edge_cases/blank_href.html +0 -23
  56. data/spec/support/lib/edge_cases/blank_href.js +0 -15
  57. data/spec/support/lib/edge_cases/blank_rel.html +0 -23
  58. data/spec/support/lib/edge_cases/blank_rel.js +0 -41
  59. data/spec/support/lib/edge_cases/blank_src.html +0 -24
  60. data/spec/support/lib/edge_cases/blank_src.js +0 -16
  61. data/spec/support/lib/edge_cases/blank_value.html +0 -5
  62. data/spec/support/lib/edge_cases/blank_value.js +0 -19
  63. data/spec/support/lib/edge_cases/relative.html +0 -29
  64. data/spec/support/lib/edge_cases/relative.js +0 -15
  65. data/spec/support/lib/microformats/blank_href.html +0 -23
  66. data/spec/support/lib/microformats/blank_href.js +0 -11
  67. data/spec/support/lib/microformats/implied_property/name-fail.html +0 -60
  68. data/spec/support/lib/microformats/implied_property/name-pass.html +0 -30
  69. data/spec/support/lib/microformats/implied_property/photo-fail.html +0 -60
  70. data/spec/support/lib/microformats/implied_property/photo-pass.html +0 -30
  71. data/spec/support/lib/microformats/implied_property/url-fail.html +0 -18
  72. data/spec/support/lib/microformats/implied_property/url-pass.html +0 -12
  73. data/spec/support/lib/microformats/implied_property/url-relative.html +0 -13
  74. data/spec/support/lib/microformats/implied_property/url-unnormalized.html +0 -12
  75. data/spec/support/lib/microformats/nested-format-with-property-of-same-name.html +0 -13
  76. data/spec/support/lib/microformats/nested-format-with-property-of-same-name.js +0 -16
  77. data/spec/support/lib/microformats/nested-format-with-property.html +0 -12
  78. data/spec/support/lib/microformats/nested-format-with-property.js +0 -16
  79. data/spec/support/lib/microformats/nested-format-without-property.html +0 -13
  80. data/spec/support/lib/microformats/nested-property.html +0 -12
  81. data/spec/support/lib/microformats/nested-property.js +0 -10
  82. data/spec/support/lib/microformats/rels-that-drop-the-base.html +0 -11
  83. data/spec/support/lib/microformats/rels-with-unnormalized-urls.html +0 -11
  84. data/spec/support/lib/microformats/rels.html +0 -12
  85. data/spec/support/lib/microformats/rels.js +0 -13
  86. data/spec/support/lib/microformats/simple.html +0 -23
  87. data/spec/support/lib/microformats/simple.js +0 -11
  88. data/vendor/tests/.gitignore +0 -25
  89. data/vendor/tests/LICENSE.md +0 -36
  90. data/vendor/tests/README.md +0 -48
  91. data/vendor/tests/app.js +0 -84
  92. data/vendor/tests/composer.json +0 -5
  93. data/vendor/tests/css/testsuite.css +0 -159
  94. data/vendor/tests/interface.js +0 -18
  95. data/vendor/tests/package.json +0 -27
  96. data/vendor/tests/tests/microformats-mixed/h-card/change-log.html +0 -63
  97. data/vendor/tests/tests/microformats-mixed/h-card/mixedpropertries.html +0 -14
  98. data/vendor/tests/tests/microformats-mixed/h-card/mixedpropertries.json +0 -22
  99. data/vendor/tests/tests/microformats-mixed/h-card/tworoots.html +0 -1
  100. data/vendor/tests/tests/microformats-mixed/h-card/tworoots.json +0 -10
  101. data/vendor/tests/tests/microformats-mixed/h-entry/mixedroots.html +0 -16
  102. data/vendor/tests/tests/microformats-mixed/h-entry/mixedroots.json +0 -38
  103. data/vendor/tests/tests/microformats-mixed/h-resume/change-log.html +0 -68
  104. data/vendor/tests/tests/microformats-mixed/h-resume/mixedroots.html +0 -16
  105. data/vendor/tests/tests/microformats-mixed/h-resume/mixedroots.json +0 -31
  106. data/vendor/tests/tests/microformats-v1/adr/change-log.html +0 -63
  107. data/vendor/tests/tests/microformats-v1/adr/simpleproperties.html +0 -8
  108. data/vendor/tests/tests/microformats-v1/adr/simpleproperties.json +0 -15
  109. data/vendor/tests/tests/microformats-v1/geo/abbrpattern.html +0 -5
  110. data/vendor/tests/tests/microformats-v1/geo/abbrpattern.json +0 -11
  111. data/vendor/tests/tests/microformats-v1/geo/change-log.1.html +0 -78
  112. data/vendor/tests/tests/microformats-v1/geo/change-log.html +0 -63
  113. data/vendor/tests/tests/microformats-v1/geo/hidden.html +0 -10
  114. data/vendor/tests/tests/microformats-v1/geo/hidden.json +0 -11
  115. data/vendor/tests/tests/microformats-v1/geo/simpleproperties.html +0 -6
  116. data/vendor/tests/tests/microformats-v1/geo/simpleproperties.json +0 -11
  117. data/vendor/tests/tests/microformats-v1/geo/valuetitleclass.html +0 -11
  118. data/vendor/tests/tests/microformats-v1/geo/valuetitleclass.json +0 -11
  119. data/vendor/tests/tests/microformats-v1/hcalendar/ampm.html +0 -41
  120. data/vendor/tests/tests/microformats-v1/hcalendar/ampm.json +0 -21
  121. data/vendor/tests/tests/microformats-v1/hcalendar/attendees.html +0 -13
  122. data/vendor/tests/tests/microformats-v1/hcalendar/attendees.json +0 -37
  123. data/vendor/tests/tests/microformats-v1/hcalendar/change-log.html +0 -68
  124. data/vendor/tests/tests/microformats-v1/hcalendar/combining.html +0 -15
  125. data/vendor/tests/tests/microformats-v1/hcalendar/combining.json +0 -31
  126. data/vendor/tests/tests/microformats-v1/hcalendar/concatenate.html +0 -7
  127. data/vendor/tests/tests/microformats-v1/hcalendar/concatenate.json +0 -12
  128. data/vendor/tests/tests/microformats-v1/hcalendar/time.html +0 -44
  129. data/vendor/tests/tests/microformats-v1/hcalendar/time.json +0 -22
  130. data/vendor/tests/tests/microformats-v1/hcard/change-log.html +0 -68
  131. data/vendor/tests/tests/microformats-v1/hcard/email.html +0 -14
  132. data/vendor/tests/tests/microformats-v1/hcard/email.json +0 -11
  133. data/vendor/tests/tests/microformats-v1/hcard/format.html +0 -6
  134. data/vendor/tests/tests/microformats-v1/hcard/format.json +0 -11
  135. data/vendor/tests/tests/microformats-v1/hcard/hyperlinkedphoto.html +0 -3
  136. data/vendor/tests/tests/microformats-v1/hcard/hyperlinkedphoto.json +0 -8
  137. data/vendor/tests/tests/microformats-v1/hcard/justahyperlink.html +0 -1
  138. data/vendor/tests/tests/microformats-v1/hcard/justahyperlink.json +0 -8
  139. data/vendor/tests/tests/microformats-v1/hcard/justaname.html +0 -1
  140. data/vendor/tests/tests/microformats-v1/hcard/justaname.json +0 -8
  141. data/vendor/tests/tests/microformats-v1/hcard/multiple.html +0 -74
  142. data/vendor/tests/tests/microformats-v1/hcard/multiple.json +0 -65
  143. data/vendor/tests/tests/microformats-v1/hcard/name.html +0 -11
  144. data/vendor/tests/tests/microformats-v1/hcard/name.json +0 -15
  145. data/vendor/tests/tests/microformats-v1/hcard/single.html +0 -14
  146. data/vendor/tests/tests/microformats-v1/hcard/single.json +0 -24
  147. data/vendor/tests/tests/microformats-v1/hentry/change-log.html +0 -73
  148. data/vendor/tests/tests/microformats-v1/hentry/summarycontent.html +0 -20
  149. data/vendor/tests/tests/microformats-v1/hentry/summarycontent.json +0 -24
  150. data/vendor/tests/tests/microformats-v1/hfeed/simple.html +0 -30
  151. data/vendor/tests/tests/microformats-v1/hfeed/simple.json +0 -49
  152. data/vendor/tests/tests/microformats-v1/hnews/all.html +0 -37
  153. data/vendor/tests/tests/microformats-v1/hnews/all.json +0 -74
  154. data/vendor/tests/tests/microformats-v1/hnews/change-log.html +0 -72
  155. data/vendor/tests/tests/microformats-v1/hnews/minimum.html +0 -25
  156. data/vendor/tests/tests/microformats-v1/hnews/minimum.json +0 -48
  157. data/vendor/tests/tests/microformats-v1/hproduct/aggregate.html +0 -26
  158. data/vendor/tests/tests/microformats-v1/hproduct/aggregate.json +0 -52
  159. data/vendor/tests/tests/microformats-v1/hproduct/change-log.html +0 -62
  160. data/vendor/tests/tests/microformats-v1/hproduct/simpleproperties.html +0 -13
  161. data/vendor/tests/tests/microformats-v1/hproduct/simpleproperties.json +0 -33
  162. data/vendor/tests/tests/microformats-v1/hresume/affiliation.html +0 -12
  163. data/vendor/tests/tests/microformats-v1/hresume/affiliation.json +0 -25
  164. data/vendor/tests/tests/microformats-v1/hresume/change-log.html +0 -73
  165. data/vendor/tests/tests/microformats-v1/hresume/contact.html +0 -18
  166. data/vendor/tests/tests/microformats-v1/hresume/contact.json +0 -32
  167. data/vendor/tests/tests/microformats-v1/hresume/education.html +0 -13
  168. data/vendor/tests/tests/microformats-v1/hresume/education.json +0 -29
  169. data/vendor/tests/tests/microformats-v1/hresume/skill.html +0 -12
  170. data/vendor/tests/tests/microformats-v1/hresume/skill.json +0 -33
  171. data/vendor/tests/tests/microformats-v1/hresume/work.html +0 -16
  172. data/vendor/tests/tests/microformats-v1/hresume/work.json +0 -30
  173. data/vendor/tests/tests/microformats-v1/hreview-aggregate/change-log.html +0 -67
  174. data/vendor/tests/tests/microformats-v1/hreview-aggregate/hcard.html +0 -18
  175. data/vendor/tests/tests/microformats-v1/hreview-aggregate/hcard.json +0 -31
  176. data/vendor/tests/tests/microformats-v1/hreview-aggregate/justahyperlink.html +0 -6
  177. data/vendor/tests/tests/microformats-v1/hreview-aggregate/justahyperlink.json +0 -19
  178. data/vendor/tests/tests/microformats-v1/hreview-aggregate/vevent.html +0 -13
  179. data/vendor/tests/tests/microformats-v1/hreview-aggregate/vevent.json +0 -22
  180. data/vendor/tests/tests/microformats-v1/hreview/change-log.html +0 -73
  181. data/vendor/tests/tests/microformats-v1/hreview/item.html +0 -8
  182. data/vendor/tests/tests/microformats-v1/hreview/item.json +0 -19
  183. data/vendor/tests/tests/microformats-v1/hreview/vcard.html +0 -23
  184. data/vendor/tests/tests/microformats-v1/hreview/vcard.json +0 -58
  185. data/vendor/tests/tests/microformats-v1/includes/change-log.html +0 -72
  186. data/vendor/tests/tests/microformats-v1/includes/hcarditemref.html +0 -16
  187. data/vendor/tests/tests/microformats-v1/includes/hcarditemref.json +0 -49
  188. data/vendor/tests/tests/microformats-v1/includes/heventitemref.html +0 -25
  189. data/vendor/tests/tests/microformats-v1/includes/heventitemref.json +0 -33
  190. data/vendor/tests/tests/microformats-v1/includes/hyperlink.html +0 -18
  191. data/vendor/tests/tests/microformats-v1/includes/hyperlink.json +0 -43
  192. data/vendor/tests/tests/microformats-v1/includes/object.html +0 -23
  193. data/vendor/tests/tests/microformats-v1/includes/object.json +0 -42
  194. data/vendor/tests/tests/microformats-v1/includes/table.html +0 -12
  195. data/vendor/tests/tests/microformats-v1/includes/table.json +0 -19
  196. data/vendor/tests/tests/microformats-v2/h-adr/change-log.html +0 -62
  197. data/vendor/tests/tests/microformats-v2/h-adr/geo.html +0 -10
  198. data/vendor/tests/tests/microformats-v2/h-adr/geo.json +0 -16
  199. data/vendor/tests/tests/microformats-v2/h-adr/geourl.html +0 -4
  200. data/vendor/tests/tests/microformats-v2/h-adr/geourl.json +0 -13
  201. data/vendor/tests/tests/microformats-v2/h-adr/justaname.html +0 -1
  202. data/vendor/tests/tests/microformats-v2/h-adr/justaname.json +0 -10
  203. data/vendor/tests/tests/microformats-v2/h-adr/lettercase.html +0 -21
  204. data/vendor/tests/tests/microformats-v2/h-adr/lettercase.json +0 -12
  205. data/vendor/tests/tests/microformats-v2/h-adr/simpleproperties.html +0 -8
  206. data/vendor/tests/tests/microformats-v2/h-adr/simpleproperties.json +0 -16
  207. data/vendor/tests/tests/microformats-v2/h-as-note/note.html +0 -56
  208. data/vendor/tests/tests/microformats-v2/h-as-note/note.json +0 -98
  209. data/vendor/tests/tests/microformats-v2/h-card/baseurl.html +0 -6
  210. data/vendor/tests/tests/microformats-v2/h-card/baseurl.json +0 -26
  211. data/vendor/tests/tests/microformats-v2/h-card/change-log.html +0 -100
  212. data/vendor/tests/tests/microformats-v2/h-card/childimplied.html +0 -7
  213. data/vendor/tests/tests/microformats-v2/h-card/childimplied.json +0 -12
  214. data/vendor/tests/tests/microformats-v2/h-card/extendeddescription.html +0 -10
  215. data/vendor/tests/tests/microformats-v2/h-card/extendeddescription.json +0 -15
  216. data/vendor/tests/tests/microformats-v2/h-card/hcard.html +0 -4
  217. data/vendor/tests/tests/microformats-v2/h-card/hcard.json +0 -19
  218. data/vendor/tests/tests/microformats-v2/h-card/horghcard.html +0 -4
  219. data/vendor/tests/tests/microformats-v2/h-card/horghcard.json +0 -19
  220. data/vendor/tests/tests/microformats-v2/h-card/hyperlinkedphoto.html +0 -3
  221. data/vendor/tests/tests/microformats-v2/h-card/hyperlinkedphoto.json +0 -12
  222. data/vendor/tests/tests/microformats-v2/h-card/impliedname.html +0 -15
  223. data/vendor/tests/tests/microformats-v2/h-card/impliedname.json +0 -90
  224. data/vendor/tests/tests/microformats-v2/h-card/impliedphoto.html +0 -11
  225. data/vendor/tests/tests/microformats-v2/h-card/impliedphoto.json +0 -72
  226. data/vendor/tests/tests/microformats-v2/h-card/impliedurl.html +0 -5
  227. data/vendor/tests/tests/microformats-v2/h-card/impliedurl.json +0 -45
  228. data/vendor/tests/tests/microformats-v2/h-card/justahyperlink.html +0 -1
  229. data/vendor/tests/tests/microformats-v2/h-card/justahyperlink.json +0 -11
  230. data/vendor/tests/tests/microformats-v2/h-card/justaname.html +0 -1
  231. data/vendor/tests/tests/microformats-v2/h-card/justaname.json +0 -10
  232. data/vendor/tests/tests/microformats-v2/h-card/nested.html +0 -4
  233. data/vendor/tests/tests/microformats-v2/h-card/nested.json +0 -18
  234. data/vendor/tests/tests/microformats-v2/h-card/p-property.html +0 -21
  235. data/vendor/tests/tests/microformats-v2/h-card/p-property.json +0 -15
  236. data/vendor/tests/tests/microformats-v2/h-card/relativeurls.html +0 -6
  237. data/vendor/tests/tests/microformats-v2/h-card/relativeurls.json +0 -29
  238. data/vendor/tests/tests/microformats-v2/h-entry/change-log.html +0 -90
  239. data/vendor/tests/tests/microformats-v2/h-entry/encoding.html +0 -3
  240. data/vendor/tests/tests/microformats-v2/h-entry/encoding.json +0 -14
  241. data/vendor/tests/tests/microformats-v2/h-entry/impliedvalue-nested.html +0 -9
  242. data/vendor/tests/tests/microformats-v2/h-entry/impliedvalue-nested.json +0 -27
  243. data/vendor/tests/tests/microformats-v2/h-entry/justahyperlink.html +0 -1
  244. data/vendor/tests/tests/microformats-v2/h-entry/justahyperlink.json +0 -11
  245. data/vendor/tests/tests/microformats-v2/h-entry/justaname.html +0 -1
  246. data/vendor/tests/tests/microformats-v2/h-entry/justaname.json +0 -10
  247. data/vendor/tests/tests/microformats-v2/h-entry/scriptstyletags.html +0 -4
  248. data/vendor/tests/tests/microformats-v2/h-entry/scriptstyletags.json +0 -14
  249. data/vendor/tests/tests/microformats-v2/h-entry/summarycontent.html +0 -20
  250. data/vendor/tests/tests/microformats-v2/h-entry/summarycontent.json +0 -25
  251. data/vendor/tests/tests/microformats-v2/h-entry/u-property.html +0 -33
  252. data/vendor/tests/tests/microformats-v2/h-entry/u-property.json +0 -12
  253. data/vendor/tests/tests/microformats-v2/h-entry/urlincontent.html +0 -13
  254. data/vendor/tests/tests/microformats-v2/h-entry/urlincontent.json +0 -14
  255. data/vendor/tests/tests/microformats-v2/h-event/ampm.html +0 -41
  256. data/vendor/tests/tests/microformats-v2/h-event/ampm.json +0 -21
  257. data/vendor/tests/tests/microformats-v2/h-event/attendees.html +0 -13
  258. data/vendor/tests/tests/microformats-v2/h-event/attendees.json +0 -37
  259. data/vendor/tests/tests/microformats-v2/h-event/change-log.html +0 -82
  260. data/vendor/tests/tests/microformats-v2/h-event/combining.html +0 -13
  261. data/vendor/tests/tests/microformats-v2/h-event/combining.json +0 -25
  262. data/vendor/tests/tests/microformats-v2/h-event/concatenate.html +0 -8
  263. data/vendor/tests/tests/microformats-v2/h-event/concatenate.json +0 -12
  264. data/vendor/tests/tests/microformats-v2/h-event/dates.html +0 -13
  265. data/vendor/tests/tests/microformats-v2/h-event/dates.json +0 -26
  266. data/vendor/tests/tests/microformats-v2/h-event/dt-property.html +0 -23
  267. data/vendor/tests/tests/microformats-v2/h-event/dt-property.json +0 -20
  268. data/vendor/tests/tests/microformats-v2/h-event/justahyperlink.html +0 -1
  269. data/vendor/tests/tests/microformats-v2/h-event/justahyperlink.json +0 -11
  270. data/vendor/tests/tests/microformats-v2/h-event/justaname.html +0 -1
  271. data/vendor/tests/tests/microformats-v2/h-event/justaname.json +0 -10
  272. data/vendor/tests/tests/microformats-v2/h-event/time.html +0 -47
  273. data/vendor/tests/tests/microformats-v2/h-event/time.json +0 -25
  274. data/vendor/tests/tests/microformats-v2/h-feed/implied-title.html +0 -30
  275. data/vendor/tests/tests/microformats-v2/h-feed/implied-title.json +0 -23
  276. data/vendor/tests/tests/microformats-v2/h-feed/simple.html +0 -26
  277. data/vendor/tests/tests/microformats-v2/h-feed/simple.json +0 -33
  278. data/vendor/tests/tests/microformats-v2/h-geo/abbrpattern.html +0 -5
  279. data/vendor/tests/tests/microformats-v2/h-geo/abbrpattern.json +0 -12
  280. data/vendor/tests/tests/microformats-v2/h-geo/altitude.html +0 -8
  281. data/vendor/tests/tests/microformats-v2/h-geo/altitude.json +0 -13
  282. data/vendor/tests/tests/microformats-v2/h-geo/change-log.html +0 -67
  283. data/vendor/tests/tests/microformats-v2/h-geo/hidden.html +0 -10
  284. data/vendor/tests/tests/microformats-v2/h-geo/hidden.json +0 -12
  285. data/vendor/tests/tests/microformats-v2/h-geo/justaname.html +0 -3
  286. data/vendor/tests/tests/microformats-v2/h-geo/justaname.json +0 -10
  287. data/vendor/tests/tests/microformats-v2/h-geo/simpleproperties.html +0 -5
  288. data/vendor/tests/tests/microformats-v2/h-geo/simpleproperties.json +0 -12
  289. data/vendor/tests/tests/microformats-v2/h-geo/valuetitleclass.html +0 -11
  290. data/vendor/tests/tests/microformats-v2/h-geo/valuetitleclass.json +0 -12
  291. data/vendor/tests/tests/microformats-v2/h-news/all.html +0 -35
  292. data/vendor/tests/tests/microformats-v2/h-news/all.json +0 -51
  293. data/vendor/tests/tests/microformats-v2/h-news/change-log.html +0 -78
  294. data/vendor/tests/tests/microformats-v2/h-news/minimum.html +0 -24
  295. data/vendor/tests/tests/microformats-v2/h-news/minimum.json +0 -40
  296. data/vendor/tests/tests/microformats-v2/h-org/change-log.html +0 -57
  297. data/vendor/tests/tests/microformats-v2/h-org/hyperlink.html +0 -1
  298. data/vendor/tests/tests/microformats-v2/h-org/hyperlink.json +0 -11
  299. data/vendor/tests/tests/microformats-v2/h-org/simple.html +0 -1
  300. data/vendor/tests/tests/microformats-v2/h-org/simple.json +0 -10
  301. data/vendor/tests/tests/microformats-v2/h-org/simpleproperties.html +0 -4
  302. data/vendor/tests/tests/microformats-v2/h-org/simpleproperties.json +0 -12
  303. data/vendor/tests/tests/microformats-v2/h-product/aggregate.html +0 -21
  304. data/vendor/tests/tests/microformats-v2/h-product/aggregate.json +0 -45
  305. data/vendor/tests/tests/microformats-v2/h-product/change-log.html +0 -62
  306. data/vendor/tests/tests/microformats-v2/h-product/justahyperlink.html +0 -1
  307. data/vendor/tests/tests/microformats-v2/h-product/justahyperlink.json +0 -11
  308. data/vendor/tests/tests/microformats-v2/h-product/justaname.html +0 -1
  309. data/vendor/tests/tests/microformats-v2/h-product/justaname.json +0 -10
  310. data/vendor/tests/tests/microformats-v2/h-product/simpleproperties.html +0 -10
  311. data/vendor/tests/tests/microformats-v2/h-product/simpleproperties.json +0 -26
  312. data/vendor/tests/tests/microformats-v2/h-recipe/all.html +0 -63
  313. data/vendor/tests/tests/microformats-v2/h-recipe/all.json +0 -54
  314. data/vendor/tests/tests/microformats-v2/h-recipe/change-log.html +0 -62
  315. data/vendor/tests/tests/microformats-v2/h-recipe/minimum.html +0 -7
  316. data/vendor/tests/tests/microformats-v2/h-recipe/minimum.json +0 -17
  317. data/vendor/tests/tests/microformats-v2/h-resume/affiliation.html +0 -12
  318. data/vendor/tests/tests/microformats-v2/h-resume/affiliation.json +0 -20
  319. data/vendor/tests/tests/microformats-v2/h-resume/change-log.html +0 -78
  320. data/vendor/tests/tests/microformats-v2/h-resume/contact.html +0 -17
  321. data/vendor/tests/tests/microformats-v2/h-resume/contact.json +0 -26
  322. data/vendor/tests/tests/microformats-v2/h-resume/education.html +0 -13
  323. data/vendor/tests/tests/microformats-v2/h-resume/education.json +0 -30
  324. data/vendor/tests/tests/microformats-v2/h-resume/justaname.html +0 -1
  325. data/vendor/tests/tests/microformats-v2/h-resume/justaname.json +0 -10
  326. data/vendor/tests/tests/microformats-v2/h-resume/skill.html +0 -12
  327. data/vendor/tests/tests/microformats-v2/h-resume/skill.json +0 -12
  328. data/vendor/tests/tests/microformats-v2/h-resume/work.html +0 -16
  329. data/vendor/tests/tests/microformats-v2/h-resume/work.json +0 -31
  330. data/vendor/tests/tests/microformats-v2/h-review-aggregate/change-log.html +0 -78
  331. data/vendor/tests/tests/microformats-v2/h-review-aggregate/hevent.html +0 -13
  332. data/vendor/tests/tests/microformats-v2/h-review-aggregate/hevent.json +0 -23
  333. data/vendor/tests/tests/microformats-v2/h-review-aggregate/justahyperlink.html +0 -8
  334. data/vendor/tests/tests/microformats-v2/h-review-aggregate/justahyperlink.json +0 -19
  335. data/vendor/tests/tests/microformats-v2/h-review-aggregate/simpleproperties.html +0 -18
  336. data/vendor/tests/tests/microformats-v2/h-review-aggregate/simpleproperties.json +0 -26
  337. data/vendor/tests/tests/microformats-v2/h-review/change-log.html +0 -84
  338. data/vendor/tests/tests/microformats-v2/h-review/hyperlink.html +0 -1
  339. data/vendor/tests/tests/microformats-v2/h-review/hyperlink.json +0 -11
  340. data/vendor/tests/tests/microformats-v2/h-review/implieditem.html +0 -4
  341. data/vendor/tests/tests/microformats-v2/h-review/implieditem.json +0 -19
  342. data/vendor/tests/tests/microformats-v2/h-review/item.html +0 -8
  343. data/vendor/tests/tests/microformats-v2/h-review/item.json +0 -20
  344. data/vendor/tests/tests/microformats-v2/h-review/justaname.html +0 -1
  345. data/vendor/tests/tests/microformats-v2/h-review/justaname.json +0 -10
  346. data/vendor/tests/tests/microformats-v2/h-review/photo.html +0 -1
  347. data/vendor/tests/tests/microformats-v2/h-review/photo.json +0 -11
  348. data/vendor/tests/tests/microformats-v2/h-review/vcard.html +0 -23
  349. data/vendor/tests/tests/microformats-v2/h-review/vcard.json +0 -48
  350. data/vendor/tests/tests/microformats-v2/rel/change-log.html +0 -67
  351. data/vendor/tests/tests/microformats-v2/rel/duplicate-rels.html +0 -10
  352. data/vendor/tests/tests/microformats-v2/rel/duplicate-rels.json +0 -75
  353. data/vendor/tests/tests/microformats-v2/rel/license.html +0 -1
  354. data/vendor/tests/tests/microformats-v2/rel/license.json +0 -12
  355. data/vendor/tests/tests/microformats-v2/rel/nofollow.html +0 -1
  356. data/vendor/tests/tests/microformats-v2/rel/nofollow.json +0 -12
  357. data/vendor/tests/tests/microformats-v2/rel/rel-urls.html +0 -8
  358. data/vendor/tests/tests/microformats-v2/rel/rel-urls.json +0 -33
  359. data/vendor/tests/tests/microformats-v2/rel/varying-text-duplicate-rels.html +0 -4
  360. data/vendor/tests/tests/microformats-v2/rel/varying-text-duplicate-rels.json +0 -20
  361. data/vendor/tests/tests/microformats-v2/rel/xfn-all.html +0 -19
  362. data/vendor/tests/tests/microformats-v2/rel/xfn-all.json +0 -92
  363. data/vendor/tests/tests/microformats-v2/rel/xfn-elsewhere.html +0 -10
  364. data/vendor/tests/tests/microformats-v2/rel/xfn-elsewhere.json +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6227d8558099bebeb657934debc897fab6c3c14a
4
- data.tar.gz: a330025f850142e19df0d6b27f8921713fcccad2
2
+ SHA256:
3
+ metadata.gz: 0db7ff0869ff426739558604145a7a0672869e50e201b6707bf63a409e8e3065
4
+ data.tar.gz: c67ef5d3b811984836bbea69d5551928573f7478da29ad978c1b582b524927c7
5
5
  SHA512:
6
- metadata.gz: c1e7f820dcfd61e727e41bc0d2f670b20ba19893ec75a70a37185d9cf657f52dd6d98cccf09790964edb23ca962a1e715f37a9a4a647badbb5818f45b7e31aae
7
- data.tar.gz: 8c18dbe60bc099cfd3a8a455a9b2c7060e9c9b1d18e879fc1b33ab1349bd4772ac680b63cc23c12a0bc1a86631ca2d91b010933f2761e09c5f3b636f1209dc49
6
+ metadata.gz: 979fbfccec1a40ebee6392f3695c3d0eddabb4c75968a335805aa711d2f833a2e2fdb8861e8ac32f0e2133f2b3d44ddcf63e71006ff6e552bd3700a5b4c652f0
7
+ data.tar.gz: 8a4abccee37a129230112c8368d8da513b34528e733a32866fe0c35798f17b37c7c293664ae62e37f4b69ee4c3852f727e3d60927ef1409b546a6c19986e673e
@@ -0,0 +1,10 @@
1
+ # EditorConfig is awesome: http://EditorConfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+ insert_final_newline = true
8
+ indent_size = 2
9
+ indent_style = space
10
+ trim_trailing_whitespace = true
data/.gitignore CHANGED
@@ -1,19 +1,37 @@
1
1
  *.gem
2
2
  *.rbc
3
- .bundle
4
- .config
5
- .yardoc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ # Documentation cache and generated files:
17
+ /.yardoc/
18
+ /_yardoc/
19
+ /doc/
20
+ /rdoc/
21
+
22
+ # Environment normalization:
23
+ /.bundle/
24
+ /vendor/bundle
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
6
29
  Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- coverage
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
35
+
36
+ #vim files being edited
19
37
  *.swp
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
- --color
2
- --format doc
1
+ --format documentation
2
+ --order random
3
+ --require spec_helper
@@ -0,0 +1,3 @@
1
+ --display-style-guide
2
+ --extra-details
3
+ --parallel
@@ -0,0 +1,22 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ Metrics/BlockLength:
5
+ Exclude:
6
+ - microformats.gemspec
7
+ - spec/**/*.rb
8
+
9
+ Metrics/LineLength:
10
+ Enabled: false
11
+
12
+ RSpec/MultipleExpectations:
13
+ Max: 5
14
+
15
+ RSpec/NestedGroups:
16
+ Max: 4
17
+
18
+ Style/Documentation:
19
+ Enabled: false
20
+
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
@@ -0,0 +1 @@
1
+ 2.7.1
@@ -0,0 +1,11 @@
1
+ require 'simplecov-console'
2
+
3
+ formatters = [SimpleCov::Formatter::HTMLFormatter]
4
+
5
+ if RSpec.configuration.files_to_run.length > 1
6
+ formatters << SimpleCov::Formatter::Console
7
+ end
8
+
9
+ SimpleCov.start do
10
+ formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
11
+ end
@@ -1,4 +1,18 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
- - 2.2.5
4
- script: bundle exec rspec
4
+ - 2.4.10
5
+ - 2.5.8
6
+ - 2.6.6
7
+ - 2.7.1
8
+ before_install:
9
+ - gem update --system
10
+ - gem update bundler
11
+ before_script:
12
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
13
+ - chmod +x ./cc-test-reporter
14
+ - ./cc-test-reporter before-build
15
+ script:
16
+ - bundle exec rspec
17
+ after_script:
18
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -0,0 +1,103 @@
1
+ # Contributing to microformats-ruby
2
+
3
+ There are a couple ways you can help improve microformats-ruby:
4
+
5
+ 1. Fix an existing [issue][issues] and submit a [pull request][pulls].
6
+ 1. Review open [pull requests][pulls].
7
+ 1. Report a new [issue][issues]. _Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue._
8
+
9
+ ## Getting Started
10
+
11
+ microformats-ruby is developed using Ruby 2.7.1 and is additionally tested against versions 2.4.10, 2.5.8, and 2.6.6 using [Travis CI](https://travis-ci.org/microformats/microformats-ruby).
12
+
13
+ Before making changes to microformats-ruby, you'll want to install Ruby 2.7.1. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.7.1 using your method of choice, install the project's gems by running:
14
+
15
+ ```sh
16
+ bundle install
17
+ ```
18
+
19
+ ## Making Changes
20
+
21
+ 1. Fork and clone the project's repo.
22
+ 1. Install development dependencies as outlined above.
23
+ 1. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
24
+ 1. _Write some code!_
25
+ 1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bundle exec rspec`.
26
+ 1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://chris.beams.io/posts/git-commit/) for tips on writing useful Git commit messages.)_
27
+ 1. Push the branch to your fork: `git push -u origin my-new-feature`.
28
+ 1. Create a new [pull request][pulls] and we'll review your changes.
29
+
30
+ ## Verifying Changes
31
+
32
+ We use the following tools to evaluate code quality and verify behavior:
33
+
34
+ - The test suite uses [RSpec](http://rspec.info) (`bundle exec rspec`).
35
+ - Static code analysis uses [RuboCop](https://github.com/bbatsov/rubocop) (`bundle exec rubocop`).
36
+
37
+ Before submitting a [pull request][pulls], use the above tools to verify your changes.
38
+
39
+ You may also test your code interactively by running:
40
+
41
+ ```sh
42
+ bundle console
43
+ ```
44
+
45
+ ## Releasing New Versions
46
+
47
+ First, check out the latest code from GitHub:
48
+
49
+ ```sh
50
+ git pull origin master
51
+ ```
52
+
53
+ Following the [Semantic Versioning](https://semver.org) conventions, update the gem version throughout the project (but most importantly in `lib/microformats/version.rb`).
54
+
55
+ Confirm that the gem builds correctly:
56
+
57
+ ```sh
58
+ bundle exec rake build
59
+ ```
60
+
61
+ If that works, install the new version of the gem locally:
62
+
63
+ ```sh
64
+ bundle exec rake install
65
+ ```
66
+
67
+ If that works, uninstall the gem.
68
+
69
+ ```sh
70
+ gem uninstall microformats
71
+ ```
72
+
73
+ Clean up any mess made from testing.
74
+
75
+ ```sh
76
+ bundle exec rake clean
77
+ bundle exec rake clobber
78
+ ```
79
+
80
+ Assuming you're one of the gem owners and have release privileges, release the gem!
81
+
82
+ ```
83
+ bundle exec rake release
84
+ ```
85
+
86
+ If that works, you’ve just released a new version of the gem! Yay! You can see it at: [https://rubygems.org/gems/microformats](https://rubygems.org/gems/microformats)
87
+
88
+ ### Handling Errors
89
+
90
+ If `rake release` failed because of an error with your authentication to RubyGems.org, follow the instructions in the error message then repeat the `rake release` step.
91
+
92
+ ### Getting Help
93
+
94
+ If any other errors occurred along the way and you're stuck, get in touch via [IRC](http://microformats.org/wiki/irc) (#microformats on freenode) or the #microformats channel in [the IndieWebCamp Slack](https://indieweb.org/Slack) for help.
95
+
96
+ ## Code Style
97
+
98
+ Code formatting conventions are defined in the `.editorconfig` file which uses the [EditorConfig](http://editorconfig.org) syntax. There are [plugins for a variety of editors](http://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file. We recommended you install the EditorConfig plugin for your editor of choice.
99
+
100
+ Your bug fix or feature addition won't be rejected if it runs afoul of any (or all) of these guidelines, but following the guidelines will definitely make everyone's lives a little easier.
101
+
102
+ [issues]: https://github.com/microformats/microformats-ruby/issues
103
+ [pulls]: https://github.com/microformats/microformats-ruby/pulls
data/Guardfile CHANGED
@@ -1,5 +1,5 @@
1
- guard "rspec" do
1
+ guard :rspec, cmd: 'bundle exec rspec' do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch("spec/spec_helper.rb") { "spec" }
4
+ watch('spec/spec_helper.rb') { 'spec' }
5
5
  end
data/LICENSE ADDED
@@ -0,0 +1,116 @@
1
+ CC0 1.0 Universal
2
+
3
+ Statement of Purpose
4
+
5
+ The laws of most jurisdictions throughout the world automatically confer
6
+ exclusive Copyright and Related Rights (defined below) upon the creator and
7
+ subsequent owner(s) (each and all, an "owner") of an original work of
8
+ authorship and/or a database (each, a "Work").
9
+
10
+ Certain owners wish to permanently relinquish those rights to a Work for the
11
+ purpose of contributing to a commons of creative, cultural and scientific
12
+ works ("Commons") that the public can reliably and without fear of later
13
+ claims of infringement build upon, modify, incorporate in other works, reuse
14
+ and redistribute as freely as possible in any form whatsoever and for any
15
+ purposes, including without limitation commercial purposes. These owners may
16
+ contribute to the Commons to promote the ideal of a free culture and the
17
+ further production of creative, cultural and scientific works, or to gain
18
+ reputation or greater distribution for their Work in part through the use and
19
+ efforts of others.
20
+
21
+ For these and/or other purposes and motivations, and without any expectation
22
+ of additional consideration or compensation, the person associating CC0 with a
23
+ Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
24
+ and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
25
+ and publicly distribute the Work under its terms, with knowledge of his or her
26
+ Copyright and Related Rights in the Work and the meaning and intended legal
27
+ effect of CC0 on those rights.
28
+
29
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
30
+ protected by copyright and related or neighboring rights ("Copyright and
31
+ Related Rights"). Copyright and Related Rights include, but are not limited
32
+ to, the following:
33
+
34
+ i. the right to reproduce, adapt, distribute, perform, display, communicate,
35
+ and translate a Work;
36
+
37
+ ii. moral rights retained by the original author(s) and/or performer(s);
38
+
39
+ iii. publicity and privacy rights pertaining to a person's image or likeness
40
+ depicted in a Work;
41
+
42
+ iv. rights protecting against unfair competition in regards to a Work,
43
+ subject to the limitations in paragraph 4(a), below;
44
+
45
+ v. rights protecting the extraction, dissemination, use and reuse of data in
46
+ a Work;
47
+
48
+ vi. database rights (such as those arising under Directive 96/9/EC of the
49
+ European Parliament and of the Council of 11 March 1996 on the legal
50
+ protection of databases, and under any national implementation thereof,
51
+ including any amended or successor version of such directive); and
52
+
53
+ vii. other similar, equivalent or corresponding rights throughout the world
54
+ based on applicable law or treaty, and any national implementations thereof.
55
+
56
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of,
57
+ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
58
+ unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
59
+ and Related Rights and associated claims and causes of action, whether now
60
+ known or unknown (including existing as well as future claims and causes of
61
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum
62
+ duration provided by applicable law or treaty (including future time
63
+ extensions), (iii) in any current or future medium and for any number of
64
+ copies, and (iv) for any purpose whatsoever, including without limitation
65
+ commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
66
+ the Waiver for the benefit of each member of the public at large and to the
67
+ detriment of Affirmer's heirs and successors, fully intending that such Waiver
68
+ shall not be subject to revocation, rescission, cancellation, termination, or
69
+ any other legal or equitable action to disrupt the quiet enjoyment of the Work
70
+ by the public as contemplated by Affirmer's express Statement of Purpose.
71
+
72
+ 3. Public License Fallback. Should any part of the Waiver for any reason be
73
+ judged legally invalid or ineffective under applicable law, then the Waiver
74
+ shall be preserved to the maximum extent permitted taking into account
75
+ Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
76
+ is so judged Affirmer hereby grants to each affected person a royalty-free,
77
+ non transferable, non sublicensable, non exclusive, irrevocable and
78
+ unconditional license to exercise Affirmer's Copyright and Related Rights in
79
+ the Work (i) in all territories worldwide, (ii) for the maximum duration
80
+ provided by applicable law or treaty (including future time extensions), (iii)
81
+ in any current or future medium and for any number of copies, and (iv) for any
82
+ purpose whatsoever, including without limitation commercial, advertising or
83
+ promotional purposes (the "License"). The License shall be deemed effective as
84
+ of the date CC0 was applied by Affirmer to the Work. Should any part of the
85
+ License for any reason be judged legally invalid or ineffective under
86
+ applicable law, such partial invalidity or ineffectiveness shall not
87
+ invalidate the remainder of the License, and in such case Affirmer hereby
88
+ affirms that he or she will not (i) exercise any of his or her remaining
89
+ Copyright and Related Rights in the Work or (ii) assert any associated claims
90
+ and causes of action with respect to the Work, in either case contrary to
91
+ Affirmer's express Statement of Purpose.
92
+
93
+ 4. Limitations and Disclaimers.
94
+
95
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
96
+ surrendered, licensed or otherwise affected by this document.
97
+
98
+ b. Affirmer offers the Work as-is and makes no representations or warranties
99
+ of any kind concerning the Work, express, implied, statutory or otherwise,
100
+ including without limitation warranties of title, merchantability, fitness
101
+ for a particular purpose, non infringement, or the absence of latent or
102
+ other defects, accuracy, or the present or absence of errors, whether or not
103
+ discoverable, all to the greatest extent permissible under applicable law.
104
+
105
+ c. Affirmer disclaims responsibility for clearing rights of other persons
106
+ that may apply to the Work or any use thereof, including without limitation
107
+ any person's Copyright and Related Rights in the Work. Further, Affirmer
108
+ disclaims responsibility for obtaining any necessary consents, permissions
109
+ or other rights required for any use of the Work.
110
+
111
+ d. Affirmer understands and acknowledges that Creative Commons is not a
112
+ party to this document and has no duty or obligation with respect to this
113
+ CC0 or use of the Work.
114
+
115
+ For more information, please see
116
+ <http://creativecommons.org/publicdomain/zero/1.0/>
data/README.md CHANGED
@@ -1,243 +1,183 @@
1
- # Microformats (ruby)
1
+ # ![Microformats Logo](https://raw.githubusercontent.com/microformats/microformats-ruby/master/logo.svg?sanitize=true) Microformats Ruby
2
2
 
3
- [![Build Status](https://travis-ci.org/indieweb/microformats-ruby.svg)](https://travis-ci.org/indieweb/microformats-ruby)
4
- [![Code Climate](https://codeclimate.com/github/indieweb/microformats-ruby/badges/gpa.svg)](https://codeclimate.com/github/indieweb/microformats-ruby)
3
+ **A Ruby gem for parsing HTML documents containing microformats.**
5
4
 
6
- A Ruby gem to parse HTML containing one or more microformats and [microformats2](http://microformats.org/wiki/microformats-2)
7
- and return a collection of dynamically defined Ruby objects, a Ruby hash or a JSON hash.
5
+ [![Gem](https://img.shields.io/gem/v/microformats.svg?style=for-the-badge)](https://rubygems.org/gems/microformats)
6
+ [![Downloads](https://img.shields.io/gem/dt/microformats.svg?style=for-the-badge)](https://rubygems.org/gems/microformats)
7
+ [![Build](https://img.shields.io/travis/microformats/microformats-ruby/master.svg?style=for-the-badge)](https://travis-ci.org/microformats/microformats-ruby)
8
+ [![Maintainability](https://img.shields.io/codeclimate/maintainability/microformats/microformats-ruby.svg?style=for-the-badge)](https://codeclimate.com/github/microformats/microformats-ruby)
9
+ [![Coverage](https://img.shields.io/codeclimate/c/microformats/microformats-ruby.svg?style=for-the-badge)](https://codeclimate.com/github/microformats/microformats-ruby/code)
8
10
 
11
+ ## Key Features
9
12
 
10
- ## Development Status
13
+ - Compatible with both [classic microformats](http://microformats.org/wiki/Main_Page#Classic_Microformats) and [microformats2](http://microformats.org/wiki/microformats2) syntaxes.
14
+ - Provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface) for extracting microformats from a URL, file, or string.
11
15
 
12
- Implemented:
16
+ ## Getting Started
13
17
 
14
- * [parsing depth first, doc order](http://microformats.org/wiki/microformats2-parsing#parse_a_document_for_microformats)
15
- * [parsing a p- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_p-_property)
16
- * [parsing a u- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property)
17
- * [parsing a dt- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_dt-_property)
18
- * [parsing a e- property](http://microformats.org/wiki/microformats2-parsing#parsing_an_e-_property)
19
- * [parsing implied properties](http://microformats.org/wiki/microformats-2-parsing#parsing_for_implied_properties)
20
- * nested properties
21
- * nested microformat with associated property
22
- * dynamic creation of properties
23
- * [rel](http://microformats.org/wiki/rel)
24
- * [normalize u-* property values](http://microformats.org/wiki/microformats2-parsing-faq#normalizing_u-.2A_property_values)
25
- * nested microformat without associated property
26
- * [value-class-pattern](http://microformats.org/wiki/value-class-pattern)
27
- * recognition of [vendor extensions](http://microformats.org/wiki/microformats2#VENDOR_EXTENSIONS)
28
- * backward compatible support for microformats v1
29
-
30
- Not Implemented:
31
-
32
- * [include-pattern](http://microformats.org/wiki/include-pattern)
33
-
34
-
35
- ## Current Version
36
-
37
- 4.0.6
38
-
39
- ![Version 4.0.6](https://img.shields.io/badge/VERSION-4.0.6-green.svg)
40
-
41
-
42
- ## Requirements
43
-
44
- * [nokogiri](https://github.com/sparklemotion/nokogiri)
45
- * [json](https://github.com/flori/json)
18
+ Before installing and using microformats-ruby, you'll want to have Ruby 2.4.10 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
46
19
 
20
+ microformats-ruby is developed using Ruby 2.7.1 and is additionally tested against versions 2.4.10, 2.5.8, and 2.6.6 using [Travis CI](https://travis-ci.org/microformats/microformats-ruby).
47
21
 
48
22
  ## Installation
49
23
 
50
- Add this line to your application's Gemfile:
24
+ If you're using [Bundler](https://bundler.io) to manage gem dependencies, add microformats-ruby to your project's Gemfile:
51
25
 
52
26
  ```ruby
53
- gem "microformats"
27
+ source 'https://rubygems.org'
28
+
29
+ gem 'microformats', '~> 4.0', '>= 4.2.1'
54
30
  ```
55
31
 
56
- And then execute:
32
+ …and then run:
57
33
 
58
- ```
59
- bundle
34
+ ```sh
35
+ bundle install
60
36
  ```
61
37
 
62
- Or install it yourself as:
38
+ You may also install microformats-ruby directly using:
63
39
 
64
- ```
40
+ ```sh
65
41
  gem install microformats
66
42
  ```
67
43
 
68
-
69
44
  ## Usage
70
45
 
71
- ```ruby
72
- require "microformats"
46
+ An example working with a basic [h-card](http://microformats.org/wiki/h-card):
73
47
 
74
- source = "<div class='h-card'><p class='p-name'>Jessica Lynn Suttles</p></div>"
48
+ ```ruby
49
+ source = '<div class="h-card"><p class="p-name">Jessica Lynn Suttles</p></div>'
75
50
  collection = Microformats.parse(source)
76
51
 
77
- # getting a copy of the canonical microformats hash structure
52
+ # Get a copy of the canonical microformats hash structure
78
53
  collection.to_hash
79
54
 
80
- # the above, as JSON in a string
55
+ # The above as JSON in a string
81
56
  collection.to_json
82
57
 
83
- # shortcuts
84
-
85
- # return a string if there is only one item found
58
+ # Return a string if there is only one item found
86
59
  collection.card.name #=> "Jessica Lynn Suttles"
60
+ ```
61
+
62
+ Below is a more complex markup structure using an [h-entry](http://microformats.org/wiki/h-entry) with a nested h-card:
63
+
64
+ ```ruby
65
+ source = '<article class="h-entry">
66
+ <h1 class="p-name">Microformats 2</h1>
67
+ <div class="h-card p-author">
68
+ <p class="p-name"><span class="p-first-name">Jessica</span> Lynn Suttles</p>
69
+ </div>
70
+ </article>'
87
71
 
88
- source = "<article class='h-entry'>
89
- <h1 class='p-name'>Microformats 2</h1>
90
- <div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Jessica</span> Lynn Suttles</p></div>
91
- </article>"
92
72
  collection = Microformats.parse(source)
73
+
93
74
  collection.entry.name.to_s #=> "Microformats 2"
94
75
 
95
- # accessing nested microformats
76
+ # Accessing nested microformats
96
77
  collection.entry.author.name.to_s #=> "Jessica Lynn Suttles"
97
78
 
98
- # accessing nested microformats can use shortcuts or more expanded method
79
+ # Accessing nested microformats can use shortcuts or expanded method
99
80
  collection.entry.author.name #=> "Jessica Lynn Suttles"
100
81
  collection.entry.properties.author.properties.name.to_s #=> "Jessica Lynn Suttles"
101
82
 
102
- # use _ instead of - to get these items
83
+ # Use `_` instead of `-` to return property values
103
84
  collection.entry.author.first_name #=> "Jessica"
104
85
  collection.rel_urls #=> {}
86
+ ```
87
+
88
+ Using the same markup patterns as above, here's an h-entry with multiple authors, each marked up as h-cards:
89
+
90
+ ```ruby
91
+ source = '<article class="h-entry">
92
+ <h1 class="p-name">Microformats 2</h1>
93
+ <div class="h-card p-author">
94
+ <p class="p-name"><span class="p-first-name">Jessica</span> Lynn Suttles</p>
95
+ </div>
96
+ <div class="h-card p-author">
97
+ <p class="p-name"><span class="p-first-name">Brandon</span> Edens</p>
98
+ </div>
99
+ </article>'
105
100
 
106
- source = "<article class='h-entry'>
107
- <h1 class='p-name'>Microformats 2</h1>
108
- <div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Jessica</span> Lynn Suttles</p></div>
109
- <div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Brandon</span> Edens</p></div>
110
- </article>"
111
101
  collection = Microformats.parse(source)
112
102
 
113
- # arrays of items with always take the first item by default
103
+ # Arrays of items will always return the first item by default
114
104
  collection.entry.author.name #=> "Jessica Lynn Suttles"
115
105
  collection.entry.author(1).name #=> "Brandon Edens"
116
106
 
117
- # get the actual array with :all
107
+ # Get the actual array of items by using `:all`
118
108
  collection.entry.author(:all).count #=> 2
119
109
  collection.entry.author(:all)[1].name #=> "Brandon Edens"
120
-
121
- ```
122
-
123
- * `source` can be a URL, filepath, or HTML
124
-
125
- ### Console utility
126
-
127
- This gem also provides a command like script 'microformats' that will return the JSON equivalent
128
- ```
129
- microformats http://example.com
130
- ```
131
-
132
- You can give the microformats script a URL, filepath, or HTML
133
-
134
- additionally, the script will accept input piped from stdin
135
-
136
110
  ```
137
- curl http://example.com | microformats
138
- ```
139
-
140
-
141
-
142
- ## Ruby Gem release process
143
-
144
- Check out latest code from GitHub repo.
145
-
146
- ```
147
- git pull origin master
148
- ```
149
-
150
- Make sure the version has been bumped up in all four places:
151
111
 
152
- - [lib/microformats/version.rb](https://github.com/indieweb/microformats-ruby/blob/master/lib/microformats/version.rb#L2)
153
- - [README.md (three places)](https://github.com/indieweb/microformats-ruby/blob/master/README.md)
112
+ ### Command Line Interface
154
113
 
155
- Do a test build locally to make sure it builds properly.
114
+ microformats-ruby also includes a command like program that will parse HTML and return a JSON representation of the included microformats.
156
115
 
157
- ```
158
- rake build
116
+ ```sh
117
+ microformats http://tantek.com
159
118
  ```
160
119
 
161
- If that works, then do a test install locally.
120
+ The program accepts URLs, file paths, or strings of HTML as an argument. Additionally, the script accepts piped input from other programs:
162
121
 
163
- ```
164
- rake install
122
+ ```sh
123
+ curl http://tantek.com | microformats
165
124
  ```
166
125
 
167
- If that works, uninstall the gem.
126
+ ## Implementation Status
168
127
 
169
- ```
170
- gem uninstall microformats
171
- ```
128
+ | Status | Specification or Parsing Rule |
129
+ |:------:|:------------------------------|
130
+ | ✅ | [Parse a document for microformats](http://microformats.org/wiki/microformats2-parsing#parse_a_document_for_microformats) |
131
+ | ✅ | [Parsing a `p-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_p-_property) |
132
+ | ✅ | [Parsing a `u-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property) |
133
+ | ✅ | [Parsing a `dt-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_dt-_property) |
134
+ | ✅ | [Parsing an `e-` property](http://microformats.org/wiki/microformats2-parsing#parsing_an_e-_property) |
135
+ | ✅ | [Parsing for implied properties](http://microformats.org/wiki/microformats2-parsing#parsing_for_implied_properties) |
136
+ | ✅ | Nested properties |
137
+ | ✅ | Nested microformat with associated property |
138
+ | ✅ | Nested microformat without associated property |
139
+ | ✅ | Recognize dynamically created properties |
140
+ | ✅ | [Support for `rel` attribute values](http://microformats.org/wiki/rel) |
141
+ | ✅ | [Normalizing `u-*` property values](http://microformats.org/wiki/microformats2-parsing-faq#normalizing_u-.2A_property_values) |
142
+ | ✅ | Parse the [value class pattern](http://microformats.org/wiki/value-class-pattern) |
143
+ | ✅ | Recognize [vendor extensions](http://microformats.org/wiki/microformats2#VENDOR_EXTENSIONS) |
144
+ | ✅ | Support for [classic microformats](http://microformats.org/wiki/Main_Page#Classic_Microformats) |
145
+ | ❌ | Recognize the [include pattern](http://microformats.org/wiki/include-pattern)
172
146
 
173
- Clean up any mess made from testing.
147
+ ## Improving microformats-ruby
174
148
 
175
- ```
176
- rake clean
177
- rake clobber
178
- ```
179
-
180
- Assuming your one of the gem owners and have release privileges, release the gem!
181
-
182
- ```
183
- rake release
184
- ```
149
+ Have questions about using microformats-ruby? Found a bug? Have ideas for new or improved features? Want to pitch in and write some code?
185
150
 
186
- If that works, you’ve just release a new version of the gem! Yay! You can see it at:
151
+ Check out [CONTRIBUTING.md](https://github.com/microformats/microformats-ruby/blob/master/CONTRIBUTING.md) for more on how you can help!
187
152
 
188
- [https://rubygems.org/gems/microformats](https://rubygems.org/gems/microformats)
153
+ ## Acknowledgments
189
154
 
190
- If `rake release` failed because of an error with your authentication to rubygems.org, follow their instructions in the error message. Then repeat the `rake release` step.
155
+ The microformats-ruby logo is derived from the [microformats logo mark](http://microformats.org/wiki/spread-microformats) by [Rémi Prévost](http://microformats.org/wiki/User:Remi).
191
156
 
192
- If any other errors failed along the way before `rake release`, try to figure them out or reach out to the IRC/Slack channel for help.
157
+ microformats-ruby is written and maintained by:
193
158
 
194
- Good luck.
195
-
196
-
197
- ## Authors
198
-
199
- - Ben Roberts / [@dissolve](https://github.com/dissolve)
200
- - Jessica Lynn Suttles / [@jlsuttles](https://github.com/jlsuttles)
201
- - Shane Becker / [@veganstraightedge](https://github.com/veganstraightedge)
202
- - Chris Stringer / [@jcstringer](https://github.com/jcstringer)
203
- - Michael Mitchell / [@variousred](https://github.com/variousred)
204
- - Jessica Dillon / [@jessicard](https://github.com/jessicard)
205
- - Jeena Paradies / [@jeena](https://github.com/jeena)
206
- - Marty McGuire / [@martymcguire](https://github.com/martymcguire)
207
-
208
- ## Contributions
209
-
210
- 1. Fork it
211
- 2. Get it running (see Installation above)
212
- 3. Create your feature branch (`git checkout -b my-new-feature`)
213
- 4. Write your code and **specs**
214
- 5. Commit your changes (`git commit -am 'Add some feature'`)
215
- 6. Push to the branch (`git push origin my-new-feature`)
216
- 7. Create new Pull Request
217
-
218
- If you find bugs, have feature requests or questions, please
219
- [file an issue](https://github.com/indieweb/microformats-ruby/issues).
220
-
221
-
222
- ## Testing
223
-
224
- ### Specs
225
-
226
- This uses a copy of [microformats tests repo](https://github.com/microformats/tests).
227
-
228
- To run specs
229
- ```
230
- rake spec
231
-
232
- ### Interactive
233
-
234
- You can use the code interacively for testing but running
235
- ```
236
- bundle console
237
- ```
159
+ - Ben Roberts ([@dissolve](https://github.com/dissolve))
160
+ - Jason Garber [(@jgarber623](https://github.com/jgarber623))
161
+ - Jessica Suttles ([@jlsuttles](https://github.com/jlsuttles))
162
+ - Shane Becker ([@veganstraightedge](https://github.com/veganstraightedge))
163
+ - Chris Stringer ([@jcstringer](https://github.com/jcstringer))
164
+ - Michael Mitchell ([@variousred](https://github.com/variousred))
165
+ - Jessica Dillon ([@jessicard](https://github.com/jessicard))
166
+ - Jeena Paradies ([@jeena](https://github.com/jeena))
167
+ - Marty McGuire ([@martymcguire](https://github.com/martymcguire))
168
+ - Tom Morris [(@tommorris](https://github.com/tommorris))
169
+ - Don Peterson [(@dpetersen](https://github.com/dpetersen))
170
+ - Matt Bohme [(@quady](https://github.com/quady))
171
+ - Brian Miller [(@BRIMIL01](https://github.com/BRIMIL01))
172
+ - Christian Weiske [(@cweiske](https://github.com/cweiske))
173
+ - Christian Kruse [(@ckruse](https://github.com/ckruse))
174
+ - Barnaby Walters [(@barnabywalters](https://github.com/barnabywalters))
175
+ - Jeremy Keith [(@adactio](https://github.com/adactio))
238
176
 
239
177
  ## License
240
178
 
241
- Microformats (ruby) is dedicated to the public domain using Creative Commons -- CC0 1.0 Universal.
179
+ microformats-ruby is dedicated to the public domain using the [Creative Commons CC0 1.0 Universal license](https://creativecommons.org/publicdomain/zero/1.0/).
180
+
181
+ The authors waive all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, and distribute the work, even for commercial purposes, all without asking permission.
242
182
 
243
- http://creativecommons.org/publicdomain/zero/1.0
183
+ See [LICENSE](https://github.com/microformats/microformats-ruby/blob/master/LICENSE) for more details.