stic 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (640) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +661 -0
  3. data/README.md +64 -0
  4. data/bin/stic +8 -0
  5. data/doc/file.README.html +125 -0
  6. data/lib/stic.rb +44 -0
  7. data/lib/stic/blob.rb +106 -0
  8. data/lib/stic/cli.rb +61 -0
  9. data/lib/stic/cli/command.rb +78 -0
  10. data/lib/stic/config.rb +26 -0
  11. data/lib/stic/errors.rb +27 -0
  12. data/lib/stic/file.rb +31 -0
  13. data/lib/stic/generator.rb +92 -0
  14. data/lib/stic/generators/page.rb +28 -0
  15. data/lib/stic/generators/static.rb +45 -0
  16. data/lib/stic/layout.rb +57 -0
  17. data/lib/stic/layoutable.rb +28 -0
  18. data/lib/stic/metadata.rb +35 -0
  19. data/lib/stic/metadata/block_comment_yaml.rb +34 -0
  20. data/lib/stic/metadata/comment_yaml.rb +43 -0
  21. data/lib/stic/metadata/html_yaml.rb +27 -0
  22. data/lib/stic/metadata/parser.rb +21 -0
  23. data/lib/stic/metadata/yaml.rb +52 -0
  24. data/lib/stic/page.rb +34 -0
  25. data/lib/stic/readable.rb +103 -0
  26. data/lib/stic/renderable.rb +40 -0
  27. data/lib/stic/renderer.rb +31 -0
  28. data/lib/stic/site.rb +174 -0
  29. data/lib/stic/site_base.rb +38 -0
  30. data/lib/stic/utils.rb +20 -0
  31. data/lib/stic/version.rb +13 -0
  32. data/spec/fixtures/tmp/d20140110-23550-1kyaeb6/path/to/file.html +1 -0
  33. data/spec/fixtures/tmp/d20140110-23550-1w8hpqt/path/to/file.html +1 -0
  34. data/spec/fixtures/tmp/d20140110-23664-1uw0y4u/path/to/file.html +1 -0
  35. data/spec/fixtures/tmp/d20140110-23664-endjsg/path/to/file.html +1 -0
  36. data/spec/fixtures/tmp/d20140111-10655-vpioyr/path/to/file.html +1 -0
  37. data/spec/fixtures/tmp/d20140111-10655-zrxr1o/path/to/file.html +1 -0
  38. data/spec/fixtures/tmp/d20140111-29171-1ku21ij/path/to/file.html +1 -0
  39. data/spec/fixtures/tmp/d20140111-29171-yhpuds/path/to/file.html +1 -0
  40. data/spec/fixtures/tmp/d20140111-32285-2ige9n/path/to/file.html +1 -0
  41. data/spec/fixtures/tmp/d20140111-32285-ibazly/path/to/file.html +1 -0
  42. data/spec/fixtures/tmp/d20140111-32504-11yva37/path/to/file.html +1 -0
  43. data/spec/fixtures/tmp/d20140111-32504-fx1s4i/path/to/file.html +1 -0
  44. data/spec/fixtures/tmp/d20140111-3954-1nr53ss/path/to/file.html +1 -0
  45. data/spec/fixtures/tmp/d20140111-3954-gv6jl4/path/to/file.html +1 -0
  46. data/spec/fixtures/tmp/d20140111-4044-16lwnsm/path/to/file.html +1 -0
  47. data/spec/fixtures/tmp/d20140111-4044-1eazx0q/path/to/file.html +1 -0
  48. data/spec/fixtures/tmp/d20140111-4239-h5al5v/path/to/file.html +1 -0
  49. data/spec/fixtures/tmp/d20140111-4239-j6yxnx/path/to/file.html +1 -0
  50. data/spec/fixtures/tmp/d20140111-4373-1xvpe0y/path/to/file.html +1 -0
  51. data/spec/fixtures/tmp/d20140111-4373-1xxeoy1/path/to/file.html +1 -0
  52. data/spec/fixtures/tmp/d20140111-4468-16bj623/path/to/file.html +1 -0
  53. data/spec/fixtures/tmp/d20140111-4468-qm7h3l/path/to/file.html +1 -0
  54. data/spec/fixtures/tmp/d20140111-4636-1sjabw8/path/to/file.html +1 -0
  55. data/spec/fixtures/tmp/d20140111-4636-up7anp/path/to/file.html +1 -0
  56. data/spec/fixtures/tmp/d20140111-5186-1iihkdu/path/to/file.html +1 -0
  57. data/spec/fixtures/tmp/d20140111-5186-1wf6jbt/path/to/file.html +1 -0
  58. data/spec/fixtures/tmp/d20140111-5800-18b7lps/path/to/file.html +1 -0
  59. data/spec/fixtures/tmp/d20140111-5800-ebzwxw/path/to/file.html +1 -0
  60. data/spec/fixtures/tmp/d20140112-32318-1472be3/path/to/file.html +1 -0
  61. data/spec/fixtures/tmp/d20140112-32318-181gn34/path/to/file.html +1 -0
  62. data/spec/fixtures/tmp/d20140119-5346-1yt41ar/path/to/file.html +1 -0
  63. data/spec/fixtures/tmp/d20140119-5346-1z0cqw6/path/to/file.html +1 -0
  64. data/spec/fixtures/tmp/d20140119-5408-njzjyv/path/to/file.html +1 -0
  65. data/spec/fixtures/tmp/d20140119-5408-p6kdd5/path/to/file.html +1 -0
  66. data/spec/fixtures/tmp/d20140216-10009-1038whb/path/to/file.html +1 -0
  67. data/spec/fixtures/tmp/d20140216-10009-10yvxyv/path/to/file.html +1 -0
  68. data/spec/fixtures/tmp/d20140216-10794-17cduzr/path/to/file.html +1 -0
  69. data/spec/fixtures/tmp/d20140216-10794-6wkotj/path/to/file.html +1 -0
  70. data/spec/fixtures/tmp/d20140216-10889-1fx4qkh/path/to/file.html +1 -0
  71. data/spec/fixtures/tmp/d20140216-10889-1ky8jvy/path/to/file.html +1 -0
  72. data/spec/fixtures/tmp/d20140216-11416-1yf95z7/path/to/file.html +1 -0
  73. data/spec/fixtures/tmp/d20140216-11416-4eksm7/path/to/file.html +1 -0
  74. data/spec/fixtures/tmp/d20140216-11509-1mbuy8v/path/to/file.html +1 -0
  75. data/spec/fixtures/tmp/d20140216-11509-rjaj67/path/to/file.html +1 -0
  76. data/spec/fixtures/tmp/d20140216-13566-11p3uzb/path/to/file.html +1 -0
  77. data/spec/fixtures/tmp/d20140216-13566-t9qw1c/path/to/file.html +1 -0
  78. data/spec/fixtures/tmp/d20140216-13661-1hcxi0/path/to/file.html +1 -0
  79. data/spec/fixtures/tmp/d20140216-13661-1mann7u/path/to/file.html +1 -0
  80. data/spec/fixtures/tmp/d20140216-16873-100liri/path/to/file.html +1 -0
  81. data/spec/fixtures/tmp/d20140216-16873-f06hwa/path/to/file.html +1 -0
  82. data/spec/fixtures/tmp/d20140216-18628-11m064z/path/to/file.html +1 -0
  83. data/spec/fixtures/tmp/d20140216-18628-1ocywdl/path/to/file.html +1 -0
  84. data/spec/fixtures/tmp/d20140216-18981-1q9aznw/path/to/file.html +1 -0
  85. data/spec/fixtures/tmp/d20140216-18981-1sgc0b5/path/to/file.html +1 -0
  86. data/spec/fixtures/tmp/d20140216-19077-vo0g4z/path/to/file.html +1 -0
  87. data/spec/fixtures/tmp/d20140216-19077-zvo6x2/path/to/file.html +1 -0
  88. data/spec/fixtures/tmp/d20140216-19337-145akuv/path/to/file.html +1 -0
  89. data/spec/fixtures/tmp/d20140216-19337-1upwiwi/path/to/file.html +1 -0
  90. data/spec/fixtures/tmp/d20140216-19615-1dcezqo/path/to/file.html +1 -0
  91. data/spec/fixtures/tmp/d20140216-19615-1f830vj/path/to/file.html +1 -0
  92. data/spec/fixtures/tmp/d20140216-19881-ft4sa5/path/to/file.html +1 -0
  93. data/spec/fixtures/tmp/d20140216-19881-len34z/path/to/file.html +1 -0
  94. data/spec/fixtures/tmp/d20140216-19978-14xgqvo/path/to/file.html +1 -0
  95. data/spec/fixtures/tmp/d20140216-19978-46mrha/path/to/file.html +1 -0
  96. data/spec/fixtures/tmp/d20140216-2232-1wgyisq/path/to/file.html +1 -0
  97. data/spec/fixtures/tmp/d20140216-2232-r7144k/path/to/file.html +1 -0
  98. data/spec/fixtures/tmp/d20140216-2602-16jasco/path/to/file.html +1 -0
  99. data/spec/fixtures/tmp/d20140216-2602-1iz2x17/path/to/file.html +1 -0
  100. data/spec/fixtures/tmp/d20140216-26476-15lj85g/path/to/file.html +1 -0
  101. data/spec/fixtures/tmp/d20140216-26476-fei8e4/path/to/file.html +1 -0
  102. data/spec/fixtures/tmp/d20140216-26518-cnu14f/path/to/file.html +1 -0
  103. data/spec/fixtures/tmp/d20140216-26518-ejelr/path/to/file.html +1 -0
  104. data/spec/fixtures/tmp/d20140216-3064-v44tf7/path/to/file.html +1 -0
  105. data/spec/fixtures/tmp/d20140216-3064-z0ru9c/path/to/file.html +1 -0
  106. data/spec/fixtures/tmp/d20140216-3252-1pls05u/path/to/file.html +1 -0
  107. data/spec/fixtures/tmp/d20140216-3252-au3hgy/path/to/file.html +1 -0
  108. data/spec/fixtures/tmp/d20140216-4389-1jy7cid/path/to/file.html +1 -0
  109. data/spec/fixtures/tmp/d20140216-4389-1pg9lja/path/to/file.html +1 -0
  110. data/spec/fixtures/tmp/d20140405-11431-1kndkj3/path/to/file.html +1 -0
  111. data/spec/fixtures/tmp/d20140405-11431-iyqfbc/path/to/file.html +1 -0
  112. data/spec/fixtures/tmp/d20140405-28343-1hifjtu/path/to/file.html +1 -0
  113. data/spec/fixtures/tmp/d20140405-28343-qh0lab/path/to/file.html +1 -0
  114. data/spec/fixtures/tmp/d20140406-17342-27wh8z/path/to/file.html +1 -0
  115. data/spec/fixtures/tmp/d20140406-17342-s44xv/path/to/file.html +1 -0
  116. data/spec/fixtures/tmp/d20140406-17581-1m5g7p/path/to/file.html +1 -0
  117. data/spec/fixtures/tmp/d20140406-17581-q0l3c2/path/to/file.html +1 -0
  118. data/spec/fixtures/tmp/d20140406-17847-1wn00n2/path/to/file.html +1 -0
  119. data/spec/fixtures/tmp/d20140406-17847-2tuk02/path/to/file.html +1 -0
  120. data/spec/fixtures/tmp/d20140406-19288-1ew8sww/path/to/file.html +1 -0
  121. data/spec/fixtures/tmp/d20140406-19288-mli42k/path/to/file.html +1 -0
  122. data/spec/fixtures/tmp/d20140406-19568-1clew2k/path/to/file.html +1 -0
  123. data/spec/fixtures/tmp/d20140406-19568-unr1w6/path/to/file.html +1 -0
  124. data/spec/fixtures/tmp/d20140406-20028-h5024p/path/to/file.html +1 -0
  125. data/spec/fixtures/tmp/d20140406-20028-kgfyf0/path/to/file.html +1 -0
  126. data/spec/fixtures/tmp/d20140406-20190-1ng8zj7/path/to/file.html +1 -0
  127. data/spec/fixtures/tmp/d20140406-20190-ppf6z7/path/to/file.html +1 -0
  128. data/spec/fixtures/tmp/d20140406-20642-mjl8y3/path/to/file.html +1 -0
  129. data/spec/fixtures/tmp/d20140406-20642-yy2dwp/path/to/file.html +1 -0
  130. data/spec/fixtures/tmp/d20140406-20712-dtmal9/path/to/file.html +1 -0
  131. data/spec/fixtures/tmp/d20140406-20712-hehsou/path/to/file.html +1 -0
  132. data/spec/fixtures/tmp/d20140406-21545-1i4mgbb/path/to/file.html +1 -0
  133. data/spec/fixtures/tmp/d20140406-21545-xdho2t/path/to/file.html +1 -0
  134. data/spec/fixtures/tmp/d20140406-22365-80de4o/path/to/file.html +1 -0
  135. data/spec/fixtures/tmp/d20140406-22365-pqhw71/path/to/file.html +1 -0
  136. data/spec/fixtures/tmp/d20140406-22818-5nylr9/path/to/file.html +1 -0
  137. data/spec/fixtures/tmp/d20140406-22818-i6ed6w/path/to/file.html +1 -0
  138. data/spec/fixtures/tmp/d20140406-23108-1omwvhd/path/to/file.html +1 -0
  139. data/spec/fixtures/tmp/d20140406-23108-jyqcsz/path/to/file.html +1 -0
  140. data/spec/fixtures/tmp/d20140406-9833-ngg9su/path/to/file.html +1 -0
  141. data/spec/fixtures/tmp/d20140406-9833-ocmr2/path/to/file.html +1 -0
  142. data/spec/fixtures/tmp/d20140416-10459-1hn7uim/path/to/file.html +1 -0
  143. data/spec/fixtures/tmp/d20140416-10459-kj03wy/path/to/file.html +1 -0
  144. data/spec/fixtures/tmp/d20140416-18934-jolrcl/path/to/file.html +1 -0
  145. data/spec/fixtures/tmp/d20140416-18934-qfmiwe/path/to/file.html +1 -0
  146. data/spec/fixtures/tmp/d20140416-20406-blv65d/path/to/file.html +1 -0
  147. data/spec/fixtures/tmp/d20140416-20406-wsnye/path/to/file.html +1 -0
  148. data/spec/fixtures/tmp/d20140416-21792-k8vhpc/path/to/file.html +1 -0
  149. data/spec/fixtures/tmp/d20140416-21792-kpl75v/path/to/file.html +1 -0
  150. data/spec/fixtures/tmp/d20140416-22590-16oxjr4/path/to/file.html +1 -0
  151. data/spec/fixtures/tmp/d20140416-22590-xh3orf/path/to/file.html +1 -0
  152. data/spec/fixtures/tmp/d20140416-23080-1fbvcuz/path/to/file.html +1 -0
  153. data/spec/fixtures/tmp/d20140416-23080-ka9fbp/path/to/file.html +1 -0
  154. data/spec/fixtures/tmp/d20140416-26418-1lxsznr/path/to/file.html +1 -0
  155. data/spec/fixtures/tmp/d20140416-26418-1myk0mz/path/to/file.html +1 -0
  156. data/spec/fixtures/tmp/d20140416-27757-1qztyfu/path/to/file.html +1 -0
  157. data/spec/fixtures/tmp/d20140416-27757-giwyy4/path/to/file.html +1 -0
  158. data/spec/fixtures/tmp/d20140416-2781-199tuql/path/to/file.html +1 -0
  159. data/spec/fixtures/tmp/d20140416-2781-8iaf5f/path/to/file.html +1 -0
  160. data/spec/fixtures/tmp/d20140416-3750-1cf7e7v/path/to/file.html +1 -0
  161. data/spec/fixtures/tmp/d20140416-3750-36p2u9/path/to/file.html +1 -0
  162. data/spec/fixtures/tmp/d20140417-1538-1gik3xs/path/to/file.html +1 -0
  163. data/spec/fixtures/tmp/d20140417-1538-gldu0d/path/to/file.html +1 -0
  164. data/spec/fixtures/tmp/d20140419-14783-kwiilg/path/to/file.html +1 -0
  165. data/spec/fixtures/tmp/d20140419-14783-xmrp4/path/to/file.html +1 -0
  166. data/spec/fixtures/tmp/d20140419-14888-1bsatku/path/to/file.html +1 -0
  167. data/spec/fixtures/tmp/d20140419-14888-7o5a3w/path/to/file.html +1 -0
  168. data/spec/fixtures/tmp/d20140419-15660-16dz6eb/path/to/file.html +1 -0
  169. data/spec/fixtures/tmp/d20140419-15660-994wr5/path/to/file.html +1 -0
  170. data/spec/fixtures/tmp/d20140419-16301-1ftyfe8/path/to/file.html +1 -0
  171. data/spec/fixtures/tmp/d20140419-16301-jkoph3/path/to/file.html +1 -0
  172. data/spec/fixtures/tmp/d20140419-16714-1cjlbc4/path/to/file.html +1 -0
  173. data/spec/fixtures/tmp/d20140419-16714-1py707t/path/to/file.html +1 -0
  174. data/spec/fixtures/tmp/d20140419-17306-3svg56/path/to/file.html +1 -0
  175. data/spec/fixtures/tmp/d20140419-17306-z1sbfz/path/to/file.html +1 -0
  176. data/spec/fixtures/tmp/d20140419-17895-2hbaxd/path/to/file.html +1 -0
  177. data/spec/fixtures/tmp/d20140419-17895-toubtm/path/to/file.html +1 -0
  178. data/spec/fixtures/tmp/d20140419-18491-10hbjta/path/to/file.html +1 -0
  179. data/spec/fixtures/tmp/d20140419-18491-26mr8t/path/to/file.html +1 -0
  180. data/spec/fixtures/tmp/d20140419-19431-1b28or3/path/to/file.html +1 -0
  181. data/spec/fixtures/tmp/d20140419-19431-1jjl94m/path/to/file.html +1 -0
  182. data/spec/fixtures/tmp/d20140419-19672-1gsxmzi/path/to/file.html +1 -0
  183. data/spec/fixtures/tmp/d20140419-19672-1w8baky/path/to/file.html +1 -0
  184. data/spec/fixtures/tmp/d20140419-20197-1njbksl/path/to/file.html +1 -0
  185. data/spec/fixtures/tmp/d20140419-20197-xbyc64/path/to/file.html +1 -0
  186. data/spec/fixtures/tmp/d20140419-22414-10z5y02/path/to/file.html +1 -0
  187. data/spec/fixtures/tmp/d20140419-22414-mvsryb/path/to/file.html +1 -0
  188. data/spec/fixtures/tmp/d20140419-23323-133up7d/path/to/file.html +1 -0
  189. data/spec/fixtures/tmp/d20140419-23323-kjk6kc/path/to/file.html +1 -0
  190. data/spec/fixtures/tmp/d20140419-24512-13dq3qd/path/to/file.html +1 -0
  191. data/spec/fixtures/tmp/d20140419-24512-xq871/path/to/file.html +1 -0
  192. data/spec/fixtures/tmp/d20140419-25398-1rk0n38/path/to/file.html +1 -0
  193. data/spec/fixtures/tmp/d20140419-25398-mmygqs/path/to/file.html +1 -0
  194. data/spec/fixtures/tmp/d20140419-25620-827h2p/path/to/file.html +1 -0
  195. data/spec/fixtures/tmp/d20140419-25620-eo5hly/path/to/file.html +1 -0
  196. data/spec/fixtures/tmp/d20140419-26571-17yj6pu/path/to/file.html +1 -0
  197. data/spec/fixtures/tmp/d20140419-26571-kdk9db/path/to/file.html +1 -0
  198. data/spec/fixtures/tmp/d20140419-27372-1bboxzr/path/to/file.html +1 -0
  199. data/spec/fixtures/tmp/d20140419-27372-1fyctuo/path/to/file.html +1 -0
  200. data/spec/fixtures/tmp/d20140419-28646-12e6wmc/path/to/file.html +1 -0
  201. data/spec/fixtures/tmp/d20140419-28646-yi98vl/path/to/file.html +1 -0
  202. data/spec/fixtures/tmp/d20140419-29059-1jzk1m0/path/to/file.html +1 -0
  203. data/spec/fixtures/tmp/d20140419-29059-1wbcuye/path/to/file.html +1 -0
  204. data/spec/fixtures/tmp/d20140420-12901-rfax50/path/to/file.html +1 -0
  205. data/spec/fixtures/tmp/d20140420-12901-wkc41c/path/to/file.html +1 -0
  206. data/spec/fixtures/tmp/d20140420-16092-dx5ohe/path/to/file.html +1 -0
  207. data/spec/fixtures/tmp/d20140420-16092-k0rdj0/path/to/file.html +1 -0
  208. data/spec/fixtures/tmp/d20140420-17354-1uzh3cx/path/to/file.html +1 -0
  209. data/spec/fixtures/tmp/d20140420-17354-a7h3z1/path/to/file.html +1 -0
  210. data/spec/fixtures/tmp/d20140420-17571-11vf5zy/path/to/file.html +1 -0
  211. data/spec/fixtures/tmp/d20140420-17571-mva36w/path/to/file.html +1 -0
  212. data/spec/fixtures/tmp/d20140420-17982-1cqgr9/path/to/file.html +1 -0
  213. data/spec/fixtures/tmp/d20140420-17982-p6f4os/path/to/file.html +1 -0
  214. data/spec/fixtures/tmp/d20140420-18702-1cjze4r/path/to/file.html +1 -0
  215. data/spec/fixtures/tmp/d20140420-18702-wosras/path/to/file.html +1 -0
  216. data/spec/fixtures/tmp/d20140420-18775-kvt4yd/path/to/file.html +1 -0
  217. data/spec/fixtures/tmp/d20140420-18775-ltxkyn/path/to/file.html +1 -0
  218. data/spec/fixtures/tmp/d20140420-19110-1qbir2v/path/to/file.html +1 -0
  219. data/spec/fixtures/tmp/d20140420-19110-wxmnas/path/to/file.html +1 -0
  220. data/spec/fixtures/tmp/d20140420-19300-13my6cz/path/to/file.html +1 -0
  221. data/spec/fixtures/tmp/d20140420-19300-1kyxkd1/path/to/file.html +1 -0
  222. data/spec/fixtures/tmp/d20140420-20198-1g3arb5/path/to/file.html +1 -0
  223. data/spec/fixtures/tmp/d20140420-20198-pplp9q/path/to/file.html +1 -0
  224. data/spec/fixtures/tmp/d20140420-20605-1ob04z7/path/to/file.html +1 -0
  225. data/spec/fixtures/tmp/d20140420-20605-ysybs4/path/to/file.html +1 -0
  226. data/spec/fixtures/tmp/d20140420-20710-1avs9de/path/to/file.html +1 -0
  227. data/spec/fixtures/tmp/d20140420-20710-3zr93j/path/to/file.html +1 -0
  228. data/spec/fixtures/tmp/d20140420-21125-19uh678/path/to/file.html +1 -0
  229. data/spec/fixtures/tmp/d20140420-21125-5xxj2j/path/to/file.html +1 -0
  230. data/spec/fixtures/tmp/d20140420-22619-1ddxua3/path/to/file.html +1 -0
  231. data/spec/fixtures/tmp/d20140420-22619-m68moo/path/to/file.html +1 -0
  232. data/spec/fixtures/tmp/d20140420-23365-15zax0i/path/to/file.html +1 -0
  233. data/spec/fixtures/tmp/d20140420-23365-1salevl/path/to/file.html +1 -0
  234. data/spec/fixtures/tmp/d20140420-23557-c0ax6s/path/to/file.html +1 -0
  235. data/spec/fixtures/tmp/d20140420-23557-lktrkr/path/to/file.html +1 -0
  236. data/spec/fixtures/tmp/d20140420-23790-mrjyll/path/to/file.html +1 -0
  237. data/spec/fixtures/tmp/d20140420-23790-urztsa/path/to/file.html +1 -0
  238. data/spec/fixtures/tmp/d20140420-24601-198q4tx/path/to/file.html +1 -0
  239. data/spec/fixtures/tmp/d20140420-24601-1sfyhe3/path/to/file.html +1 -0
  240. data/spec/fixtures/tmp/d20140420-25007-14h4bp6/path/to/file.html +1 -0
  241. data/spec/fixtures/tmp/d20140420-25007-463ok6/path/to/file.html +1 -0
  242. data/spec/fixtures/tmp/d20140420-26024-6tha2s/path/to/file.html +1 -0
  243. data/spec/fixtures/tmp/d20140420-26024-j0s4qk/path/to/file.html +1 -0
  244. data/spec/fixtures/tmp/d20140420-27235-1dzmaed/path/to/file.html +1 -0
  245. data/spec/fixtures/tmp/d20140420-27235-1en6s0s/path/to/file.html +1 -0
  246. data/spec/fixtures/tmp/d20140420-27468-dcwghz/path/to/file.html +1 -0
  247. data/spec/fixtures/tmp/d20140420-27468-vohkbn/path/to/file.html +1 -0
  248. data/spec/fixtures/tmp/d20140420-28307-168a5pc/path/to/file.html +1 -0
  249. data/spec/fixtures/tmp/d20140420-28307-694jz1/path/to/file.html +1 -0
  250. data/spec/fixtures/tmp/d20140420-30943-1aqr6vm/path/to/file.html +1 -0
  251. data/spec/fixtures/tmp/d20140420-30943-1m4uuei/path/to/file.html +1 -0
  252. data/spec/fixtures/tmp/d20140420-6205-1rqax3h/path/to/file.html +1 -0
  253. data/spec/fixtures/tmp/d20140420-6205-oawc2q/path/to/file.html +1 -0
  254. data/spec/fixtures/tmp/d20140420-6920-1s3qmoe/path/to/file.html +1 -0
  255. data/spec/fixtures/tmp/d20140420-6920-m69ghp/path/to/file.html +1 -0
  256. data/spec/fixtures/tmp/d20140420-7725-161no3b/path/to/file.html +1 -0
  257. data/spec/fixtures/tmp/d20140420-7725-lrlgau/path/to/file.html +1 -0
  258. data/spec/fixtures/tmp/d20140420-8745-bg7064/path/to/file.html +1 -0
  259. data/spec/fixtures/tmp/d20140420-8745-js2sjp/path/to/file.html +1 -0
  260. data/spec/fixtures/tmp/d20140421-10771-1if5wwo/path/to/file.html +1 -0
  261. data/spec/fixtures/tmp/d20140421-10771-1j9qv2h/path/to/file.html +1 -0
  262. data/spec/fixtures/tmp/d20140421-11976-12lb772/path/to/file.html +1 -0
  263. data/spec/fixtures/tmp/d20140421-11976-1mchb9m/path/to/file.html +1 -0
  264. data/spec/fixtures/tmp/d20140421-12574-1irin8n/path/to/file.html +1 -0
  265. data/spec/fixtures/tmp/d20140421-12574-fqt1g9/path/to/file.html +1 -0
  266. data/spec/fixtures/tmp/d20140421-1418-fxzuhh/path/to/file.html +1 -0
  267. data/spec/fixtures/tmp/d20140421-1418-nalhr9/path/to/file.html +1 -0
  268. data/spec/fixtures/tmp/d20140421-1712-14ckof6/path/to/file.html +1 -0
  269. data/spec/fixtures/tmp/d20140421-1712-qmunxn/path/to/file.html +1 -0
  270. data/spec/fixtures/tmp/d20140421-18290-1xhj34x/path/to/file.html +1 -0
  271. data/spec/fixtures/tmp/d20140421-18290-t3gck7/path/to/file.html +1 -0
  272. data/spec/fixtures/tmp/d20140421-18715-1k1xpdf/path/to/file.html +1 -0
  273. data/spec/fixtures/tmp/d20140421-18715-a14s6e/path/to/file.html +1 -0
  274. data/spec/fixtures/tmp/d20140421-20593-194cjpv/path/to/file.html +1 -0
  275. data/spec/fixtures/tmp/d20140421-20593-cniazz/path/to/file.html +1 -0
  276. data/spec/fixtures/tmp/d20140421-2123-1mwlcu3/path/to/file.html +1 -0
  277. data/spec/fixtures/tmp/d20140421-2123-doahmc/path/to/file.html +1 -0
  278. data/spec/fixtures/tmp/d20140421-22491-1jt3eg/path/to/file.html +1 -0
  279. data/spec/fixtures/tmp/d20140421-22491-1yot94z/path/to/file.html +1 -0
  280. data/spec/fixtures/tmp/d20140421-22906-qppmug/path/to/file.html +1 -0
  281. data/spec/fixtures/tmp/d20140421-22906-qumjfs/path/to/file.html +1 -0
  282. data/spec/fixtures/tmp/d20140421-25099-1d60016/path/to/file.html +1 -0
  283. data/spec/fixtures/tmp/d20140421-25099-bfvo10/path/to/file.html +1 -0
  284. data/spec/fixtures/tmp/d20140421-25597-bv1rzw/path/to/file.html +1 -0
  285. data/spec/fixtures/tmp/d20140421-25597-ifc1zt/path/to/file.html +1 -0
  286. data/spec/fixtures/tmp/d20140421-25932-5n0ecu/path/to/file.html +1 -0
  287. data/spec/fixtures/tmp/d20140421-25932-fpcyti/path/to/file.html +1 -0
  288. data/spec/fixtures/tmp/d20140421-26529-64gq7u/path/to/file.html +1 -0
  289. data/spec/fixtures/tmp/d20140421-26529-q9rmpe/path/to/file.html +1 -0
  290. data/spec/fixtures/tmp/d20140421-26958-1ezcowc/path/to/file.html +1 -0
  291. data/spec/fixtures/tmp/d20140421-26958-1y0ewa7/path/to/file.html +1 -0
  292. data/spec/fixtures/tmp/d20140421-27243-1wdfkpj/path/to/file.html +1 -0
  293. data/spec/fixtures/tmp/d20140421-27243-d9dcfi/path/to/file.html +1 -0
  294. data/spec/fixtures/tmp/d20140421-27673-1y0zd4h/path/to/file.html +1 -0
  295. data/spec/fixtures/tmp/d20140421-27673-52snmn/path/to/file.html +1 -0
  296. data/spec/fixtures/tmp/d20140421-28084-9dd587/path/to/file.html +1 -0
  297. data/spec/fixtures/tmp/d20140421-28084-t05tqz/path/to/file.html +1 -0
  298. data/spec/fixtures/tmp/d20140421-29878-6cd4oz/path/to/file.html +1 -0
  299. data/spec/fixtures/tmp/d20140421-29878-ydhsb4/path/to/file.html +1 -0
  300. data/spec/fixtures/tmp/d20140421-30792-1bd4a61/path/to/file.html +1 -0
  301. data/spec/fixtures/tmp/d20140421-30792-1e2s3fm/path/to/file.html +1 -0
  302. data/spec/fixtures/tmp/d20140421-31209-138ehsm/path/to/file.html +1 -0
  303. data/spec/fixtures/tmp/d20140421-31209-5ezih8/path/to/file.html +1 -0
  304. data/spec/fixtures/tmp/d20140421-32114-1194x89/path/to/file.html +1 -0
  305. data/spec/fixtures/tmp/d20140421-32114-11jrrha/path/to/file.html +1 -0
  306. data/spec/fixtures/tmp/d20140421-4034-3rnhtx/path/to/file.html +1 -0
  307. data/spec/fixtures/tmp/d20140421-4034-jvbe4b/path/to/file.html +1 -0
  308. data/spec/fixtures/tmp/d20140421-5294-1e4spkp/path/to/file.html +1 -0
  309. data/spec/fixtures/tmp/d20140421-5294-1kmi81i/path/to/file.html +1 -0
  310. data/spec/fixtures/tmp/d20140421-6095-1g01ef/path/to/file.html +1 -0
  311. data/spec/fixtures/tmp/d20140421-6095-2hqjvz/path/to/file.html +1 -0
  312. data/spec/fixtures/tmp/d20140421-6533-5c9oia/path/to/file.html +1 -0
  313. data/spec/fixtures/tmp/d20140421-6533-wrbzdu/path/to/file.html +1 -0
  314. data/spec/fixtures/tmp/d20140421-7523-15vjw6r/path/to/file.html +1 -0
  315. data/spec/fixtures/tmp/d20140421-7523-r20bpa/path/to/file.html +1 -0
  316. data/spec/fixtures/tmp/d20140421-7745-158z534/path/to/file.html +1 -0
  317. data/spec/fixtures/tmp/d20140421-7745-ibrh03/path/to/file.html +1 -0
  318. data/spec/fixtures/tmp/d20140421-8292-1apyywv/path/to/file.html +1 -0
  319. data/spec/fixtures/tmp/d20140421-8292-1juuqt6/path/to/file.html +1 -0
  320. data/spec/fixtures/tmp/d20140421-9015-1izaiwf/path/to/file.html +1 -0
  321. data/spec/fixtures/tmp/d20140421-9015-605dfk/path/to/file.html +1 -0
  322. data/spec/fixtures/tmp/d20140421-9788-11sbh02/path/to/file.html +1 -0
  323. data/spec/fixtures/tmp/d20140421-9788-sd2rh3/path/to/file.html +1 -0
  324. data/spec/fixtures/tmp/d20140421-982-10vevme/path/to/file.html +1 -0
  325. data/spec/fixtures/tmp/d20140421-982-6ohdkl/path/to/file.html +1 -0
  326. data/spec/fixtures/tmp/d20140424-19179-1a9c3bc/path/to/file.html +1 -0
  327. data/spec/fixtures/tmp/d20140424-19179-ej0v61/path/to/file.html +1 -0
  328. data/spec/fixtures/tmp/d20140424-20271-1cdtjbm/path/to/file.html +1 -0
  329. data/spec/fixtures/tmp/d20140424-20271-zq4a7g/path/to/file.html +1 -0
  330. data/spec/fixtures/tmp/d20140424-22461-11ecodd/path/to/file.html +1 -0
  331. data/spec/fixtures/tmp/d20140424-22461-x392at/path/to/file.html +1 -0
  332. data/spec/fixtures/tmp/d20140424-22656-h3cfrj/path/to/file.html +1 -0
  333. data/spec/fixtures/tmp/d20140424-22656-i0e1rs/path/to/file.html +1 -0
  334. data/spec/fixtures/tmp/d20140424-23516-5y0sjx/path/to/file.html +1 -0
  335. data/spec/fixtures/tmp/d20140424-23516-5y7djj/path/to/file.html +1 -0
  336. data/spec/fixtures/tmp/d20140424-32315-167bc8d/path/to/file.html +1 -0
  337. data/spec/fixtures/tmp/d20140424-32315-1uszvsy/path/to/file.html +1 -0
  338. data/spec/fixtures/tmp/d20140424-32552-q084eo/path/to/file.html +1 -0
  339. data/spec/fixtures/tmp/d20140424-32552-rhh7of/path/to/file.html +1 -0
  340. data/spec/fixtures/tmp/d20140424-360-gsddwz/path/to/file.html +1 -0
  341. data/spec/fixtures/tmp/d20140424-360-uq5z27/path/to/file.html +1 -0
  342. data/spec/fixtures/tmp/d20140427-10046-br6h3b/path/to/file.html +1 -0
  343. data/spec/fixtures/tmp/d20140427-10046-ziimll/path/to/file.html +1 -0
  344. data/spec/fixtures/tmp/d20140427-10381-1eh1yaj/path/to/file.html +1 -0
  345. data/spec/fixtures/tmp/d20140427-10381-1o9lwfq/path/to/file.html +1 -0
  346. data/spec/fixtures/tmp/d20140427-10709-1hcqh7k/path/to/file.html +1 -0
  347. data/spec/fixtures/tmp/d20140427-10709-asipm/path/to/file.html +1 -0
  348. data/spec/fixtures/tmp/d20140427-10917-17n9on4/path/to/file.html +1 -0
  349. data/spec/fixtures/tmp/d20140427-10917-1m22mve/path/to/file.html +1 -0
  350. data/spec/fixtures/tmp/d20140427-11062-16130fo/path/to/file.html +1 -0
  351. data/spec/fixtures/tmp/d20140427-11062-bgz6qw/path/to/file.html +1 -0
  352. data/spec/fixtures/tmp/d20140427-1147-1xxelw3/path/to/file.html +1 -0
  353. data/spec/fixtures/tmp/d20140427-1147-s6r7w8/path/to/file.html +1 -0
  354. data/spec/fixtures/tmp/d20140427-12407-8zp0qc/path/to/file.html +1 -0
  355. data/spec/fixtures/tmp/d20140427-12407-rfv86t/path/to/file.html +1 -0
  356. data/spec/fixtures/tmp/d20140427-12931-fe3f00/path/to/file.html +1 -0
  357. data/spec/fixtures/tmp/d20140427-12931-muztqy/path/to/file.html +1 -0
  358. data/spec/fixtures/tmp/d20140427-13574-e883hw/path/to/file.html +1 -0
  359. data/spec/fixtures/tmp/d20140427-13574-xbhj5q/path/to/file.html +1 -0
  360. data/spec/fixtures/tmp/d20140427-13990-1edsch2/path/to/file.html +1 -0
  361. data/spec/fixtures/tmp/d20140427-13990-1risnpk/path/to/file.html +1 -0
  362. data/spec/fixtures/tmp/d20140427-14590-16s3phc/path/to/file.html +1 -0
  363. data/spec/fixtures/tmp/d20140427-14590-9agt0e/path/to/file.html +1 -0
  364. data/spec/fixtures/tmp/d20140427-15021-16xw48a/path/to/file.html +1 -0
  365. data/spec/fixtures/tmp/d20140427-15021-qnqqzi/path/to/file.html +1 -0
  366. data/spec/fixtures/tmp/d20140427-1665-1paampf/path/to/file.html +1 -0
  367. data/spec/fixtures/tmp/d20140427-1665-1vht5tm/path/to/file.html +1 -0
  368. data/spec/fixtures/tmp/d20140427-16927-1nkqw1h/path/to/file.html +1 -0
  369. data/spec/fixtures/tmp/d20140427-16927-tvevo8/path/to/file.html +1 -0
  370. data/spec/fixtures/tmp/d20140427-17330-ed97vt/path/to/file.html +1 -0
  371. data/spec/fixtures/tmp/d20140427-17330-osu8kc/path/to/file.html +1 -0
  372. data/spec/fixtures/tmp/d20140427-17517-14v1ew/path/to/file.html +1 -0
  373. data/spec/fixtures/tmp/d20140427-17517-xldh36/path/to/file.html +1 -0
  374. data/spec/fixtures/tmp/d20140427-17907-16g44lk/path/to/file.html +1 -0
  375. data/spec/fixtures/tmp/d20140427-17907-m9d8j6/path/to/file.html +1 -0
  376. data/spec/fixtures/tmp/d20140427-18271-12qdv9/path/to/file.html +1 -0
  377. data/spec/fixtures/tmp/d20140427-18271-1rrdda9/path/to/file.html +1 -0
  378. data/spec/fixtures/tmp/d20140427-1865-1ny6vb/path/to/file.html +1 -0
  379. data/spec/fixtures/tmp/d20140427-1865-85cmn4/path/to/file.html +1 -0
  380. data/spec/fixtures/tmp/d20140427-18761-1y6zu8o/path/to/file.html +1 -0
  381. data/spec/fixtures/tmp/d20140427-18761-htyo3y/path/to/file.html +1 -0
  382. data/spec/fixtures/tmp/d20140427-18900-1x32ijc/path/to/file.html +1 -0
  383. data/spec/fixtures/tmp/d20140427-18900-hmpg03/path/to/file.html +1 -0
  384. data/spec/fixtures/tmp/d20140427-19343-hurh7c/path/to/file.html +1 -0
  385. data/spec/fixtures/tmp/d20140427-19343-sh29o5/path/to/file.html +1 -0
  386. data/spec/fixtures/tmp/d20140427-1989-k3uqfp/path/to/file.html +1 -0
  387. data/spec/fixtures/tmp/d20140427-1989-rbnn1w/path/to/file.html +1 -0
  388. data/spec/fixtures/tmp/d20140427-19981-1a22raq/path/to/file.html +1 -0
  389. data/spec/fixtures/tmp/d20140427-19981-5lkjrb/path/to/file.html +1 -0
  390. data/spec/fixtures/tmp/d20140427-20076-1o7op1o/path/to/file.html +1 -0
  391. data/spec/fixtures/tmp/d20140427-20076-mk6cn6/path/to/file.html +1 -0
  392. data/spec/fixtures/tmp/d20140427-20320-7a2dj8/path/to/file.html +1 -0
  393. data/spec/fixtures/tmp/d20140427-20320-rt012j/path/to/file.html +1 -0
  394. data/spec/fixtures/tmp/d20140427-21872-1mtt431/path/to/file.html +1 -0
  395. data/spec/fixtures/tmp/d20140427-21872-1tvidqe/path/to/file.html +1 -0
  396. data/spec/fixtures/tmp/d20140427-22504-71qvop/path/to/file.html +1 -0
  397. data/spec/fixtures/tmp/d20140427-22504-i1r2s3/path/to/file.html +1 -0
  398. data/spec/fixtures/tmp/d20140427-23068-193qgxc/path/to/file.html +1 -0
  399. data/spec/fixtures/tmp/d20140427-23068-1vegcgf/path/to/file.html +1 -0
  400. data/spec/fixtures/tmp/d20140427-23091-1e0kre8/path/to/file.html +1 -0
  401. data/spec/fixtures/tmp/d20140427-23091-1gav2n5/path/to/file.html +1 -0
  402. data/spec/fixtures/tmp/d20140427-23306-1ap3njr/path/to/file.html +1 -0
  403. data/spec/fixtures/tmp/d20140427-23306-1ar0xmh/path/to/file.html +1 -0
  404. data/spec/fixtures/tmp/d20140427-23411-18bbxhj/path/to/file.html +1 -0
  405. data/spec/fixtures/tmp/d20140427-23411-ovshun/path/to/file.html +1 -0
  406. data/spec/fixtures/tmp/d20140427-23495-11tnfrx/path/to/file.html +1 -0
  407. data/spec/fixtures/tmp/d20140427-23495-13f0tcm/path/to/file.html +1 -0
  408. data/spec/fixtures/tmp/d20140427-24180-10u5ymt/path/to/file.html +1 -0
  409. data/spec/fixtures/tmp/d20140427-24180-1s9juvy/path/to/file.html +1 -0
  410. data/spec/fixtures/tmp/d20140427-24506-stgci6/path/to/file.html +1 -0
  411. data/spec/fixtures/tmp/d20140427-24506-xmkxc8/path/to/file.html +1 -0
  412. data/spec/fixtures/tmp/d20140427-2553-mkgyph/path/to/file.html +1 -0
  413. data/spec/fixtures/tmp/d20140427-2553-rkwaw8/path/to/file.html +1 -0
  414. data/spec/fixtures/tmp/d20140427-2776-11k5nfu/path/to/file.html +1 -0
  415. data/spec/fixtures/tmp/d20140427-2776-4p4d3p/path/to/file.html +1 -0
  416. data/spec/fixtures/tmp/d20140427-29589-lclgjx/path/to/file.html +1 -0
  417. data/spec/fixtures/tmp/d20140427-29589-nua1jm/path/to/file.html +1 -0
  418. data/spec/fixtures/tmp/d20140427-30024-h0uiwr/path/to/file.html +1 -0
  419. data/spec/fixtures/tmp/d20140427-30024-sv28ch/path/to/file.html +1 -0
  420. data/spec/fixtures/tmp/d20140427-3074-1y3l42j/path/to/file.html +1 -0
  421. data/spec/fixtures/tmp/d20140427-3074-dc798g/path/to/file.html +1 -0
  422. data/spec/fixtures/tmp/d20140427-30947-1aocf1l/path/to/file.html +1 -0
  423. data/spec/fixtures/tmp/d20140427-30947-j3fntl/path/to/file.html +1 -0
  424. data/spec/fixtures/tmp/d20140427-31324-79zqq5/path/to/file.html +1 -0
  425. data/spec/fixtures/tmp/d20140427-31324-j6a1vi/path/to/file.html +1 -0
  426. data/spec/fixtures/tmp/d20140427-31448-14jvamh/path/to/file.html +1 -0
  427. data/spec/fixtures/tmp/d20140427-31448-dp7nhr/path/to/file.html +1 -0
  428. data/spec/fixtures/tmp/d20140427-31984-5qwewl/path/to/file.html +1 -0
  429. data/spec/fixtures/tmp/d20140427-31984-wmi7sj/path/to/file.html +1 -0
  430. data/spec/fixtures/tmp/d20140427-32151-17ktwqk/path/to/file.html +1 -0
  431. data/spec/fixtures/tmp/d20140427-32151-44xtne/path/to/file.html +1 -0
  432. data/spec/fixtures/tmp/d20140427-3218-h4dlma/path/to/file.html +1 -0
  433. data/spec/fixtures/tmp/d20140427-3218-vb5hzg/path/to/file.html +1 -0
  434. data/spec/fixtures/tmp/d20140427-32657-13dco5i/path/to/file.html +1 -0
  435. data/spec/fixtures/tmp/d20140427-32657-14xn5is/path/to/file.html +1 -0
  436. data/spec/fixtures/tmp/d20140427-3764-1pf3smn/path/to/file.html +1 -0
  437. data/spec/fixtures/tmp/d20140427-3764-1um2gw4/path/to/file.html +1 -0
  438. data/spec/fixtures/tmp/d20140427-4257-1cm4ldf/path/to/file.html +1 -0
  439. data/spec/fixtures/tmp/d20140427-4257-tc0pr8/path/to/file.html +1 -0
  440. data/spec/fixtures/tmp/d20140427-478-1x1qpl1/path/to/file.html +1 -0
  441. data/spec/fixtures/tmp/d20140427-478-fj2efq/path/to/file.html +1 -0
  442. data/spec/fixtures/tmp/d20140427-5054-lbdxai/path/to/file.html +1 -0
  443. data/spec/fixtures/tmp/d20140427-5054-xo1lnq/path/to/file.html +1 -0
  444. data/spec/fixtures/tmp/d20140427-5363-1hno1we/path/to/file.html +1 -0
  445. data/spec/fixtures/tmp/d20140427-5363-ebw4j/path/to/file.html +1 -0
  446. data/spec/fixtures/tmp/d20140427-5545-13usafg/path/to/file.html +1 -0
  447. data/spec/fixtures/tmp/d20140427-5545-27h4em/path/to/file.html +1 -0
  448. data/spec/fixtures/tmp/d20140427-6332-1oskwyz/path/to/file.html +1 -0
  449. data/spec/fixtures/tmp/d20140427-6332-x5lqqy/path/to/file.html +1 -0
  450. data/spec/fixtures/tmp/d20140427-7332-id1sj/path/to/file.html +1 -0
  451. data/spec/fixtures/tmp/d20140427-7332-n0fxsy/path/to/file.html +1 -0
  452. data/spec/fixtures/tmp/d20140427-8086-1x22rj1/path/to/file.html +1 -0
  453. data/spec/fixtures/tmp/d20140427-8086-d91hu4/path/to/file.html +1 -0
  454. data/spec/fixtures/tmp/d20140427-8148-1c5zf1y/path/to/file.html +1 -0
  455. data/spec/fixtures/tmp/d20140427-8148-9ei2tx/path/to/file.html +1 -0
  456. data/spec/fixtures/tmp/d20140427-8571-1ulwrn6/path/to/file.html +1 -0
  457. data/spec/fixtures/tmp/d20140427-8571-9jpnn2/path/to/file.html +1 -0
  458. data/spec/fixtures/tmp/d20140427-8901-1bkiex2/path/to/file.html +1 -0
  459. data/spec/fixtures/tmp/d20140427-8901-1c01uzg/path/to/file.html +1 -0
  460. data/spec/fixtures/tmp/d20140427-9097-1bp4oup/path/to/file.html +1 -0
  461. data/spec/fixtures/tmp/d20140427-9097-1fhzcvu/path/to/file.html +1 -0
  462. data/spec/fixtures/tmp/d20140427-9146-16mftd9/path/to/file.html +1 -0
  463. data/spec/fixtures/tmp/d20140427-9146-vfpu8y/path/to/file.html +1 -0
  464. data/spec/fixtures/tmp/d20140427-9288-1dgaxz2/path/to/file.html +1 -0
  465. data/spec/fixtures/tmp/d20140427-9288-6cly4a/path/to/file.html +1 -0
  466. data/spec/fixtures/tmp/d20140427-9618-14w19o7/path/to/file.html +1 -0
  467. data/spec/fixtures/tmp/d20140427-9618-1v040gn/path/to/file.html +1 -0
  468. data/spec/fixtures/tmp/d20140721-1715-1i1gylu/path/to/file.html +1 -0
  469. data/spec/fixtures/tmp/d20140721-1715-1vfcq84/path/to/file.html +1 -0
  470. data/spec/fixtures/tmp/d20140721-17789-24psgg/path/to/file.html +1 -0
  471. data/spec/fixtures/tmp/d20140721-17789-obyran/path/to/file.html +1 -0
  472. data/spec/fixtures/tmp/d20140721-1854-2whwi9/path/to/file.html +1 -0
  473. data/spec/fixtures/tmp/d20140721-1854-61scf5/path/to/file.html +1 -0
  474. data/spec/fixtures/tmp/d20140721-2009-1rytchn/path/to/file.html +1 -0
  475. data/spec/fixtures/tmp/d20140721-2009-d7801o/path/to/file.html +1 -0
  476. data/spec/fixtures/tmp/d20140905-10034-5eixi4/path/to/file.html +1 -0
  477. data/spec/fixtures/tmp/d20140905-10034-k56z5r/path/to/file.html +1 -0
  478. data/spec/fixtures/tmp/d20140905-11956-18fy4h5/path/to/file.html +1 -0
  479. data/spec/fixtures/tmp/d20140905-11956-1xn8fyd/path/to/file.html +1 -0
  480. data/spec/fixtures/tmp/d20140905-13443-1s42hwy/path/to/file.html +1 -0
  481. data/spec/fixtures/tmp/d20140905-13443-cyfg2i/path/to/file.html +1 -0
  482. data/spec/fixtures/tmp/d20140905-13566-4gcpr4/path/to/file.html +1 -0
  483. data/spec/fixtures/tmp/d20140905-13566-gepopm/path/to/file.html +1 -0
  484. data/spec/fixtures/tmp/d20140905-1450-13mlsa6/path/to/file.html +1 -0
  485. data/spec/fixtures/tmp/d20140905-1450-p8nda4/path/to/file.html +1 -0
  486. data/spec/fixtures/tmp/d20140905-14901-1g9yc2a/path/to/file.html +1 -0
  487. data/spec/fixtures/tmp/d20140905-14901-26shkc/path/to/file.html +1 -0
  488. data/spec/fixtures/tmp/d20140905-15994-17q9s4z/path/to/file.html +1 -0
  489. data/spec/fixtures/tmp/d20140905-15994-2zl28m/path/to/file.html +1 -0
  490. data/spec/fixtures/tmp/d20140905-1684-1smoed7/path/to/file.html +1 -0
  491. data/spec/fixtures/tmp/d20140905-1684-x5g3xc/path/to/file.html +1 -0
  492. data/spec/fixtures/tmp/d20140905-16964-kzbjqu/path/to/file.html +1 -0
  493. data/spec/fixtures/tmp/d20140905-16964-pib05i/path/to/file.html +1 -0
  494. data/spec/fixtures/tmp/d20140905-17002-c61td9/path/to/file.html +1 -0
  495. data/spec/fixtures/tmp/d20140905-17002-hzo1lu/path/to/file.html +1 -0
  496. data/spec/fixtures/tmp/d20140905-17640-1atfg3e/path/to/file.html +1 -0
  497. data/spec/fixtures/tmp/d20140905-17640-tdt6pc/path/to/file.html +1 -0
  498. data/spec/fixtures/tmp/d20140905-17783-17lrr3t/path/to/file.html +1 -0
  499. data/spec/fixtures/tmp/d20140905-17783-2w5edx/path/to/file.html +1 -0
  500. data/spec/fixtures/tmp/d20140905-18993-1l9cysh/path/to/file.html +1 -0
  501. data/spec/fixtures/tmp/d20140905-18993-vmtl89/path/to/file.html +1 -0
  502. data/spec/fixtures/tmp/d20140905-19506-1vmg6jl/path/to/file.html +1 -0
  503. data/spec/fixtures/tmp/d20140905-19506-1xlh9ag/path/to/file.html +1 -0
  504. data/spec/fixtures/tmp/d20140905-19782-jcseew/path/to/file.html +1 -0
  505. data/spec/fixtures/tmp/d20140905-19782-oomr42/path/to/file.html +1 -0
  506. data/spec/fixtures/tmp/d20140905-19909-1um2az0/path/to/file.html +1 -0
  507. data/spec/fixtures/tmp/d20140905-19909-j1a10t/path/to/file.html +1 -0
  508. data/spec/fixtures/tmp/d20140905-20271-aoebav/path/to/file.html +1 -0
  509. data/spec/fixtures/tmp/d20140905-20271-bnz844/path/to/file.html +1 -0
  510. data/spec/fixtures/tmp/d20140905-2053-1yruyms/path/to/file.html +1 -0
  511. data/spec/fixtures/tmp/d20140905-2053-3jk87h/path/to/file.html +1 -0
  512. data/spec/fixtures/tmp/d20140905-2212-dm59e9/path/to/file.html +1 -0
  513. data/spec/fixtures/tmp/d20140905-2212-du7ic2/path/to/file.html +1 -0
  514. data/spec/fixtures/tmp/d20140905-22476-1p99z6q/path/to/file.html +1 -0
  515. data/spec/fixtures/tmp/d20140905-22476-o56ie5/path/to/file.html +1 -0
  516. data/spec/fixtures/tmp/d20140905-22692-i76vp0/path/to/file.html +1 -0
  517. data/spec/fixtures/tmp/d20140905-22692-uss2jq/path/to/file.html +1 -0
  518. data/spec/fixtures/tmp/d20140905-2287-1ikrmc/path/to/file.html +1 -0
  519. data/spec/fixtures/tmp/d20140905-2287-wzsn4a/path/to/file.html +1 -0
  520. data/spec/fixtures/tmp/d20140905-2470-13hythu/path/to/file.html +1 -0
  521. data/spec/fixtures/tmp/d20140905-2470-u7x3du/path/to/file.html +1 -0
  522. data/spec/fixtures/tmp/d20140905-24861-j3w00j/path/to/file.html +1 -0
  523. data/spec/fixtures/tmp/d20140905-24861-sweyos/path/to/file.html +1 -0
  524. data/spec/fixtures/tmp/d20140905-2530-10qn2lw/path/to/file.html +1 -0
  525. data/spec/fixtures/tmp/d20140905-2530-1bgwzsv/path/to/file.html +1 -0
  526. data/spec/fixtures/tmp/d20140905-25790-7e8sfi/path/to/file.html +1 -0
  527. data/spec/fixtures/tmp/d20140905-25790-wddyc5/path/to/file.html +1 -0
  528. data/spec/fixtures/tmp/d20140905-26075-16x1mzq/path/to/file.html +1 -0
  529. data/spec/fixtures/tmp/d20140905-26075-lv90l8/path/to/file.html +1 -0
  530. data/spec/fixtures/tmp/d20140905-28166-11za2od/path/to/file.html +1 -0
  531. data/spec/fixtures/tmp/d20140905-28166-1g36c8a/path/to/file.html +1 -0
  532. data/spec/fixtures/tmp/d20140905-2905-pnm5uq/path/to/file.html +1 -0
  533. data/spec/fixtures/tmp/d20140905-2905-t6t2d2/path/to/file.html +1 -0
  534. data/spec/fixtures/tmp/d20140905-30503-58wb7q/path/to/file.html +1 -0
  535. data/spec/fixtures/tmp/d20140905-30503-jb624u/path/to/file.html +1 -0
  536. data/spec/fixtures/tmp/d20140905-30934-1gvne1f/path/to/file.html +1 -0
  537. data/spec/fixtures/tmp/d20140905-30934-1s03nu/path/to/file.html +1 -0
  538. data/spec/fixtures/tmp/d20140905-31149-1hz9a6h/path/to/file.html +1 -0
  539. data/spec/fixtures/tmp/d20140905-31149-jf7ugm/path/to/file.html +1 -0
  540. data/spec/fixtures/tmp/d20140905-31151-l8md23/path/to/file.html +1 -0
  541. data/spec/fixtures/tmp/d20140905-31151-mv84hu/path/to/file.html +1 -0
  542. data/spec/fixtures/tmp/d20140905-31201-11s2gb8/path/to/file.html +1 -0
  543. data/spec/fixtures/tmp/d20140905-31201-1v30ybw/path/to/file.html +1 -0
  544. data/spec/fixtures/tmp/d20140905-31320-17yj1zt/path/to/file.html +1 -0
  545. data/spec/fixtures/tmp/d20140905-31320-8911dv/path/to/file.html +1 -0
  546. data/spec/fixtures/tmp/d20140905-3266-clqy7v/path/to/file.html +1 -0
  547. data/spec/fixtures/tmp/d20140905-3266-hivm33/path/to/file.html +1 -0
  548. data/spec/fixtures/tmp/d20140905-3419-crni3q/path/to/file.html +1 -0
  549. data/spec/fixtures/tmp/d20140905-3419-r3fmsm/path/to/file.html +1 -0
  550. data/spec/fixtures/tmp/d20140905-3720-1u5es3e/path/to/file.html +1 -0
  551. data/spec/fixtures/tmp/d20140905-3720-xlhqm7/path/to/file.html +1 -0
  552. data/spec/fixtures/tmp/d20140905-3800-1i8zi6k/path/to/file.html +1 -0
  553. data/spec/fixtures/tmp/d20140905-3800-6a94vn/path/to/file.html +1 -0
  554. data/spec/fixtures/tmp/d20140905-3995-1us9boh/path/to/file.html +1 -0
  555. data/spec/fixtures/tmp/d20140905-3995-5bqdfo/path/to/file.html +1 -0
  556. data/spec/fixtures/tmp/d20140905-4092-1jibb0h/path/to/file.html +1 -0
  557. data/spec/fixtures/tmp/d20140905-4092-puypnm/path/to/file.html +1 -0
  558. data/spec/fixtures/tmp/d20140905-4223-q53ye3/path/to/file.html +1 -0
  559. data/spec/fixtures/tmp/d20140905-4223-r3yyf4/path/to/file.html +1 -0
  560. data/spec/fixtures/tmp/d20140905-4351-1fubfac/path/to/file.html +1 -0
  561. data/spec/fixtures/tmp/d20140905-4351-9hr549/path/to/file.html +1 -0
  562. data/spec/fixtures/tmp/d20140905-4411-13zoq6l/path/to/file.html +1 -0
  563. data/spec/fixtures/tmp/d20140905-4411-1ppzzqw/path/to/file.html +1 -0
  564. data/spec/fixtures/tmp/d20140905-4442-6rva41/path/to/file.html +1 -0
  565. data/spec/fixtures/tmp/d20140905-4442-wmqe8v/path/to/file.html +1 -0
  566. data/spec/fixtures/tmp/d20140905-4556-1tldwwb/path/to/file.html +1 -0
  567. data/spec/fixtures/tmp/d20140905-4556-lu2ugj/path/to/file.html +1 -0
  568. data/spec/fixtures/tmp/d20140905-4640-1a48m57/path/to/file.html +1 -0
  569. data/spec/fixtures/tmp/d20140905-4640-hz0ov9/path/to/file.html +1 -0
  570. data/spec/fixtures/tmp/d20140905-4641-1oo0oif/path/to/file.html +1 -0
  571. data/spec/fixtures/tmp/d20140905-4641-1wvni2t/path/to/file.html +1 -0
  572. data/spec/fixtures/tmp/d20140905-4742-iktt74/path/to/file.html +1 -0
  573. data/spec/fixtures/tmp/d20140905-4742-u92ejt/path/to/file.html +1 -0
  574. data/spec/fixtures/tmp/d20140905-4824-1tjdeq1/path/to/file.html +1 -0
  575. data/spec/fixtures/tmp/d20140905-4824-vsf2zu/path/to/file.html +1 -0
  576. data/spec/fixtures/tmp/d20140905-4897-1fw357l/path/to/file.html +1 -0
  577. data/spec/fixtures/tmp/d20140905-4897-1ghjf6v/path/to/file.html +1 -0
  578. data/spec/fixtures/tmp/d20140905-5000-6h3rmj/path/to/file.html +1 -0
  579. data/spec/fixtures/tmp/d20140905-5000-aurdqr/path/to/file.html +1 -0
  580. data/spec/fixtures/tmp/d20140905-5127-1guusdh/path/to/file.html +1 -0
  581. data/spec/fixtures/tmp/d20140905-5127-tbe46/path/to/file.html +1 -0
  582. data/spec/fixtures/tmp/d20140905-5198-1wiha7m/path/to/file.html +1 -0
  583. data/spec/fixtures/tmp/d20140905-5198-xbyps9/path/to/file.html +1 -0
  584. data/spec/fixtures/tmp/d20140905-5294-1c9ff5k/path/to/file.html +1 -0
  585. data/spec/fixtures/tmp/d20140905-5294-ff78ui/path/to/file.html +1 -0
  586. data/spec/fixtures/tmp/d20140905-5463-1f4eqt4/path/to/file.html +1 -0
  587. data/spec/fixtures/tmp/d20140905-5463-1lyqgpk/path/to/file.html +1 -0
  588. data/spec/fixtures/tmp/d20140905-5558-15eb6u/path/to/file.html +1 -0
  589. data/spec/fixtures/tmp/d20140905-5558-ruzn9p/path/to/file.html +1 -0
  590. data/spec/fixtures/tmp/d20140905-5570-16g7tsd/path/to/file.html +1 -0
  591. data/spec/fixtures/tmp/d20140905-5570-16wlh0x/path/to/file.html +1 -0
  592. data/spec/fixtures/tmp/d20140905-571-10mx3uc/path/to/file.html +1 -0
  593. data/spec/fixtures/tmp/d20140905-571-1telmsf/path/to/file.html +1 -0
  594. data/spec/fixtures/tmp/d20140905-5828-1nta8ez/path/to/file.html +1 -0
  595. data/spec/fixtures/tmp/d20140905-5828-1v1is65/path/to/file.html +1 -0
  596. data/spec/fixtures/tmp/d20140905-6164-15o4poi/path/to/file.html +1 -0
  597. data/spec/fixtures/tmp/d20140905-6164-1g3lvlh/path/to/file.html +1 -0
  598. data/spec/fixtures/tmp/d20140905-6165-19tz2zi/path/to/file.html +1 -0
  599. data/spec/fixtures/tmp/d20140905-6165-yqs4pm/path/to/file.html +1 -0
  600. data/spec/fixtures/tmp/d20140905-6298-1hp4drd/path/to/file.html +1 -0
  601. data/spec/fixtures/tmp/d20140905-6298-4fdeo2/path/to/file.html +1 -0
  602. data/spec/fixtures/tmp/d20140905-6558-1gd7yzu/path/to/file.html +1 -0
  603. data/spec/fixtures/tmp/d20140905-6558-85x5o6/path/to/file.html +1 -0
  604. data/spec/fixtures/tmp/d20140905-656-1m2glyc/path/to/file.html +1 -0
  605. data/spec/fixtures/tmp/d20140905-656-1y21odi/path/to/file.html +1 -0
  606. data/spec/fixtures/tmp/d20140905-6604-1cazop7/path/to/file.html +1 -0
  607. data/spec/fixtures/tmp/d20140905-6604-zrofp4/path/to/file.html +1 -0
  608. data/spec/fixtures/tmp/d20140905-7230-15ql4dz/path/to/file.html +1 -0
  609. data/spec/fixtures/tmp/d20140905-7230-7a8a93/path/to/file.html +1 -0
  610. data/spec/fixtures/tmp/d20140905-7495-1mpqymn/path/to/file.html +1 -0
  611. data/spec/fixtures/tmp/d20140905-7495-q8mh6n/path/to/file.html +1 -0
  612. data/spec/fixtures/tmp/d20140905-7846-14bx0vk/path/to/file.html +1 -0
  613. data/spec/fixtures/tmp/d20140905-7846-puiatr/path/to/file.html +1 -0
  614. data/spec/fixtures/tmp/d20140905-7907-1i1z8y4/path/to/file.html +1 -0
  615. data/spec/fixtures/tmp/d20140905-7907-f839cr/path/to/file.html +1 -0
  616. data/spec/fixtures/tmp/d20140905-8060-19c2yhr/path/to/file.html +1 -0
  617. data/spec/fixtures/tmp/d20140905-8060-png6ih/path/to/file.html +1 -0
  618. data/spec/fixtures/tmp/d20140905-8675-vkd6/path/to/file.html +1 -0
  619. data/spec/fixtures/tmp/d20140905-8675-yjgpsb/path/to/file.html +1 -0
  620. data/spec/fixtures/tmp/d20140905-8723-3vwlqm/path/to/file.html +1 -0
  621. data/spec/fixtures/tmp/d20140905-8723-7dansu/path/to/file.html +1 -0
  622. data/spec/fixtures/tmp/d20140905-8813-1r5y94n/path/to/file.html +1 -0
  623. data/spec/fixtures/tmp/d20140905-8813-zmw27u/path/to/file.html +1 -0
  624. data/spec/fixtures/tmp/d20140905-8870-9eknpi/path/to/file.html +1 -0
  625. data/spec/fixtures/tmp/d20140905-8870-kxk62n/path/to/file.html +1 -0
  626. data/spec/functional/generators/static_spec.rb +21 -0
  627. data/spec/spec_helper.rb +31 -0
  628. data/spec/stic/blob_spec.rb +105 -0
  629. data/spec/stic/config_spec.rb +18 -0
  630. data/spec/stic/file_spec.rb +94 -0
  631. data/spec/stic/generator_spec.rb +23 -0
  632. data/spec/stic/layout_spec.rb +45 -0
  633. data/spec/stic/metadata/block_comment_yaml_spec.rb +86 -0
  634. data/spec/stic/metadata/comment_yaml_spec.rb +42 -0
  635. data/spec/stic/metadata/html_yaml_spec.rb +61 -0
  636. data/spec/stic/metadata/yaml_spec.rb +42 -0
  637. data/spec/stic/site_spec.rb +148 -0
  638. data/spec/support/file_fixtures.rb +44 -0
  639. data/stic.gemspec +28 -0
  640. metadata +1381 -0
