mida_vocabulary 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (320) hide show
  1. data/README.md +9 -0
  2. data/Rakefile +7 -0
  3. data/lib/mida_vocabulary/datatype/boolean.rb +30 -0
  4. data/lib/mida_vocabulary/datatype/enumeration.rb +28 -0
  5. data/lib/mida_vocabulary/datatype/float.rb +18 -0
  6. data/lib/mida_vocabulary/datatype/generic.rb +33 -0
  7. data/lib/mida_vocabulary/datatype/integer.rb +15 -0
  8. data/lib/mida_vocabulary/datatype/iso8601date.rb +25 -0
  9. data/lib/mida_vocabulary/datatype/number.rb +16 -0
  10. data/lib/mida_vocabulary/datatype/text.rb +15 -0
  11. data/lib/mida_vocabulary/datatype/url.rb +20 -0
  12. data/lib/mida_vocabulary/datatype.rb +17 -0
  13. data/lib/mida_vocabulary/propertydesc.rb +36 -0
  14. data/lib/mida_vocabulary/vocabularies/genericvocabulary.rb +13 -0
  15. data/lib/mida_vocabulary/vocabularies/schemaorg/aboutpage.rb +19 -0
  16. data/lib/mida_vocabulary/vocabularies/schemaorg/accountingservice.rb +21 -0
  17. data/lib/mida_vocabulary/vocabularies/schemaorg/administrativearea.rb +17 -0
  18. data/lib/mida_vocabulary/vocabularies/schemaorg/adultentertainment.rb +21 -0
  19. data/lib/mida_vocabulary/vocabularies/schemaorg/aggregateoffer.rb +34 -0
  20. data/lib/mida_vocabulary/vocabularies/schemaorg/aggregaterating.rb +33 -0
  21. data/lib/mida_vocabulary/vocabularies/schemaorg/airport.rb +19 -0
  22. data/lib/mida_vocabulary/vocabularies/schemaorg/amusementpark.rb +21 -0
  23. data/lib/mida_vocabulary/vocabularies/schemaorg/animalshelter.rb +21 -0
  24. data/lib/mida_vocabulary/vocabularies/schemaorg/apartmentcomplex.rb +17 -0
  25. data/lib/mida_vocabulary/vocabularies/schemaorg/aquarium.rb +19 -0
  26. data/lib/mida_vocabulary/vocabularies/schemaorg/artgallery.rb +21 -0
  27. data/lib/mida_vocabulary/vocabularies/schemaorg/article.rb +28 -0
  28. data/lib/mida_vocabulary/vocabularies/schemaorg/attorney.rb +21 -0
  29. data/lib/mida_vocabulary/vocabularies/schemaorg/audioobject.rb +22 -0
  30. data/lib/mida_vocabulary/vocabularies/schemaorg/autobodyshop.rb +21 -0
  31. data/lib/mida_vocabulary/vocabularies/schemaorg/autodealer.rb +21 -0
  32. data/lib/mida_vocabulary/vocabularies/schemaorg/automatedteller.rb +21 -0
  33. data/lib/mida_vocabulary/vocabularies/schemaorg/automotivebusiness.rb +21 -0
  34. data/lib/mida_vocabulary/vocabularies/schemaorg/autopartsstore.rb +21 -0
  35. data/lib/mida_vocabulary/vocabularies/schemaorg/autorental.rb +21 -0
  36. data/lib/mida_vocabulary/vocabularies/schemaorg/autorepair.rb +21 -0
  37. data/lib/mida_vocabulary/vocabularies/schemaorg/autowash.rb +21 -0
  38. data/lib/mida_vocabulary/vocabularies/schemaorg/bakery.rb +23 -0
  39. data/lib/mida_vocabulary/vocabularies/schemaorg/bankorcreditunion.rb +21 -0
  40. data/lib/mida_vocabulary/vocabularies/schemaorg/barorpub.rb +23 -0
  41. data/lib/mida_vocabulary/vocabularies/schemaorg/beach.rb +19 -0
  42. data/lib/mida_vocabulary/vocabularies/schemaorg/beautysalon.rb +21 -0
  43. data/lib/mida_vocabulary/vocabularies/schemaorg/bedandbreakfast.rb +21 -0
  44. data/lib/mida_vocabulary/vocabularies/schemaorg/bikestore.rb +21 -0
  45. data/lib/mida_vocabulary/vocabularies/schemaorg/blog.rb +24 -0
  46. data/lib/mida_vocabulary/vocabularies/schemaorg/blogposting.rb +19 -0
  47. data/lib/mida_vocabulary/vocabularies/schemaorg/bodyofwater.rb +17 -0
  48. data/lib/mida_vocabulary/vocabularies/schemaorg/book.rb +41 -0
  49. data/lib/mida_vocabulary/vocabularies/schemaorg/bookformattype.rb +16 -0
  50. data/lib/mida_vocabulary/vocabularies/schemaorg/bookstore.rb +21 -0
  51. data/lib/mida_vocabulary/vocabularies/schemaorg/bowlingalley.rb +21 -0
  52. data/lib/mida_vocabulary/vocabularies/schemaorg/brewery.rb +23 -0
  53. data/lib/mida_vocabulary/vocabularies/schemaorg/buddhisttemple.rb +19 -0
  54. data/lib/mida_vocabulary/vocabularies/schemaorg/businessevent.rb +17 -0
  55. data/lib/mida_vocabulary/vocabularies/schemaorg/busstation.rb +19 -0
  56. data/lib/mida_vocabulary/vocabularies/schemaorg/busstop.rb +19 -0
  57. data/lib/mida_vocabulary/vocabularies/schemaorg/cafeorcoffeeshop.rb +23 -0
  58. data/lib/mida_vocabulary/vocabularies/schemaorg/campground.rb +19 -0
  59. data/lib/mida_vocabulary/vocabularies/schemaorg/canal.rb +17 -0
  60. data/lib/mida_vocabulary/vocabularies/schemaorg/casino.rb +21 -0
  61. data/lib/mida_vocabulary/vocabularies/schemaorg/catholicchurch.rb +19 -0
  62. data/lib/mida_vocabulary/vocabularies/schemaorg/cemetery.rb +19 -0
  63. data/lib/mida_vocabulary/vocabularies/schemaorg/checkoutpage.rb +19 -0
  64. data/lib/mida_vocabulary/vocabularies/schemaorg/childcare.rb +21 -0
  65. data/lib/mida_vocabulary/vocabularies/schemaorg/childrensevent.rb +17 -0
  66. data/lib/mida_vocabulary/vocabularies/schemaorg/church.rb +19 -0
  67. data/lib/mida_vocabulary/vocabularies/schemaorg/city.rb +17 -0
  68. data/lib/mida_vocabulary/vocabularies/schemaorg/cityhall.rb +19 -0
  69. data/lib/mida_vocabulary/vocabularies/schemaorg/civicstructure.rb +24 -0
  70. data/lib/mida_vocabulary/vocabularies/schemaorg/clothingstore.rb +21 -0
  71. data/lib/mida_vocabulary/vocabularies/schemaorg/collectionpage.rb +19 -0
  72. data/lib/mida_vocabulary/vocabularies/schemaorg/collegeoruniversity.rb +19 -0
  73. data/lib/mida_vocabulary/vocabularies/schemaorg/comedyclub.rb +21 -0
  74. data/lib/mida_vocabulary/vocabularies/schemaorg/comedyevent.rb +17 -0
  75. data/lib/mida_vocabulary/vocabularies/schemaorg/computerstore.rb +21 -0
  76. data/lib/mida_vocabulary/vocabularies/schemaorg/contactpage.rb +19 -0
  77. data/lib/mida_vocabulary/vocabularies/schemaorg/contactpoint.rb +27 -0
  78. data/lib/mida_vocabulary/vocabularies/schemaorg/continent.rb +17 -0
  79. data/lib/mida_vocabulary/vocabularies/schemaorg/conveniencestore.rb +21 -0
  80. data/lib/mida_vocabulary/vocabularies/schemaorg/corporation.rb +20 -0
  81. data/lib/mida_vocabulary/vocabularies/schemaorg/country.rb +17 -0
  82. data/lib/mida_vocabulary/vocabularies/schemaorg/courthouse.rb +19 -0
  83. data/lib/mida_vocabulary/vocabularies/schemaorg/creativework.rb +219 -0
  84. data/lib/mida_vocabulary/vocabularies/schemaorg/crematorium.rb +19 -0
  85. data/lib/mida_vocabulary/vocabularies/schemaorg/danceevent.rb +17 -0
  86. data/lib/mida_vocabulary/vocabularies/schemaorg/dancegroup.rb +17 -0
  87. data/lib/mida_vocabulary/vocabularies/schemaorg/dayspa.rb +21 -0
  88. data/lib/mida_vocabulary/vocabularies/schemaorg/defenceestablishment.rb +19 -0
  89. data/lib/mida_vocabulary/vocabularies/schemaorg/dentist.rb +21 -0
  90. data/lib/mida_vocabulary/vocabularies/schemaorg/departmentstore.rb +21 -0
  91. data/lib/mida_vocabulary/vocabularies/schemaorg/distance.rb +15 -0
  92. data/lib/mida_vocabulary/vocabularies/schemaorg/drycleaningorlaundry.rb +21 -0
  93. data/lib/mida_vocabulary/vocabularies/schemaorg/duration.rb +13 -0
  94. data/lib/mida_vocabulary/vocabularies/schemaorg/educationalorganization.rb +24 -0
  95. data/lib/mida_vocabulary/vocabularies/schemaorg/educationevent.rb +17 -0
  96. data/lib/mida_vocabulary/vocabularies/schemaorg/electrician.rb +21 -0
  97. data/lib/mida_vocabulary/vocabularies/schemaorg/electronicsstore.rb +21 -0
  98. data/lib/mida_vocabulary/vocabularies/schemaorg/elementaryschool.rb +19 -0
  99. data/lib/mida_vocabulary/vocabularies/schemaorg/embassy.rb +19 -0
  100. data/lib/mida_vocabulary/vocabularies/schemaorg/emergencyservice.rb +21 -0
  101. data/lib/mida_vocabulary/vocabularies/schemaorg/employmentagency.rb +21 -0
  102. data/lib/mida_vocabulary/vocabularies/schemaorg/energy.rb +15 -0
  103. data/lib/mida_vocabulary/vocabularies/schemaorg/entertainmentbusiness.rb +21 -0
  104. data/lib/mida_vocabulary/vocabularies/schemaorg/enumeration.rb +15 -0
  105. data/lib/mida_vocabulary/vocabularies/schemaorg/event.rb +77 -0
  106. data/lib/mida_vocabulary/vocabularies/schemaorg/eventvenue.rb +19 -0
  107. data/lib/mida_vocabulary/vocabularies/schemaorg/exercisegym.rb +21 -0
  108. data/lib/mida_vocabulary/vocabularies/schemaorg/fastfoodrestaurant.rb +23 -0
  109. data/lib/mida_vocabulary/vocabularies/schemaorg/festival.rb +17 -0
  110. data/lib/mida_vocabulary/vocabularies/schemaorg/financialservice.rb +21 -0
  111. data/lib/mida_vocabulary/vocabularies/schemaorg/firestation.rb +23 -0
  112. data/lib/mida_vocabulary/vocabularies/schemaorg/florist.rb +21 -0
  113. data/lib/mida_vocabulary/vocabularies/schemaorg/foodestablishment.rb +36 -0
  114. data/lib/mida_vocabulary/vocabularies/schemaorg/foodevent.rb +17 -0
  115. data/lib/mida_vocabulary/vocabularies/schemaorg/furniturestore.rb +21 -0
  116. data/lib/mida_vocabulary/vocabularies/schemaorg/gardenstore.rb +21 -0
  117. data/lib/mida_vocabulary/vocabularies/schemaorg/gasstation.rb +21 -0
  118. data/lib/mida_vocabulary/vocabularies/schemaorg/gatedresidencecommunity.rb +17 -0
  119. data/lib/mida_vocabulary/vocabularies/schemaorg/generalcontractor.rb +21 -0
  120. data/lib/mida_vocabulary/vocabularies/schemaorg/geocoordinates.rb +33 -0
  121. data/lib/mida_vocabulary/vocabularies/schemaorg/geoshape.rb +33 -0
  122. data/lib/mida_vocabulary/vocabularies/schemaorg/golfcourse.rb +21 -0
  123. data/lib/mida_vocabulary/vocabularies/schemaorg/governmentbuilding.rb +19 -0
  124. data/lib/mida_vocabulary/vocabularies/schemaorg/governmentoffice.rb +21 -0
  125. data/lib/mida_vocabulary/vocabularies/schemaorg/governmentorganization.rb +17 -0
  126. data/lib/mida_vocabulary/vocabularies/schemaorg/grocerystore.rb +21 -0
  127. data/lib/mida_vocabulary/vocabularies/schemaorg/hairsalon.rb +21 -0
  128. data/lib/mida_vocabulary/vocabularies/schemaorg/hardwarestore.rb +21 -0
  129. data/lib/mida_vocabulary/vocabularies/schemaorg/healthandbeautybusiness.rb +21 -0
  130. data/lib/mida_vocabulary/vocabularies/schemaorg/healthclub.rb +21 -0
  131. data/lib/mida_vocabulary/vocabularies/schemaorg/highschool.rb +19 -0
  132. data/lib/mida_vocabulary/vocabularies/schemaorg/hindutemple.rb +19 -0
  133. data/lib/mida_vocabulary/vocabularies/schemaorg/hobbyshop.rb +21 -0
  134. data/lib/mida_vocabulary/vocabularies/schemaorg/homeandconstructionbusiness.rb +21 -0
  135. data/lib/mida_vocabulary/vocabularies/schemaorg/homegoodsstore.rb +21 -0
  136. data/lib/mida_vocabulary/vocabularies/schemaorg/hospital.rb +23 -0
  137. data/lib/mida_vocabulary/vocabularies/schemaorg/hostel.rb +21 -0
  138. data/lib/mida_vocabulary/vocabularies/schemaorg/hotel.rb +21 -0
  139. data/lib/mida_vocabulary/vocabularies/schemaorg/housepainter.rb +21 -0
  140. data/lib/mida_vocabulary/vocabularies/schemaorg/hvacbusiness.rb +21 -0
  141. data/lib/mida_vocabulary/vocabularies/schemaorg/icecreamshop.rb +23 -0
  142. data/lib/mida_vocabulary/vocabularies/schemaorg/imagegallery.rb +19 -0
  143. data/lib/mida_vocabulary/vocabularies/schemaorg/imageobject.rb +37 -0
  144. data/lib/mida_vocabulary/vocabularies/schemaorg/insuranceagency.rb +21 -0
  145. data/lib/mida_vocabulary/vocabularies/schemaorg/intangible.rb +15 -0
  146. data/lib/mida_vocabulary/vocabularies/schemaorg/internetcafe.rb +21 -0
  147. data/lib/mida_vocabulary/vocabularies/schemaorg/itemavailability.rb +19 -0
  148. data/lib/mida_vocabulary/vocabularies/schemaorg/itemlist.rb +23 -0
  149. data/lib/mida_vocabulary/vocabularies/schemaorg/itempage.rb +19 -0
  150. data/lib/mida_vocabulary/vocabularies/schemaorg/jewelrystore.rb +21 -0
  151. data/lib/mida_vocabulary/vocabularies/schemaorg/jobposting.rb +81 -0
  152. data/lib/mida_vocabulary/vocabularies/schemaorg/lakebodyofwater.rb +17 -0
  153. data/lib/mida_vocabulary/vocabularies/schemaorg/landform.rb +17 -0
  154. data/lib/mida_vocabulary/vocabularies/schemaorg/landmarksorhistoricalbuildings.rb +17 -0
  155. data/lib/mida_vocabulary/vocabularies/schemaorg/language.rb +15 -0
  156. data/lib/mida_vocabulary/vocabularies/schemaorg/legislativebuilding.rb +19 -0
  157. data/lib/mida_vocabulary/vocabularies/schemaorg/library.rb +21 -0
  158. data/lib/mida_vocabulary/vocabularies/schemaorg/liquorstore.rb +21 -0
  159. data/lib/mida_vocabulary/vocabularies/schemaorg/literaryevent.rb +17 -0
  160. data/lib/mida_vocabulary/vocabularies/schemaorg/localbusiness.rb +41 -0
  161. data/lib/mida_vocabulary/vocabularies/schemaorg/locksmith.rb +21 -0
  162. data/lib/mida_vocabulary/vocabularies/schemaorg/lodgingbusiness.rb +21 -0
  163. data/lib/mida_vocabulary/vocabularies/schemaorg/map.rb +17 -0
  164. data/lib/mida_vocabulary/vocabularies/schemaorg/mass.rb +15 -0
  165. data/lib/mida_vocabulary/vocabularies/schemaorg/mediaobject.rb +94 -0
  166. data/lib/mida_vocabulary/vocabularies/schemaorg/medicalclinic.rb +21 -0
  167. data/lib/mida_vocabulary/vocabularies/schemaorg/medicalorganization.rb +21 -0
  168. data/lib/mida_vocabulary/vocabularies/schemaorg/mensclothingstore.rb +21 -0
  169. data/lib/mida_vocabulary/vocabularies/schemaorg/middleschool.rb +19 -0
  170. data/lib/mida_vocabulary/vocabularies/schemaorg/mobilephonestore.rb +21 -0
  171. data/lib/mida_vocabulary/vocabularies/schemaorg/mosque.rb +19 -0
  172. data/lib/mida_vocabulary/vocabularies/schemaorg/motel.rb +21 -0
  173. data/lib/mida_vocabulary/vocabularies/schemaorg/motorcycledealer.rb +21 -0
  174. data/lib/mida_vocabulary/vocabularies/schemaorg/motorcyclerepair.rb +21 -0
  175. data/lib/mida_vocabulary/vocabularies/schemaorg/mountain.rb +17 -0
  176. data/lib/mida_vocabulary/vocabularies/schemaorg/movie.rb +65 -0
  177. data/lib/mida_vocabulary/vocabularies/schemaorg/movierentalstore.rb +21 -0
  178. data/lib/mida_vocabulary/vocabularies/schemaorg/movietheater.rb +23 -0
  179. data/lib/mida_vocabulary/vocabularies/schemaorg/movingcompany.rb +21 -0
  180. data/lib/mida_vocabulary/vocabularies/schemaorg/museum.rb +19 -0
  181. data/lib/mida_vocabulary/vocabularies/schemaorg/musicalbum.rb +26 -0
  182. data/lib/mida_vocabulary/vocabularies/schemaorg/musicevent.rb +17 -0
  183. data/lib/mida_vocabulary/vocabularies/schemaorg/musicgroup.rb +38 -0
  184. data/lib/mida_vocabulary/vocabularies/schemaorg/musicplaylist.rb +29 -0
  185. data/lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb +45 -0
  186. data/lib/mida_vocabulary/vocabularies/schemaorg/musicstore.rb +21 -0
  187. data/lib/mida_vocabulary/vocabularies/schemaorg/musicvenue.rb +19 -0
  188. data/lib/mida_vocabulary/vocabularies/schemaorg/musicvideoobject.rb +19 -0
  189. data/lib/mida_vocabulary/vocabularies/schemaorg/nailsalon.rb +21 -0
  190. data/lib/mida_vocabulary/vocabularies/schemaorg/newsarticle.rb +34 -0
  191. data/lib/mida_vocabulary/vocabularies/schemaorg/ngo.rb +17 -0
  192. data/lib/mida_vocabulary/vocabularies/schemaorg/nightclub.rb +21 -0
  193. data/lib/mida_vocabulary/vocabularies/schemaorg/notary.rb +21 -0
  194. data/lib/mida_vocabulary/vocabularies/schemaorg/nutritioninformation.rb +86 -0
  195. data/lib/mida_vocabulary/vocabularies/schemaorg/oceanbodyofwater.rb +17 -0
  196. data/lib/mida_vocabulary/vocabularies/schemaorg/offer.rb +69 -0
  197. data/lib/mida_vocabulary/vocabularies/schemaorg/offeritemcondition.rb +17 -0
  198. data/lib/mida_vocabulary/vocabularies/schemaorg/officeequipmentstore.rb +21 -0
  199. data/lib/mida_vocabulary/vocabularies/schemaorg/optician.rb +21 -0
  200. data/lib/mida_vocabulary/vocabularies/schemaorg/organization.rb +96 -0
  201. data/lib/mida_vocabulary/vocabularies/schemaorg/outletstore.rb +21 -0
  202. data/lib/mida_vocabulary/vocabularies/schemaorg/painting.rb +17 -0
  203. data/lib/mida_vocabulary/vocabularies/schemaorg/park.rb +19 -0
  204. data/lib/mida_vocabulary/vocabularies/schemaorg/parkingfacility.rb +19 -0
  205. data/lib/mida_vocabulary/vocabularies/schemaorg/pawnshop.rb +21 -0
  206. data/lib/mida_vocabulary/vocabularies/schemaorg/performingartstheater.rb +19 -0
  207. data/lib/mida_vocabulary/vocabularies/schemaorg/performinggroup.rb +17 -0
  208. data/lib/mida_vocabulary/vocabularies/schemaorg/person.rb +179 -0
  209. data/lib/mida_vocabulary/vocabularies/schemaorg/petstore.rb +21 -0
  210. data/lib/mida_vocabulary/vocabularies/schemaorg/pharmacy.rb +21 -0
  211. data/lib/mida_vocabulary/vocabularies/schemaorg/photograph.rb +17 -0
  212. data/lib/mida_vocabulary/vocabularies/schemaorg/physician.rb +21 -0
  213. data/lib/mida_vocabulary/vocabularies/schemaorg/place.rb +82 -0
  214. data/lib/mida_vocabulary/vocabularies/schemaorg/placeofworship.rb +19 -0
  215. data/lib/mida_vocabulary/vocabularies/schemaorg/playground.rb +19 -0
  216. data/lib/mida_vocabulary/vocabularies/schemaorg/plumber.rb +21 -0
  217. data/lib/mida_vocabulary/vocabularies/schemaorg/policestation.rb +23 -0
  218. data/lib/mida_vocabulary/vocabularies/schemaorg/pond.rb +17 -0
  219. data/lib/mida_vocabulary/vocabularies/schemaorg/postaladdress.rb +39 -0
  220. data/lib/mida_vocabulary/vocabularies/schemaorg/postoffice.rb +21 -0
  221. data/lib/mida_vocabulary/vocabularies/schemaorg/preschool.rb +19 -0
  222. data/lib/mida_vocabulary/vocabularies/schemaorg/product.rb +55 -0
  223. data/lib/mida_vocabulary/vocabularies/schemaorg/professionalservice.rb +21 -0
  224. data/lib/mida_vocabulary/vocabularies/schemaorg/profilepage.rb +19 -0
  225. data/lib/mida_vocabulary/vocabularies/schemaorg/publicswimmingpool.rb +21 -0
  226. data/lib/mida_vocabulary/vocabularies/schemaorg/quantity.rb +15 -0
  227. data/lib/mida_vocabulary/vocabularies/schemaorg/radiostation.rb +21 -0
  228. data/lib/mida_vocabulary/vocabularies/schemaorg/rating.rb +30 -0
  229. data/lib/mida_vocabulary/vocabularies/schemaorg/realestateagent.rb +21 -0
  230. data/lib/mida_vocabulary/vocabularies/schemaorg/recipe.rb +61 -0
  231. data/lib/mida_vocabulary/vocabularies/schemaorg/recyclingcenter.rb +21 -0
  232. data/lib/mida_vocabulary/vocabularies/schemaorg/reservoir.rb +17 -0
  233. data/lib/mida_vocabulary/vocabularies/schemaorg/residence.rb +17 -0
  234. data/lib/mida_vocabulary/vocabularies/schemaorg/restaurant.rb +23 -0
  235. data/lib/mida_vocabulary/vocabularies/schemaorg/review.rb +33 -0
  236. data/lib/mida_vocabulary/vocabularies/schemaorg/riverbodyofwater.rb +17 -0
  237. data/lib/mida_vocabulary/vocabularies/schemaorg/roofingcontractor.rb +21 -0
  238. data/lib/mida_vocabulary/vocabularies/schemaorg/rvpark.rb +19 -0
  239. data/lib/mida_vocabulary/vocabularies/schemaorg/saleevent.rb +17 -0
  240. data/lib/mida_vocabulary/vocabularies/schemaorg/scholarlyarticle.rb +19 -0
  241. data/lib/mida_vocabulary/vocabularies/schemaorg/school.rb +19 -0
  242. data/lib/mida_vocabulary/vocabularies/schemaorg/sculpture.rb +17 -0
  243. data/lib/mida_vocabulary/vocabularies/schemaorg/seabodyofwater.rb +17 -0
  244. data/lib/mida_vocabulary/vocabularies/schemaorg/searchresultspage.rb +19 -0
  245. data/lib/mida_vocabulary/vocabularies/schemaorg/selfstorage.rb +21 -0
  246. data/lib/mida_vocabulary/vocabularies/schemaorg/shoestore.rb +21 -0
  247. data/lib/mida_vocabulary/vocabularies/schemaorg/shoppingcenter.rb +21 -0
  248. data/lib/mida_vocabulary/vocabularies/schemaorg/singlefamilyresidence.rb +17 -0
  249. data/lib/mida_vocabulary/vocabularies/schemaorg/sitenavigationelement.rb +17 -0
  250. data/lib/mida_vocabulary/vocabularies/schemaorg/skiresort.rb +21 -0
  251. data/lib/mida_vocabulary/vocabularies/schemaorg/socialevent.rb +17 -0
  252. data/lib/mida_vocabulary/vocabularies/schemaorg/sportinggoodsstore.rb +21 -0
  253. data/lib/mida_vocabulary/vocabularies/schemaorg/sportsactivitylocation.rb +21 -0
  254. data/lib/mida_vocabulary/vocabularies/schemaorg/sportsclub.rb +21 -0
  255. data/lib/mida_vocabulary/vocabularies/schemaorg/sportsevent.rb +17 -0
  256. data/lib/mida_vocabulary/vocabularies/schemaorg/sportsteam.rb +17 -0
  257. data/lib/mida_vocabulary/vocabularies/schemaorg/stadiumorarena.rb +23 -0
  258. data/lib/mida_vocabulary/vocabularies/schemaorg/state.rb +17 -0
  259. data/lib/mida_vocabulary/vocabularies/schemaorg/store.rb +21 -0
  260. data/lib/mida_vocabulary/vocabularies/schemaorg/structuredvalue.rb +15 -0
  261. data/lib/mida_vocabulary/vocabularies/schemaorg/subwaystation.rb +19 -0
  262. data/lib/mida_vocabulary/vocabularies/schemaorg/synagogue.rb +19 -0
  263. data/lib/mida_vocabulary/vocabularies/schemaorg/table.rb +17 -0
  264. data/lib/mida_vocabulary/vocabularies/schemaorg/tattooparlor.rb +21 -0
  265. data/lib/mida_vocabulary/vocabularies/schemaorg/taxistand.rb +19 -0
  266. data/lib/mida_vocabulary/vocabularies/schemaorg/televisionstation.rb +21 -0
  267. data/lib/mida_vocabulary/vocabularies/schemaorg/tenniscomplex.rb +21 -0
  268. data/lib/mida_vocabulary/vocabularies/schemaorg/theaterevent.rb +17 -0
  269. data/lib/mida_vocabulary/vocabularies/schemaorg/theatergroup.rb +17 -0
  270. data/lib/mida_vocabulary/vocabularies/schemaorg/thing.rb +29 -0
  271. data/lib/mida_vocabulary/vocabularies/schemaorg/tireshop.rb +21 -0
  272. data/lib/mida_vocabulary/vocabularies/schemaorg/touristattraction.rb +17 -0
  273. data/lib/mida_vocabulary/vocabularies/schemaorg/touristinformationcenter.rb +21 -0
  274. data/lib/mida_vocabulary/vocabularies/schemaorg/toystore.rb +21 -0
  275. data/lib/mida_vocabulary/vocabularies/schemaorg/trainstation.rb +19 -0
  276. data/lib/mida_vocabulary/vocabularies/schemaorg/travelagency.rb +21 -0
  277. data/lib/mida_vocabulary/vocabularies/schemaorg/tvepisode.rb +77 -0
  278. data/lib/mida_vocabulary/vocabularies/schemaorg/tvseason.rb +58 -0
  279. data/lib/mida_vocabulary/vocabularies/schemaorg/tvseries.rb +87 -0
  280. data/lib/mida_vocabulary/vocabularies/schemaorg/userblocks.rb +17 -0
  281. data/lib/mida_vocabulary/vocabularies/schemaorg/usercheckins.rb +17 -0
  282. data/lib/mida_vocabulary/vocabularies/schemaorg/usercomments.rb +46 -0
  283. data/lib/mida_vocabulary/vocabularies/schemaorg/userdownloads.rb +17 -0
  284. data/lib/mida_vocabulary/vocabularies/schemaorg/userinteraction.rb +17 -0
  285. data/lib/mida_vocabulary/vocabularies/schemaorg/userlikes.rb +17 -0
  286. data/lib/mida_vocabulary/vocabularies/schemaorg/userpagevisits.rb +17 -0
  287. data/lib/mida_vocabulary/vocabularies/schemaorg/userplays.rb +17 -0
  288. data/lib/mida_vocabulary/vocabularies/schemaorg/userplusones.rb +17 -0
  289. data/lib/mida_vocabulary/vocabularies/schemaorg/usertweets.rb +17 -0
  290. data/lib/mida_vocabulary/vocabularies/schemaorg/veterinarycare.rb +21 -0
  291. data/lib/mida_vocabulary/vocabularies/schemaorg/videogallery.rb +19 -0
  292. data/lib/mida_vocabulary/vocabularies/schemaorg/videoobject.rb +45 -0
  293. data/lib/mida_vocabulary/vocabularies/schemaorg/visualartsevent.rb +17 -0
  294. data/lib/mida_vocabulary/vocabularies/schemaorg/volcano.rb +17 -0
  295. data/lib/mida_vocabulary/vocabularies/schemaorg/waterfall.rb +17 -0
  296. data/lib/mida_vocabulary/vocabularies/schemaorg/webpage.rb +46 -0
  297. data/lib/mida_vocabulary/vocabularies/schemaorg/webpageelement.rb +17 -0
  298. data/lib/mida_vocabulary/vocabularies/schemaorg/wholesalestore.rb +21 -0
  299. data/lib/mida_vocabulary/vocabularies/schemaorg/winery.rb +23 -0
  300. data/lib/mida_vocabulary/vocabularies/schemaorg/wpadblock.rb +17 -0
  301. data/lib/mida_vocabulary/vocabularies/schemaorg/wpfooter.rb +17 -0
  302. data/lib/mida_vocabulary/vocabularies/schemaorg/wpheader.rb +17 -0
  303. data/lib/mida_vocabulary/vocabularies/schemaorg/wpsidebar.rb +17 -0
  304. data/lib/mida_vocabulary/vocabularies/schemaorg/zoo.rb +19 -0
  305. data/lib/mida_vocabulary/vocabularies/schemaorg.rb +1 -0
  306. data/lib/mida_vocabulary/vocabulary.rb +109 -0
  307. data/lib/mida_vocabulary.rb +10 -0
  308. data/spec/datatype/boolean_spec.rb +40 -0
  309. data/spec/datatype/enumeration_spec.rb +30 -0
  310. data/spec/datatype/float_spec.rb +21 -0
  311. data/spec/datatype/generic_spec.rb +44 -0
  312. data/spec/datatype/integer_spec.rb +26 -0
  313. data/spec/datatype/iso8601date_spec.rb +27 -0
  314. data/spec/datatype/number_spec.rb +21 -0
  315. data/spec/datatype/text_spec.rb +16 -0
  316. data/spec/datatype/url_spec.rb +27 -0
  317. data/spec/propertydesc_spec.rb +56 -0
  318. data/spec/spec_helper.rb +18 -0
  319. data/spec/vocabulary_spec.rb +271 -0
  320. metadata +397 -0
@@ -0,0 +1,17 @@
1
+ require 'mida_vocabulary/vocabulary'
2
+
3
+ module Mida
4
+ module SchemaOrg
5
+
6
+ autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'
7
+ autoload :CreativeWork, 'mida_vocabulary/vocabularies/schemaorg/creativework'
8
+
9
+ # A sidebar section of the page.
10
+ class WPSideBar < Mida::Vocabulary
11
+ itemtype %r{http://schema.org/WPSideBar}i
12
+ include_vocabulary Mida::SchemaOrg::Thing
13
+ include_vocabulary Mida::SchemaOrg::CreativeWork
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ require 'mida_vocabulary/vocabulary'
2
+
3
+ module Mida
4
+ module SchemaOrg
5
+
6
+ autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'
7
+ autoload :Place, 'mida_vocabulary/vocabularies/schemaorg/place'
8
+ autoload :CivicStructure, 'mida_vocabulary/vocabularies/schemaorg/civicstructure'
9
+
10
+ # A zoo.
11
+ class Zoo < Mida::Vocabulary
12
+ itemtype %r{http://schema.org/Zoo}i
13
+ include_vocabulary Mida::SchemaOrg::Thing
14
+ include_vocabulary Mida::SchemaOrg::Place
15
+ include_vocabulary Mida::SchemaOrg::CivicStructure
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1 @@
1
+ Dir.glob(File.dirname(__FILE__) + '/schemaorg/*.rb') {|file| require file}
@@ -0,0 +1,109 @@
1
+ require 'set'
2
+ module Mida
3
+
4
+ # Class used to describe a vocabulary
5
+ #
6
+ # To specify a vocabulary use the following methods:
7
+ # +itemtype+, +has_one+, +has_many+
8
+ class Vocabulary
9
+
10
+ class << self
11
+ # Return the registered vocabularies
12
+ attr_reader :vocabularies
13
+ end
14
+
15
+ @vocabularies = Set.new
16
+
17
+ # Register a vocabulary that can be used when parsing,
18
+ # later vocabularies are given precedence over earlier ones
19
+ def self.register(vocabulary)
20
+ @vocabularies << vocabulary
21
+ end
22
+
23
+ # Un-register a vocabulary
24
+ def self.unregister(vocabulary)
25
+ @vocabularies.delete(vocabulary)
26
+ end
27
+
28
+ # Find the last vocabulary registered that matches the itemtype
29
+ def self.find(itemtype)
30
+ @vocabularies.sort_by {|v| v.itemtype ? v.itemtype.source.size : 0 }.reverse.each do |vocabulary|
31
+ if ((itemtype || "") =~ vocabulary.itemtype)
32
+ return vocabulary
33
+ end
34
+ end
35
+ nil
36
+ end
37
+
38
+ def self.inherited(subclass)
39
+ register(subclass)
40
+ end
41
+
42
+ # Return the properties specification
43
+ # This won't work properly until all the included_vocabularies
44
+ # have finished being defined in case of circular dependancies
45
+ def self.properties
46
+ return @properties if @properties
47
+ @properties = @this_properties || {}
48
+ included_vocabularies.each do |vocabulary|
49
+ @properties.merge!(vocabulary.properties)
50
+ end
51
+ @properties
52
+ end
53
+
54
+ # Return the included vocabularies
55
+ def self.included_vocabularies
56
+ @included_vocabularies ||= Set.new
57
+ end
58
+
59
+ # Specify which +vocabularies+ will have their properties included.
60
+ # This is the correct way to inherit properties from another vocabulary,
61
+ # rather than subclassing.
62
+ def self.include_vocabulary(*vocabularies)
63
+ vocabularies.each do |vocabulary|
64
+ included_vocabularies.merge(vocabulary.included_vocabularies)
65
+ included_vocabularies << vocabulary
66
+ end
67
+ end
68
+
69
+ # As per the standard <tt>kind_of?</tt>, but also checks to see if vocabulary has
70
+ # been included by self
71
+ def self.kind_of?(vocabulary)
72
+ return true if self == vocabulary
73
+ return true if self.ancestors.include?(vocabulary)
74
+ included_vocabularies.include?(vocabulary)
75
+ end
76
+
77
+ # Sets the regular expression to match against the +itemtype+
78
+ # or returns the current regular expression
79
+ def self.itemtype(regexp=nil)
80
+ return @itemtype unless regexp
81
+ @itemtype = regexp
82
+ end
83
+
84
+ # Defines the properties as only containing one value
85
+ # If want to say any property name, then use +:any+ as a name
86
+ # Within a block you can use the methods of the class +PropertyDesc+
87
+ def self.has_one(*property_names, &block)
88
+ has(:one, *property_names, &block)
89
+ end
90
+
91
+ # Defines the properties as containing many values
92
+ # If want to say any property name, then use +:any+ as a name
93
+ # Within a block you can use the methods of the class +PropertyDesc+
94
+ def self.has_many(*property_names, &block)
95
+ has(:many, *property_names, &block)
96
+ end
97
+
98
+ def self.has(num, *property_names, &block)
99
+ @this_properties ||= {}
100
+ property_names.each_with_object(@this_properties) do |name, properties|
101
+ property_desc = PropertyDesc.new(num, &block)
102
+ properties[name] = property_desc.to_h
103
+ end
104
+ end
105
+
106
+ private_class_method :has
107
+
108
+ end
109
+ end
@@ -0,0 +1,10 @@
1
+ $LOAD_PATH.unshift File.dirname(__FILE__)
2
+ Dir[File.dirname(__FILE__) + '/mida_vocabulary/*.rb'].each { |f| require f }
3
+
4
+ # Mida is a Microdata parser and extractor.
5
+ module Mida
6
+
7
+ end
8
+
9
+ require 'mida_vocabulary/vocabularies/genericvocabulary'
10
+ require 'mida_vocabulary/vocabularies/schemaorg'
@@ -0,0 +1,40 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Boolean do
4
+
5
+ it '#parse should raise an exception if a invalid text passed' do
6
+ test = lambda {Mida::DataType::Boolean.parse('example')}
7
+ test.should raise_error(ArgumentError)
8
+ end
9
+
10
+ it '#parse should raise an exception if value is empty' do
11
+ test = lambda {Mida::DataType::Boolean.parse('')}
12
+ test.should raise_error(ArgumentError)
13
+ end
14
+
15
+ it '#parse should return true for "True" whatever the case' do
16
+ ['true', 'True', 'TRUE', 'tRUE'].each do |true_text|
17
+ Mida::DataType::Boolean.parse(true_text).should be_true
18
+ end
19
+ end
20
+
21
+ it '#parse should return false for "False" whatever the case' do
22
+ ['false', 'False', 'FALSE', 'fALSE'].each do |false_text|
23
+ Mida::DataType::Boolean.parse(false_text).should be_false
24
+ end
25
+ end
26
+
27
+ it '#to_s should return proper string representation of boolean' do
28
+ Mida::DataType::Boolean.parse('fALSE').to_s.should == 'False'
29
+ Mida::DataType::Boolean.parse('tRUE').to_s.should == 'True'
30
+ end
31
+
32
+ it '! should negate as if a TrueClass/FalseClass' do
33
+ true_boolean = Mida::DataType::Boolean.parse('true')
34
+ false_boolean = Mida::DataType::Boolean.parse('false')
35
+
36
+ (!true_boolean).should be_false
37
+ (!false_boolean).should be_true
38
+ end
39
+
40
+ end
@@ -0,0 +1,30 @@
1
+ require 'mida_vocabulary/datatype'
2
+ require 'mida_vocabulary/datatype/url'
3
+
4
+ describe Mida::DataType::Enumeration do
5
+ before :all do
6
+ class BookType < Mida::DataType::Enumeration
7
+ VALID_VALUES = [
8
+ [::Mida::DataType::URL, %r{http://example.com/ebook}i],
9
+ [::Mida::DataType::URL, %r{http://example.com/paperback}i]
10
+ ]
11
+ end
12
+ end
13
+
14
+ it '#parse should raise an exception if an invalid url passed' do
15
+ test = lambda {BookType.parse('http://example.com/hardback')}
16
+ test.should raise_error(ArgumentError)
17
+ end
18
+
19
+ it '#parse should raise an exception if value is empty' do
20
+ test = lambda {BookType.parse('')}
21
+ test.should raise_error(ArgumentError)
22
+ end
23
+
24
+ it '#parse should accept a valid value' do
25
+ url_text = 'http://example.com/ebook'
26
+ url = BookType.parse(url_text)
27
+ url.to_s.should == url_text
28
+ end
29
+
30
+ end
@@ -0,0 +1,21 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Float do
4
+
5
+ it '#parse should raise an exception if not a number' do
6
+ test = lambda {Mida::DataType::Float.parse('hello')}
7
+ test.should raise_error(ArgumentError)
8
+ end
9
+
10
+ it '#parse should raise an exception if value is empty' do
11
+ test = lambda {Mida::DataType::Float.parse('')}
12
+ test.should raise_error(ArgumentError)
13
+ end
14
+
15
+ it '#parse should accept a valid number' do
16
+ float_text = '3.14'
17
+ float = Mida::DataType::Float.parse(float_text)
18
+ float.to_s.should == float_text
19
+ end
20
+
21
+ end
@@ -0,0 +1,44 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Generic do
4
+
5
+ before do
6
+ class Number < Mida::DataType::Generic
7
+ def initialize(value)
8
+ @parsedValue = Float(value)
9
+ end
10
+ end
11
+ end
12
+
13
+ it '#parse should provide pass value straight to #new' do
14
+ number = Number.parse('2.34')
15
+ number == 2.34
16
+ end
17
+
18
+ it "should provide access to the underlying type's methods" do
19
+ number = Number.new('2.34')
20
+ number.floor.should == 2
21
+ end
22
+
23
+ it '#to_s should use the underlying types #to_s method' do
24
+ number = Number.parse('2.34')
25
+ number.to_s.should == '2.34'
26
+ end
27
+
28
+ it '#to_yaml should provide a yaml representation of the items #to_s method' do
29
+ number = Number.parse('2.34')
30
+ number.to_yaml.should =~ /---\s+['"]2.34['"]\n/
31
+ end
32
+
33
+ it '#== should match against underlying type, string representation and self' do
34
+ number = Number.new('2.34')
35
+ (number == 2.34).should be_true
36
+ (number == '2.34').should be_true
37
+ (number == number).should be_true
38
+
39
+ (number == 2.44).should be_false
40
+ (number == '2.44').should be_false
41
+ (number == Number.new('2.44')).should be_false
42
+ end
43
+
44
+ end
@@ -0,0 +1,26 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Integer do
4
+
5
+ it '#parse should raise an exception if not a number' do
6
+ test = lambda {Mida::DataType::Integer.parse('hello')}
7
+ test.should raise_error(ArgumentError)
8
+ end
9
+
10
+ it '#parse should raise an exception if not an integer' do
11
+ test = lambda {Mida::DataType::Integer.parse('3.14')}
12
+ test.should raise_error(ArgumentError)
13
+ end
14
+
15
+ it '#parse should raise an exception if value is empty' do
16
+ test = lambda {Mida::DataType::Integer.parse('')}
17
+ test.should raise_error(ArgumentError)
18
+ end
19
+
20
+ it '#parse should accept a valid number' do
21
+ integer_text = '3'
22
+ integer = Mida::DataType::Integer.parse(integer_text)
23
+ integer.to_s.should == integer_text
24
+ end
25
+
26
+ end
@@ -0,0 +1,27 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::ISO8601Date do
4
+
5
+ it '#parse should raise an exception if invalid date format' do
6
+ test = lambda {Mida::DataType::ISO8601Date.parse('27th August 2009')}
7
+ test.should raise_error(ArgumentError)
8
+ end
9
+
10
+ it '#parse should raise an exception if value is empty' do
11
+ test = lambda {Mida::DataType::ISO8601Date.parse('')}
12
+ test.should raise_error(ArgumentError)
13
+ end
14
+
15
+ context 'when passed a valid date' do
16
+ before do
17
+ @date_text = "2009-08-27T01:13:04+05:10"
18
+ @date = Mida::DataType::ISO8601Date.parse(@date_text)
19
+ end
20
+
21
+ it '#to_s should return the date as an rfc822 text string' do
22
+ @date.to_s.should == "Thu, 27 Aug 2009 01:13:04 +0510"
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,21 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Number do
4
+
5
+ it '#parse should raise an exception if not a number' do
6
+ test = lambda {Mida::DataType::Number.parse('hello')}
7
+ test.should raise_error(ArgumentError)
8
+ end
9
+
10
+ it '#parse should raise an exception if value is empty' do
11
+ test = lambda {Mida::DataType::Number.parse('')}
12
+ test.should raise_error(ArgumentError)
13
+ end
14
+
15
+ it '#parse should accept a valid number' do
16
+ num_text = '3.14'
17
+ num = Mida::DataType::Number.parse(num_text)
18
+ num.to_s.should == num_text
19
+ end
20
+
21
+ end
@@ -0,0 +1,16 @@
1
+ require 'mida_vocabulary/datatype'
2
+
3
+ describe Mida::DataType::Text do
4
+
5
+ it '#parse should accept an empty string' do
6
+ text = Mida::DataType::Text.parse('')
7
+ text.should == ''
8
+ end
9
+
10
+ it '#parse should return the input value' do
11
+ test_text = 'Some text'
12
+ text = Mida::DataType::Text.parse(test_text)
13
+ text.should == test_text
14
+ end
15
+
16
+ end
@@ -0,0 +1,27 @@
1
+ require 'mida_vocabulary/datatype'
2
+ require 'yaml'
3
+
4
+ describe Mida::DataType::URL do
5
+
6
+ it '#parse should raise an exception if a bad url passed' do
7
+ test = lambda {Mida::DataType::URL.parse('example.com')}
8
+ test.should raise_error(ArgumentError)
9
+ end
10
+
11
+ it '#parse should raise an exception if value is empty' do
12
+ test = lambda {Mida::DataType::URL.parse('')}
13
+ test.should raise_error(ArgumentError)
14
+ end
15
+
16
+ it '#parse should accept a valid url' do
17
+ url_text = 'http://example.com/test/'
18
+ url = Mida::DataType::URL.parse(url_text)
19
+ url.to_s.should == url_text
20
+ end
21
+
22
+
23
+ it '#parse should accept a valid url' do
24
+ url_text = 'http://example.com/test/'
25
+ url = Mida::DataType::URL.parse(url_text)
26
+ end
27
+ end
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+ require 'mida_vocabulary/propertydesc'
3
+
4
+ describe Mida::PropertyDesc, 'when initialized without a block' do
5
+ before do
6
+ @propertyDesc = Mida::PropertyDesc.new(3)
7
+ end
8
+
9
+ it '#to_h[:num] should equal num passed' do
10
+ @propertyDesc.to_h[:num].should == 3
11
+ end
12
+
13
+ it '#to_h[:types] should equal DataType::Text' do
14
+ @propertyDesc.to_h[:types].should == [Mida::DataType::Text]
15
+ end
16
+ end
17
+
18
+ describe Mida::PropertyDesc, 'when initialized with a block with no specified types' do
19
+ before do
20
+ @propertyDesc = Mida::PropertyDesc.new(3) {}
21
+ end
22
+
23
+ it '#to_h[:types] should equal DataType::Text' do
24
+ @propertyDesc.to_h[:types].should == [Mida::DataType::Text]
25
+ end
26
+ end
27
+
28
+ describe Mida::PropertyDesc, 'when initialized with a block that specifies types with extract()' do
29
+ before do
30
+ @propertyDesc = Mida::PropertyDesc.new(3) { extract String, Array}
31
+ end
32
+
33
+ it '#to_h[:types] should equal [String, Array]' do
34
+ @propertyDesc.to_h[:types].should == [String, Array]
35
+ end
36
+ end
37
+
38
+ describe Mida::PropertyDesc, 'when initialized with a block that specifies types with types()' do
39
+ before do
40
+ @propertyDesc = nil
41
+ @error = last_stderr do
42
+ @propertyDesc = Mida::PropertyDesc.new(3) { types String, Array}
43
+ end
44
+ end
45
+
46
+ it 'should warn on initialization if types() is used in the block' do
47
+ @error.should eq("[DEPRECATION] Mida::PropertyDesc#types is deprecated. "+
48
+ "Please use Mida::PropertyDesc#extract instead."
49
+ )
50
+ end
51
+
52
+ it '#to_h[:types] should equal [String, Array]' do
53
+ @propertyDesc.to_h[:types].should == [String, Array]
54
+ end
55
+
56
+ end
@@ -0,0 +1,18 @@
1
+ require 'bundler/setup'
2
+ require 'rspec'
3
+
4
+ def html_wrap(html)
5
+ "<!DOCTYPE html><html><body>#{html}</body></html>"
6
+ end
7
+
8
+ # Return the last error message on STDERR.
9
+ # Prevents the message being output to STDERR.
10
+ def last_stderr
11
+ orig_stderr = $stderr
12
+ $stderr = StringIO.new
13
+ yield
14
+ $stderr.rewind
15
+ message = $stderr.string.chomp
16
+ $stderr = orig_stderr
17
+ message
18
+ end