@@ -0,0 +1,27 @@
1
+ module Stic::Metadata
2
+
3
+ # The HtmlYaml front matter parses YAML meta data from
4
+ # an HTML comment at the beginning of a page:
5
+ #
6
+ # ```
7
+ # <!--
8
+ # title: An Example
9
+ # --><html>...
10
+ # ```
11
+ #
12
+ # ```
13
+ # <!-- title: An Example -->
14
+ # <html>...
15
+ # ```
16
+ #
17
+ class HtmlYaml < ::Stic::Metadata::Yaml
18
+
19
+ HTML_YAML_REGEXP = /\A<!--\s*(?<data>.*?\n?)(-->\s*(\n|$)|^-->\s*\n?)(?<content>.*)\z/m
20
+
21
+ def regexp
22
+ HTML_YAML_REGEXP
23
+ end
24
+ end
25
+
26
+ ::Stic::Metadata.parsers << HtmlYaml.new
27
+ end
@@ -0,0 +1,21 @@
1
+ module Stic::Metadata
2
+
3
+ # A Metadata::Parser can be used to parse metadata from
4
+ # a file blob. This class defines the required interface
5
+ # and can be used to derive specialized implementations.
6
+ #
7
+ class Parser
8
+
9
+ # Parse given string blob. Return [data, content] if
10
+ # blob parsing was successful or [nil, content]
11
+ # otherwise.
12
+ #
13
+ # First argument will be corresponding file blob object
14
+ # e.g. to check file extension if front matter is
15
+ # restricted to specific file format.
16
+ #
17
+ def parse(blob, str)
18
+ raise NotImplementedError.new "#{self.class.name}#parse must be implemented by subclass."
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,52 @@
1
+ require 'yaml'
2
+
3
+ module Stic::Metadata
4
+
5
+ # The YAML front matter is parses YAML meta data embraced
6
+ # in three dashes from the beginning of a file.
7
+ #
8
+ # @example
9
+ # ---
10
+ # title: An Example
11
+ # ---
12
+ #
13
+ class Yaml < ::Stic::Metadata::Parser
14
+
15
+ DASHED_YAML_REGEXP =
16
+ /\A(?<data>---?\s*\n.*?\n?)^(---\s*$\n?)(?<content>.*)\z/m
17
+
18
+ # Return Regexp to match YAML frontmatter and content.
19
+ # Must provide two named match groups named `data` and
20
+ # `content`.
21
+ def regexp
22
+ DASHED_YAML_REGEXP
23
+ end
24
+
25
+ def preprocess_data(blob, data)
26
+ data
27
+ end
28
+
29
+ def preprocess_content(blob, content)
30
+ content
31
+ end
32
+
33
+ def match(blob, str)
34
+ regexp.match(str)
35
+ end
36
+
37
+ def parse(blob, str)
38
+ if (match = match(blob, str))
39
+ begin
40
+ [
41
+ ::YAML.load(preprocess_data(blob, match[:data])),
42
+ preprocess_content(blob, match[:content])
43
+ ]
44
+ rescue Psych::SyntaxError => err
45
+ raise Stic::InvalidMetadata.new blob: blob
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ ::Stic::Metadata.parsers << Yaml.new
52
+ end
@@ -0,0 +1,34 @@
1
+ module Stic
2
+
3
+ #
4
+ #
5
+ class Page < File
6
+ include ::Stic::Renderable
7
+ include ::Stic::Metadata
8
+ include ::Stic::Layoutable
9
+
10
+ def url_template
11
+ path.replace_extensions(target_extension).as_absolute
12
+ end
13
+
14
+ def target_extension
15
+ return data[:format] if data.key?(:format)
16
+ case path.extensions.first
17
+ when 'css', 'scss', 'sass', 'styl', 'less'
18
+ 'css'
19
+ when 'js', 'coffeescript'
20
+ 'js'
21
+ else
22
+ 'html'
23
+ end
24
+ end
25
+
26
+ def default_layout
27
+ if target_extension == 'html'
28
+ super
29
+ else
30
+ nil
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,103 @@
1
+ module Stic
2
+ #
3
+ # = Stic::Readable
4
+ #
5
+ # Include this module for blobs that have a source file.
6
+ # It provides methods for reading and storing the source
7
+ # file.
8
+ #
9
+ module Readable
10
+ # @!group Attributes
11
+
12
+ # The full path to source file.
13
+ #
14
+ # @return [Path] Base path.
15
+ #
16
+ attr_reader :source
17
+
18
+ # The virtual path to this file including file name. This path
19
+ # represents the target in the generated output.
20
+ #
21
+ # The path will be used to derive the {#url_template}.
22
+ #
23
+ # @return [Path] File blob path.
24
+ #
25
+ attr_reader :path
26
+
27
+ # The blob file name. Will be used as file name in {#url_template} and
28
+ # therefor in {#relative_target_path} etc. The {#name} will be taken from
29
+ # {#path}'s file name if not specified in the constructor.
30
+ #
31
+ # @return [String] File blob name.
32
+ #
33
+ attr_reader :name
34
+
35
+ # @!group Construction
36
+
37
+ # Initialize new file blob object.
38
+ #
39
+ # @param opts [Hash] Initialization options.
40
+ # @option opts [#to_s] :source *Required* Full source path. See {#source}.
41
+ # @option opts [#to_s] :path Output path.
42
+ # Will use source path if not given. See {#path}.
43
+ # @option opts [String] :name Optional blob file name. See {#name}.
44
+ #
45
+ def initialize(opts = {})
46
+ super
47
+
48
+ source = opts.delete(:source) { raise ::ArgumentError.new 'Argument `:source` required.' }
49
+ path = opts.delete(:path) { source }
50
+
51
+ @source = Path(source).expand
52
+ @path = Path(path).as_relative
53
+ @name = opts.delete(:name) || @path.name
54
+ end
55
+
56
+ # @!group Accessors
57
+
58
+ # Return full source path.
59
+ #
60
+ # @return [Path] (Absolute) source path.
61
+ #
62
+ def source_path
63
+ source
64
+ end
65
+
66
+ # Return final output as string.
67
+ #
68
+ # On file blob this will just returned the unchanged {#content}.
69
+ #
70
+ # @return [String] Blob output.
71
+ #
72
+ def render
73
+ content
74
+ end
75
+
76
+ # Return file content.
77
+ #
78
+ # This method caches file content and should be
79
+ # favored over {#read}.
80
+ #
81
+ # @return [String] Blob content.
82
+ #
83
+ def content
84
+ @content ||= read
85
+ end
86
+
87
+ # @!group Actions
88
+
89
+ # Read and return raw content.
90
+ #
91
+ # It directly read the content from file every time
92
+ # called and should be avoided in favor of {#content}.
93
+ #
94
+ # It can be overridden by subclasses implementing
95
+ # special input reading behavior.
96
+ #
97
+ # @return [String] Red content.
98
+ #
99
+ def read
100
+ source_path.read
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,40 @@
1
+ module Stic
2
+ #
3
+ # Provide functionality to render content using
4
+ # Tilt with multiple engines.
5
+ #
6
+ module Renderable
7
+ #
8
+ # Return rendered content.
9
+ #
10
+ def render(opts = {})
11
+ render_content locals
12
+ end
13
+
14
+ # Render blob content without layout.
15
+ #
16
+ def render_content(locals, &block)
17
+ renderer.render(locals.merge(data: data), &block)
18
+ end
19
+
20
+ def renderer
21
+ @renderer ||= begin
22
+ Renderer.new(self)
23
+ end
24
+ end
25
+
26
+ # Return the file name for rendering. Should include all
27
+ # file extensions to determine the template engines.
28
+ #
29
+ def render_name
30
+ name
31
+ end
32
+
33
+ # Return variables that should be available as locals
34
+ # in render context.
35
+ #
36
+ def locals
37
+ {site: site}
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,31 @@
1
+ module Stic
2
+
3
+ class Renderer
4
+ attr_reader :blob, :path, :name
5
+
6
+ def initialize(blob)
7
+ @blob = blob
8
+ @path = blob.source_path
9
+ end
10
+
11
+ def render(locals, &block)
12
+ engines = Tilt.templates_for(path.basename)
13
+ engines.reduce(blob.content) do |content, engine|
14
+ engine.new(path){ content.to_s }.render(Environment, locals, &block)
15
+ end.html_safe
16
+ end
17
+
18
+ # A module to include additional rendering helper functions.
19
+ #
20
+ # @example
21
+ # module MyHelpers
22
+ # def help
23
+ # "Help here!"
24
+ # end
25
+ # end
26
+ # Stic::Renderer::Environment.extend MyHelpers
27
+ #
28
+ module Environment
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,174 @@
1
+ module Stic
2
+
3
+ # The {Site} is the main class representing the hole site project.
4
+ #
5
+ # It contains the configuration, source and target paths and provides
6
+ # all functionality to invoke {Generator}s, manage and access {Blob}s and
7
+ # write the rendered site project.
8
+ #
9
+ # @example
10
+ # site = ::Stic::Site.lookup
11
+ # site.run
12
+ # site.write
13
+ #
14
+ class Site
15
+
16
+ # @!group Attributes
17
+
18
+ # The project's source path.
19
+ #
20
+ # @return [Path] The source path.
21
+ #
22
+ attr_reader :source
23
+
24
+ # The project's target path.
25
+ #
26
+ # @return [Path] The target path.
27
+ #
28
+ attr_reader :target
29
+
30
+ # The project's configuration object. Will be initialized with the values
31
+ # loaded from configuration file found in project's source directory.
32
+ #
33
+ # @return [Config] The project configuration.
34
+ #
35
+ attr_reader :config
36
+
37
+ # The list of initialized {Generator}s. They will be initialized within
38
+ # the {#initialize} method.
39
+ #
40
+ # @return [Array<Generator>] Initialized {Generator} instances.
41
+ #
42
+ attr_reader :generators
43
+
44
+ # @!group Construction
45
+
46
+ # Initializes new {Site} object.
47
+ #
48
+ # @param source [String, Path] The source directory where the rendered site
49
+ # should be written to.
50
+ # @param config [Config] The configuration that should be used. Usually
51
+ # loaded from configuration file located in the source directory.
52
+ #
53
+ def initialize(source, config)
54
+ @config = config
55
+ @source = Path.new source
56
+ @target = Path.new(source).join('site').expand
57
+ @blobs = []
58
+ @layouts = []
59
+
60
+ @generators = self.class.generators.map do |generator_class|
61
+ generator_class.new self, config['generators']
62
+ end
63
+ end
64
+
65
+ # @!group Accessors
66
+
67
+ # Get layout with given name.
68
+ #
69
+ def layout(name)
70
+ @layouts.fetch(name)
71
+ end
72
+
73
+ # Return list of {Blob}s.
74
+ #
75
+ # You can pass a class as `:type` option that will be used to filter the
76
+ # returned {Blob}s by Inheritance. Only {Blob}s of given class or {Blob}s
77
+ # that inherit given class will be returned.
78
+ #
79
+ # @param opts [Hash] Option hash.
80
+ # @option opts [Class] :type Class used as a filter.
81
+ #
82
+ def blobs(opts = {})
83
+ return @blobs if opts[:type].nil?
84
+ @blobs.select{|blob| blob.class <= opts[:type] }
85
+ end
86
+
87
+ # @!group Actions
88
+
89
+ # Run all registered and initialized {Generator}s.
90
+ #
91
+ # A block can be passed that will be called before each {Generator} is run.
92
+ #
93
+ # @yield [generator] Called before given {Generator} will be run.
94
+ # @yieldparam generator [Generator] {Generator} to be run next.
95
+ #
96
+ # @return [Self]
97
+ #
98
+ def run(&block)
99
+ @layouts = Layout.load(self, @source, @config)
100
+
101
+ generators.each do |generator|
102
+ block.call generator if block
103
+ generator.run
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ # Write all added {Blob}s to their destination.
110
+ #
111
+ # A block can be passed that will be called before each {Blob} is written.
112
+ #
113
+ # @yield [blob] Called before given {Blob} will be written.
114
+ # @yieldparam blob [Blob] {Blob} that will be written next.
115
+ #
116
+ # @return [Self]
117
+ #
118
+ def write(&block)
119
+ blobs.each do |blob|
120
+ block.call blob if block
121
+ blob.write
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Cleanup target directory. That will remove all files and directories
128
+ # not referenced by any {Blob}.
129
+ #
130
+ # @return [Self]
131
+ #
132
+ def cleanup
133
+ paths = blobs.map(&:target_path)
134
+
135
+ # Cleanup not longer referenced files
136
+ target.glob('**/*').each do |path|
137
+ if path.file? && !paths.include?(path)
138
+ path.unlink
139
+ elsif path.directory? && !paths.any?{|p| p.path.starts_with? path.to_s }
140
+ path.rm_rf
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Add new {Blob} to site.
148
+ #
149
+ # You should not add {Blob}s with same `target_url` or
150
+ # `relative_target_path` as they later would override the previous file.
151
+ #
152
+ # @param blob [Blob] {Blob} to add.
153
+ #
154
+ def <<(blob)
155
+ blobs << blob
156
+ end
157
+
158
+ class << self
159
+ # Try to find a stic site in given directory or above.
160
+ # If no directory is given the current working
161
+ # directory will be used.
162
+ #
163
+ def lookup(dir = Path.getwd)
164
+ file = Path.new(dir).lookup(/^stic.ya?ml$/)
165
+ file ? new(file.dirname, Stic::Config.load(file)) : nil
166
+ end
167
+
168
+ # Return list of available generator classes.
169
+ def generators
170
+ @generators ||= []
171
+ end
172
+ end
173
+ end
174
+ end