writefully 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +31 -0
  4. data/Rakefile +22 -0
  5. data/app/assets/javascripts/writefully/authorships.js +2 -0
  6. data/app/assets/javascripts/writefully/sessions.js +2 -0
  7. data/app/assets/javascripts/writefully/writefully/initializers/boot.coffee +6 -0
  8. data/app/assets/javascripts/writefully/writefully/initializers/manifest.coffee +28 -0
  9. data/app/assets/javascripts/writefully/writefully/initializers/setup.coffee +4 -0
  10. data/app/assets/javascripts/writefully/writefully/loader.coffee +6 -0
  11. data/app/assets/javascripts/writefully/writefully.coffee +8 -0
  12. data/app/assets/stylesheets/writefully/base.sass +23 -0
  13. data/app/assets/stylesheets/writefully/sessions.sass +9 -0
  14. data/app/assets/stylesheets/writefully/sites.sass +33 -0
  15. data/app/assets/stylesheets/writefully/writefully.sass +4 -0
  16. data/app/controllers/writefully/application_controller.rb +28 -0
  17. data/app/controllers/writefully/authorships_controller.rb +8 -0
  18. data/app/controllers/writefully/hooks_controller.rb +51 -0
  19. data/app/controllers/writefully/posts_controller.rb +21 -0
  20. data/app/controllers/writefully/sessions_controller.rb +47 -0
  21. data/app/controllers/writefully/sites_controller.rb +51 -0
  22. data/app/helpers/writefully/application_helper.rb +15 -0
  23. data/app/helpers/writefully/flash_helper.rb +31 -0
  24. data/app/helpers/writefully/posts_helper.rb +8 -0
  25. data/app/helpers/writefully/sites_helper.rb +21 -0
  26. data/app/models/writefully/authorship.rb +34 -0
  27. data/app/models/writefully/post.rb +23 -0
  28. data/app/models/writefully/site.rb +30 -0
  29. data/app/models/writefully/tag.rb +15 -0
  30. data/app/models/writefully/tagging.rb +6 -0
  31. data/app/views/layouts/writefully/application.html.erb +16 -0
  32. data/app/views/layouts/writefully/sessions.html.erb +16 -0
  33. data/app/views/writefully/application/_activeable_link_to.html.erb +5 -0
  34. data/app/views/writefully/application/_flash.html.erb +5 -0
  35. data/app/views/writefully/application/_navigation.html.erb +23 -0
  36. data/app/views/writefully/application/flash/_owner_exists.html.erb +0 -0
  37. data/app/views/writefully/application/flash/_signed_in.html.erb +0 -0
  38. data/app/views/writefully/application/flash/_signed_out.html.erb +0 -0
  39. data/app/views/writefully/posts/_not_published.html.erb +1 -0
  40. data/app/views/writefully/posts/_post.html.erb +14 -0
  41. data/app/views/writefully/posts/_published.html.erb +1 -0
  42. data/app/views/writefully/posts/index.html.erb +7 -0
  43. data/app/views/writefully/posts/show.html.erb +0 -0
  44. data/app/views/writefully/sessions/new.html.erb +7 -0
  45. data/app/views/writefully/sites/_empty.html.erb +0 -0
  46. data/app/views/writefully/sites/_form.html.erb +15 -0
  47. data/app/views/writefully/sites/_site.html.erb +16 -0
  48. data/app/views/writefully/sites/edit.html.erb +0 -0
  49. data/app/views/writefully/sites/flash/create/_error.html.erb +0 -0
  50. data/app/views/writefully/sites/flash/create/_success.html.erb +2 -0
  51. data/app/views/writefully/sites/healthy/_no.html.erb +3 -0
  52. data/app/views/writefully/sites/healthy/_yes.html.erb +3 -0
  53. data/app/views/writefully/sites/index.html.erb +14 -0
  54. data/app/views/writefully/sites/new.html.erb +7 -0
  55. data/app/views/writefully/sites/processing/_no.html.erb +3 -0
  56. data/app/views/writefully/sites/processing/_yes.html.erb +3 -0
  57. data/app/views/writefully/sites/show/_errors.html.erb +0 -0
  58. data/app/views/writefully/sites/show/_heading.html.erb +6 -0
  59. data/app/views/writefully/sites/show/_processing.html.erb +0 -0
  60. data/app/views/writefully/sites/show/_tabs.html.erb +5 -0
  61. data/app/views/writefully/sites/show.html.erb +3 -0
  62. data/bin/rails +12 -0
  63. data/bin/writefully +7 -0
  64. data/config/routes.rb +16 -0
  65. data/db/migrate/20140402091204_create_writefully_posts.rb +22 -0
  66. data/db/migrate/20140402091244_create_writefully_tags.rb +14 -0
  67. data/db/migrate/20140402091415_create_writefully_taggings.rb +10 -0
  68. data/db/migrate/20140402200330_create_writefully_authorships.rb +12 -0
  69. data/db/migrate/20140403181629_create_writefully_sites.rb +20 -0
  70. data/lib/sample/README.md +26 -0
  71. data/lib/sample/meta.yml +7 -0
  72. data/lib/sample/writefully.png +0 -0
  73. data/lib/tasks/writefully_tasks.rake +9 -0
  74. data/lib/writefully/asset.rb +33 -0
  75. data/lib/writefully/cli.rb +57 -0
  76. data/lib/writefully/content.rb +31 -0
  77. data/lib/writefully/engine.rb +25 -0
  78. data/lib/writefully/indices.rb +21 -0
  79. data/lib/writefully/news_agency.rb +8 -0
  80. data/lib/writefully/postable.rb +57 -0
  81. data/lib/writefully/process.rb +84 -0
  82. data/lib/writefully/source.rb +52 -0
  83. data/lib/writefully/storage.rb +33 -0
  84. data/lib/writefully/taxon.rb +28 -0
  85. data/lib/writefully/tools/dispatcher.rb +59 -0
  86. data/lib/writefully/tools/eraser.rb +0 -0
  87. data/lib/writefully/tools/hammer.rb +41 -0
  88. data/lib/writefully/tools/initializer.rb +38 -0
  89. data/lib/writefully/tools/pencil.rb +71 -0
  90. data/lib/writefully/tools/pigeon.rb +19 -0
  91. data/lib/writefully/tools/synchronizer.rb +24 -0
  92. data/lib/writefully/tools.rb +13 -0
  93. data/lib/writefully/version.rb +3 -0
  94. data/lib/writefully/workers/base_worker.rb +25 -0
  95. data/lib/writefully/workers/handyman.rb +44 -0
  96. data/lib/writefully/workers/helpers/handyman/builder.rb +17 -0
  97. data/lib/writefully/workers/helpers.rb +8 -0
  98. data/lib/writefully/workers/journalist.rb +23 -0
  99. data/lib/writefully/workers.rb +9 -0
  100. data/lib/writefully/workers_helpers.rb +7 -0
  101. data/lib/writefully.rb +77 -0
  102. data/scripts/initialize.sh +30 -0
  103. data/scripts/sync.sh +17 -0
  104. data/spec/controllers/writefully/hooks_controller_spec.rb +35 -0
  105. data/spec/controllers/writefully/posts_controller_spec.rb +46 -0
  106. data/spec/controllers/writefully/sites_controller_spec.rb +91 -0
  107. data/spec/dummy/Rakefile +8 -0
  108. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  109. data/spec/dummy/app/models/playlist.rb +3 -0
  110. data/spec/dummy/app/models/post.rb +3 -0
  111. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  112. data/spec/dummy/bin/bundle +3 -0
  113. data/spec/dummy/bin/rails +4 -0
  114. data/spec/dummy/bin/rake +4 -0
  115. data/spec/dummy/config/application.rb +22 -0
  116. data/spec/dummy/config/boot.rb +5 -0
  117. data/spec/dummy/config/database.yml +25 -0
  118. data/spec/dummy/config/environment.rb +5 -0
  119. data/spec/dummy/config/environments/development.rb +29 -0
  120. data/spec/dummy/config/environments/production.rb +80 -0
  121. data/spec/dummy/config/environments/test.rb +36 -0
  122. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  123. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  124. data/spec/dummy/config/initializers/inflections.rb +16 -0
  125. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  126. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  127. data/spec/dummy/config/initializers/session_store.rb +3 -0
  128. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  129. data/spec/dummy/config/locales/en.yml +23 -0
  130. data/spec/dummy/config/routes.rb +3 -0
  131. data/spec/dummy/config/writefully.yml +9 -0
  132. data/spec/dummy/config.ru +4 -0
  133. data/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/README.md +119 -0
  134. data/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/assets/hash-selector-cover.png +0 -0
  135. data/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/assets/hash-selector-icon.png +0 -0
  136. data/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/benchmark/selector.rb +77 -0
  137. data/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/meta.yml +7 -0
  138. data/spec/dummy/content/codemy-net/posts/2-rails-flash-partials/README.md +171 -0
  139. data/spec/dummy/content/codemy-net/posts/2-rails-flash-partials/assets/cover.png +0 -0
  140. data/spec/dummy/content/codemy-net/posts/2-rails-flash-partials/meta.yml +7 -0
  141. data/spec/dummy/db/schema.rb +89 -0
  142. data/spec/dummy/log/development.log +13946 -0
  143. data/spec/dummy/log/test.log +100164 -0
  144. data/spec/dummy/tmp/cache/assets/development/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/application.sassc +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/bootstrap.cssc +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/setups.sassc +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/writefully.sassc +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/04641fdb653c0ff3c557033d87eb6a16 +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/064b3076e29f54ea572ca43d6c5950cc +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/0d2e79f7f8c9026d7d8a7f6dc63fb4a8 +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/0f1c342384786865a6200cc3ed6234a3 +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/13c3568b2854b103512b2658e6507d4b +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/18eb9f12c7e8971e0e2fad29c85a8b8e +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/18f8d9596e0fba3397539181f63befe1 +0 -0
  155. data/spec/dummy/tmp/cache/assets/development/sprockets/1977498f5af78beca26942a7c812b294 +0 -0
  156. data/spec/dummy/tmp/cache/assets/development/sprockets/1ae121eed970dfdb5f4f09953ade4de2 +0 -0
  157. data/spec/dummy/tmp/cache/assets/development/sprockets/1b5404b64386f619af12582a1a634574 +0 -0
  158. data/spec/dummy/tmp/cache/assets/development/sprockets/22b701cb6ffd8eac83ec1bfc563b54cb +0 -0
  159. data/spec/dummy/tmp/cache/assets/development/sprockets/2d27da60cfa2f1952c3aadd169ea2570 +0 -0
  160. data/spec/dummy/tmp/cache/assets/development/sprockets/2e33b23d27ad5b8771d09ed8a1435cf6 +0 -0
  161. data/spec/dummy/tmp/cache/assets/development/sprockets/3063f229c5edc0e8a3d82d7bf78024de +0 -0
  162. data/spec/dummy/tmp/cache/assets/development/sprockets/31c84f37a0c92c38be6459f19997c981 +0 -0
  163. data/spec/dummy/tmp/cache/assets/development/sprockets/320d61138ae0221b11c7e4ea0f3d53d3 +0 -0
  164. data/spec/dummy/tmp/cache/assets/development/sprockets/3355368d663ec5236287158290d6c297 +0 -0
  165. data/spec/dummy/tmp/cache/assets/development/sprockets/3df2d5c2f4f6b6d502c017346b915051 +0 -0
  166. data/spec/dummy/tmp/cache/assets/development/sprockets/4596b288fc67fdb9037e06897d416879 +0 -0
  167. data/spec/dummy/tmp/cache/assets/development/sprockets/47381977da0f1b2165bdbb09480ccff3 +0 -0
  168. data/spec/dummy/tmp/cache/assets/development/sprockets/4aab863b927c65a4b9e70c43e4e6d482 +0 -0
  169. data/spec/dummy/tmp/cache/assets/development/sprockets/4c0271d24537b8a24979e07bbd75956c +0 -0
  170. data/spec/dummy/tmp/cache/assets/development/sprockets/4c16c5c88ae074d893e1de2ad787b031 +0 -0
  171. data/spec/dummy/tmp/cache/assets/development/sprockets/51610d35f263eb68b1cf73737045113d +0 -0
  172. data/spec/dummy/tmp/cache/assets/development/sprockets/5af65427549750bdf60b3f06ce273b41 +0 -0
  173. data/spec/dummy/tmp/cache/assets/development/sprockets/63958de32a7352bcfb139639ba2d4209 +0 -0
  174. data/spec/dummy/tmp/cache/assets/development/sprockets/63f349e6a646ae0252d46e1816064e0c +0 -0
  175. data/spec/dummy/tmp/cache/assets/development/sprockets/67ae1c504593279ebd6da7b6fdbe99b7 +0 -0
  176. data/spec/dummy/tmp/cache/assets/development/sprockets/68e61e8d5ac667de89a4bf1e732cde0a +0 -0
  177. data/spec/dummy/tmp/cache/assets/development/sprockets/69dfb59cc80e2c111bfbfc108371b27b +0 -0
  178. data/spec/dummy/tmp/cache/assets/development/sprockets/6d0103100e416966beba1039661e234e +0 -0
  179. data/spec/dummy/tmp/cache/assets/development/sprockets/71ea75f9945cdb543e0dc44527fcd926 +0 -0
  180. data/spec/dummy/tmp/cache/assets/development/sprockets/7556620a4f8405144dca74330e54608c +0 -0
  181. data/spec/dummy/tmp/cache/assets/development/sprockets/76598a5aebf24a1b763f5b10ae223c15 +0 -0
  182. data/spec/dummy/tmp/cache/assets/development/sprockets/7af8770b019b471931e4f6cb86027307 +0 -0
  183. data/spec/dummy/tmp/cache/assets/development/sprockets/7b696db3b421aeaa1afd210b07db8aae +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sprockets/7ff072db2442371da6ee49c9b279efdc +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sprockets/82b92bb7c88523dc617b3c0c877aeade +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sprockets/8c388cf0035e064a06ae30a03d96b51b +0 -0
  187. data/spec/dummy/tmp/cache/assets/development/sprockets/95703f30550e80a229dd0ec4a6ddc85c +0 -0
  188. data/spec/dummy/tmp/cache/assets/development/sprockets/98ccb36ebbfc6f6ac684a05ad8543c01 +0 -0
  189. data/spec/dummy/tmp/cache/assets/development/sprockets/9ad5688a6dad8d54658f492eb1fa07d6 +0 -0
  190. data/spec/dummy/tmp/cache/assets/development/sprockets/9b9ee2a899dd8b3bfa592fba44ebf8d2 +0 -0
  191. data/spec/dummy/tmp/cache/assets/development/sprockets/9c48c31b831040e919db903d9edef2ab +0 -0
  192. data/spec/dummy/tmp/cache/assets/development/sprockets/9f9f72b9edf89242aada0d52dbc57635 +0 -0
  193. data/spec/dummy/tmp/cache/assets/development/sprockets/a0e14dd5894f94a561a349d40037db07 +0 -0
  194. data/spec/dummy/tmp/cache/assets/development/sprockets/a125c2261ecc9d800e450373950ea433 +0 -0
  195. data/spec/dummy/tmp/cache/assets/development/sprockets/a3999d8baf1b9ed61d91ea6bd5e42951 +0 -0
  196. data/spec/dummy/tmp/cache/assets/development/sprockets/a8b93e1f061f64547b92633c5bde6b13 +0 -0
  197. data/spec/dummy/tmp/cache/assets/development/sprockets/ad8f1428d5543a9fc4ed7a9e9526e40a +0 -0
  198. data/spec/dummy/tmp/cache/assets/development/sprockets/adae8faa21b116471ec4285998d3f3cf +0 -0
  199. data/spec/dummy/tmp/cache/assets/development/sprockets/aea01e6a7f75a01b9f61f7e0430bd61b +0 -0
  200. data/spec/dummy/tmp/cache/assets/development/sprockets/b690c630e4500da8d405b10c5d827ac9 +0 -0
  201. data/spec/dummy/tmp/cache/assets/development/sprockets/b83537e814e13cf03642ccc3d90fda13 +0 -0
  202. data/spec/dummy/tmp/cache/assets/development/sprockets/ba4f054949cb1c1bea0fd796890fcb11 +0 -0
  203. data/spec/dummy/tmp/cache/assets/development/sprockets/bccc085acd77705bf4cd104dbd5dbec3 +0 -0
  204. data/spec/dummy/tmp/cache/assets/development/sprockets/c0c44ab8b0b90fb0287ca1400731f920 +0 -0
  205. data/spec/dummy/tmp/cache/assets/development/sprockets/c1208bf8d0e9714161d8e6ae61781efc +0 -0
  206. data/spec/dummy/tmp/cache/assets/development/sprockets/c6dae51db325ad18ac445895075e66b5 +0 -0
  207. data/spec/dummy/tmp/cache/assets/development/sprockets/ca8c11b2ed33b38e8b65858a2ba66d6f +0 -0
  208. data/spec/dummy/tmp/cache/assets/development/sprockets/ce5a98586efc888dc74dff9380760c33 +0 -0
  209. data/spec/dummy/tmp/cache/assets/development/sprockets/d0e440792b09f3cc258704d7850f0652 +0 -0
  210. data/spec/dummy/tmp/cache/assets/development/sprockets/d0e6d527077e64dc87dfa25abccd4dd3 +0 -0
  211. data/spec/dummy/tmp/cache/assets/development/sprockets/d10e06dee94ddaa562f7df319407bf18 +0 -0
  212. data/spec/dummy/tmp/cache/assets/development/sprockets/d1238ae38ca7b9522d86d67ee367223e +0 -0
  213. data/spec/dummy/tmp/cache/assets/development/sprockets/d2c2fff5893ce8979ca48bab1c6f1c3a +0 -0
  214. data/spec/dummy/tmp/cache/assets/development/sprockets/e1a679a58449aa2ee72eb4341d85b5d6 +0 -0
  215. data/spec/dummy/tmp/cache/assets/development/sprockets/e8fafe37de58ddbf16ebaf5cdc988320 +0 -0
  216. data/spec/dummy/tmp/cache/assets/development/sprockets/f15276b8745ef08f03a61f6fabe0001f +0 -0
  217. data/spec/dummy/tmp/cache/assets/development/sprockets/f79e04c0583c4be5f17610f948bc7436 +0 -0
  218. data/spec/dummy/tmp/cache/assets/development/sprockets/f966462e6d5e859d5be8f52161d2f53b +0 -0
  219. data/spec/dummy/tmp/cache/assets/development/sprockets/f977be4be94ab364314f054e18c53742 +0 -0
  220. data/spec/dummy/tmp/cache/assets/test/sass/23cfae14a65dc753e1ade92b6095067a45aad26f/bootstrap.scssc +0 -0
  221. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_alerts.scssc +0 -0
  222. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_badges.scssc +0 -0
  223. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_breadcrumbs.scssc +0 -0
  224. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_button-groups.scssc +0 -0
  225. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_buttons.scssc +0 -0
  226. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_carousel.scssc +0 -0
  227. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_close.scssc +0 -0
  228. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_code.scssc +0 -0
  229. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_component-animations.scssc +0 -0
  230. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_dropdowns.scssc +0 -0
  231. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_forms.scssc +0 -0
  232. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_glyphicons.scssc +0 -0
  233. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_grid.scssc +0 -0
  234. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_input-groups.scssc +0 -0
  235. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_jumbotron.scssc +0 -0
  236. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_labels.scssc +0 -0
  237. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_list-group.scssc +0 -0
  238. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_media.scssc +0 -0
  239. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_mixins.scssc +0 -0
  240. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_modals.scssc +0 -0
  241. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_navbar.scssc +0 -0
  242. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_navs.scssc +0 -0
  243. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_normalize.scssc +0 -0
  244. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_pager.scssc +0 -0
  245. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_pagination.scssc +0 -0
  246. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_panels.scssc +0 -0
  247. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_popovers.scssc +0 -0
  248. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_print.scssc +0 -0
  249. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_progress-bars.scssc +0 -0
  250. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_responsive-utilities.scssc +0 -0
  251. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_scaffolding.scssc +0 -0
  252. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_tables.scssc +0 -0
  253. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_thumbnails.scssc +0 -0
  254. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_tooltip.scssc +0 -0
  255. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_type.scssc +0 -0
  256. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_utilities.scssc +0 -0
  257. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_variables.scssc +0 -0
  258. data/spec/dummy/tmp/cache/assets/test/sass/6cd443894d18a18028b11ff7afc2188b8e6a0c6d/_wells.scssc +0 -0
  259. data/spec/dummy/tmp/cache/assets/test/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/base.sassc +0 -0
  260. data/spec/dummy/tmp/cache/assets/test/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/sessions.sassc +0 -0
  261. data/spec/dummy/tmp/cache/assets/test/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/sites.sassc +0 -0
  262. data/spec/dummy/tmp/cache/assets/test/sass/77bc3b7f842c905df4dddb7e3ac7b7cf15d9035b/writefully.sassc +0 -0
  263. data/spec/dummy/tmp/cache/assets/test/sprockets/064b3076e29f54ea572ca43d6c5950cc +0 -0
  264. data/spec/dummy/tmp/cache/assets/test/sprockets/0d2e79f7f8c9026d7d8a7f6dc63fb4a8 +0 -0
  265. data/spec/dummy/tmp/cache/assets/test/sprockets/18eb9f12c7e8971e0e2fad29c85a8b8e +0 -0
  266. data/spec/dummy/tmp/cache/assets/test/sprockets/1977498f5af78beca26942a7c812b294 +0 -0
  267. data/spec/dummy/tmp/cache/assets/test/sprockets/2d27da60cfa2f1952c3aadd169ea2570 +0 -0
  268. data/spec/dummy/tmp/cache/assets/test/sprockets/2e33b23d27ad5b8771d09ed8a1435cf6 +0 -0
  269. data/spec/dummy/tmp/cache/assets/test/sprockets/3063f229c5edc0e8a3d82d7bf78024de +0 -0
  270. data/spec/dummy/tmp/cache/assets/test/sprockets/31c84f37a0c92c38be6459f19997c981 +0 -0
  271. data/spec/dummy/tmp/cache/assets/test/sprockets/3df2d5c2f4f6b6d502c017346b915051 +0 -0
  272. data/spec/dummy/tmp/cache/assets/test/sprockets/4aab863b927c65a4b9e70c43e4e6d482 +0 -0
  273. data/spec/dummy/tmp/cache/assets/test/sprockets/4c0271d24537b8a24979e07bbd75956c +0 -0
  274. data/spec/dummy/tmp/cache/assets/test/sprockets/4c16c5c88ae074d893e1de2ad787b031 +0 -0
  275. data/spec/dummy/tmp/cache/assets/test/sprockets/63f349e6a646ae0252d46e1816064e0c +0 -0
  276. data/spec/dummy/tmp/cache/assets/test/sprockets/67ae1c504593279ebd6da7b6fdbe99b7 +0 -0
  277. data/spec/dummy/tmp/cache/assets/test/sprockets/68e61e8d5ac667de89a4bf1e732cde0a +0 -0
  278. data/spec/dummy/tmp/cache/assets/test/sprockets/6cf5095a6f2a3e346267010d81431898 +0 -0
  279. data/spec/dummy/tmp/cache/assets/test/sprockets/71ea75f9945cdb543e0dc44527fcd926 +0 -0
  280. data/spec/dummy/tmp/cache/assets/test/sprockets/74d56087624f43b73234c3691a21203b +0 -0
  281. data/spec/dummy/tmp/cache/assets/test/sprockets/76598a5aebf24a1b763f5b10ae223c15 +0 -0
  282. data/spec/dummy/tmp/cache/assets/test/sprockets/7af8770b019b471931e4f6cb86027307 +0 -0
  283. data/spec/dummy/tmp/cache/assets/test/sprockets/7ff072db2442371da6ee49c9b279efdc +0 -0
  284. data/spec/dummy/tmp/cache/assets/test/sprockets/82b92bb7c88523dc617b3c0c877aeade +0 -0
  285. data/spec/dummy/tmp/cache/assets/test/sprockets/8789652d56b500257c05b6b3370096a2 +0 -0
  286. data/spec/dummy/tmp/cache/assets/test/sprockets/95703f30550e80a229dd0ec4a6ddc85c +0 -0
  287. data/spec/dummy/tmp/cache/assets/test/sprockets/98ccb36ebbfc6f6ac684a05ad8543c01 +0 -0
  288. data/spec/dummy/tmp/cache/assets/test/sprockets/9ad5688a6dad8d54658f492eb1fa07d6 +0 -0
  289. data/spec/dummy/tmp/cache/assets/test/sprockets/9b9ee2a899dd8b3bfa592fba44ebf8d2 +0 -0
  290. data/spec/dummy/tmp/cache/assets/test/sprockets/9c48c31b831040e919db903d9edef2ab +0 -0
  291. data/spec/dummy/tmp/cache/assets/test/sprockets/9f9f72b9edf89242aada0d52dbc57635 +0 -0
  292. data/spec/dummy/tmp/cache/assets/test/sprockets/a2398b853766dfb3e66e6709e65e0fe8 +0 -0
  293. data/spec/dummy/tmp/cache/assets/test/sprockets/a8b93e1f061f64547b92633c5bde6b13 +0 -0
  294. data/spec/dummy/tmp/cache/assets/test/sprockets/adae8faa21b116471ec4285998d3f3cf +0 -0
  295. data/spec/dummy/tmp/cache/assets/test/sprockets/b776b64154999147a7219e7ab2ec18c5 +0 -0
  296. data/spec/dummy/tmp/cache/assets/test/sprockets/b83537e814e13cf03642ccc3d90fda13 +0 -0
  297. data/spec/dummy/tmp/cache/assets/test/sprockets/bccc085acd77705bf4cd104dbd5dbec3 +0 -0
  298. data/spec/dummy/tmp/cache/assets/test/sprockets/c1208bf8d0e9714161d8e6ae61781efc +0 -0
  299. data/spec/dummy/tmp/cache/assets/test/sprockets/d0e6d527077e64dc87dfa25abccd4dd3 +0 -0
  300. data/spec/dummy/tmp/cache/assets/test/sprockets/d10e06dee94ddaa562f7df319407bf18 +0 -0
  301. data/spec/dummy/tmp/cache/assets/test/sprockets/d1238ae38ca7b9522d86d67ee367223e +0 -0
  302. data/spec/dummy/tmp/cache/assets/test/sprockets/d2c2fff5893ce8979ca48bab1c6f1c3a +0 -0
  303. data/spec/dummy/tmp/cache/assets/test/sprockets/d743017d31a484ac9254192a452e4619 +0 -0
  304. data/spec/dummy/tmp/cache/assets/test/sprockets/e1c18951e718ae5b0d527ddf0099a3b0 +0 -0
  305. data/spec/dummy/tmp/cache/assets/test/sprockets/e1eb88bc099cda2e70c0a0ebc1e99665 +0 -0
  306. data/spec/dummy/tmp/cache/assets/test/sprockets/e8fafe37de58ddbf16ebaf5cdc988320 +0 -0
  307. data/spec/features/writefully/sites_feature_spec.rb +27 -0
  308. data/spec/fixtures/writefully/authorships.yml +11 -0
  309. data/spec/fixtures/writefully/github_hook_test.json +4 -0
  310. data/spec/fixtures/writefully/github_member_add_hook.json +127 -0
  311. data/spec/fixtures/writefully/github_push_hook.json +94 -0
  312. data/spec/fixtures/writefully/posts.yml +14 -0
  313. data/spec/fixtures/writefully/sites.yml +10 -0
  314. data/spec/lib/writefully/asset_spec.rb +22 -0
  315. data/spec/lib/writefully/content_spec.rb +22 -0
  316. data/spec/lib/writefully/indices_spec.rb +17 -0
  317. data/spec/lib/writefully/postable_spec.rb +27 -0
  318. data/spec/lib/writefully/source_spec.rb +23 -0
  319. data/spec/lib/writefully/taxon_spec.rb +27 -0
  320. data/spec/lib/writefully/tools/dispatcher_spec.rb +75 -0
  321. data/spec/lib/writefully/tools/hammer_spec.rb +78 -0
  322. data/spec/lib/writefully/tools/initializer_spec.rb +18 -0
  323. data/spec/lib/writefully/tools/pencil_spec.rb +72 -0
  324. data/spec/lib/writefully/tools/synchronizer_spec.rb +17 -0
  325. data/spec/lib/writefully/workers/handyman_spec.rb +50 -0
  326. data/spec/lib/writefully/workers/journalist_spec.rb +30 -0
  327. data/spec/spec_helper.rb +56 -0
  328. metadata +903 -0
@@ -0,0 +1,127 @@
1
+ {
2
+ "member": {
3
+ "login": "nontone",
4
+ "id": 1314654,
5
+ "avatar_url": "https://avatars.githubusercontent.com/u/1314654?",
6
+ "gravatar_id": "4fa5f095cdc060c42942d271a58aa19c",
7
+ "url": "https://api.github.com/users/nontone",
8
+ "html_url": "https://github.com/nontone",
9
+ "followers_url": "https://api.github.com/users/nontone/followers",
10
+ "following_url": "https://api.github.com/users/nontone/following{/other_user}",
11
+ "gists_url": "https://api.github.com/users/nontone/gists{/gist_id}",
12
+ "starred_url": "https://api.github.com/users/nontone/starred{/owner}{/repo}",
13
+ "subscriptions_url": "https://api.github.com/users/nontone/subscriptions",
14
+ "organizations_url": "https://api.github.com/users/nontone/orgs",
15
+ "repos_url": "https://api.github.com/users/nontone/repos",
16
+ "events_url": "https://api.github.com/users/nontone/events{/privacy}",
17
+ "received_events_url": "https://api.github.com/users/nontone/received_events",
18
+ "type": "User",
19
+ "site_admin": false
20
+ },
21
+ "action": "added",
22
+ "repository": {
23
+ "id": 18908834,
24
+ "name": "codemy-net",
25
+ "full_name": "zacksiri/codemy-net",
26
+ "owner": {
27
+ "login": "zacksiri",
28
+ "id": 134488,
29
+ "avatar_url": "https://avatars.githubusercontent.com/u/134488?",
30
+ "gravatar_id": "6cdec2364216556cf16d056a9c10af48",
31
+ "url": "https://api.github.com/users/zacksiri",
32
+ "html_url": "https://github.com/zacksiri",
33
+ "followers_url": "https://api.github.com/users/zacksiri/followers",
34
+ "following_url": "https://api.github.com/users/zacksiri/following{/other_user}",
35
+ "gists_url": "https://api.github.com/users/zacksiri/gists{/gist_id}",
36
+ "starred_url": "https://api.github.com/users/zacksiri/starred{/owner}{/repo}",
37
+ "subscriptions_url": "https://api.github.com/users/zacksiri/subscriptions",
38
+ "organizations_url": "https://api.github.com/users/zacksiri/orgs",
39
+ "repos_url": "https://api.github.com/users/zacksiri/repos",
40
+ "events_url": "https://api.github.com/users/zacksiri/events{/privacy}",
41
+ "received_events_url": "https://api.github.com/users/zacksiri/received_events",
42
+ "type": "User",
43
+ "site_admin": false
44
+ },
45
+ "private": false,
46
+ "html_url": "https://github.com/zacksiri/codemy-net",
47
+ "description": null,
48
+ "fork": false,
49
+ "url": "https://api.github.com/repos/zacksiri/codemy-net",
50
+ "forks_url": "https://api.github.com/repos/zacksiri/codemy-net/forks",
51
+ "keys_url": "https://api.github.com/repos/zacksiri/codemy-net/keys{/key_id}",
52
+ "collaborators_url": "https://api.github.com/repos/zacksiri/codemy-net/collaborators{/collaborator}",
53
+ "teams_url": "https://api.github.com/repos/zacksiri/codemy-net/teams",
54
+ "hooks_url": "https://api.github.com/repos/zacksiri/codemy-net/hooks",
55
+ "issue_events_url": "https://api.github.com/repos/zacksiri/codemy-net/issues/events{/number}",
56
+ "events_url": "https://api.github.com/repos/zacksiri/codemy-net/events",
57
+ "assignees_url": "https://api.github.com/repos/zacksiri/codemy-net/assignees{/user}",
58
+ "branches_url": "https://api.github.com/repos/zacksiri/codemy-net/branches{/branch}",
59
+ "tags_url": "https://api.github.com/repos/zacksiri/codemy-net/tags",
60
+ "blobs_url": "https://api.github.com/repos/zacksiri/codemy-net/git/blobs{/sha}",
61
+ "git_tags_url": "https://api.github.com/repos/zacksiri/codemy-net/git/tags{/sha}",
62
+ "git_refs_url": "https://api.github.com/repos/zacksiri/codemy-net/git/refs{/sha}",
63
+ "trees_url": "https://api.github.com/repos/zacksiri/codemy-net/git/trees{/sha}",
64
+ "statuses_url": "https://api.github.com/repos/zacksiri/codemy-net/statuses/{sha}",
65
+ "languages_url": "https://api.github.com/repos/zacksiri/codemy-net/languages",
66
+ "stargazers_url": "https://api.github.com/repos/zacksiri/codemy-net/stargazers",
67
+ "contributors_url": "https://api.github.com/repos/zacksiri/codemy-net/contributors",
68
+ "subscribers_url": "https://api.github.com/repos/zacksiri/codemy-net/subscribers",
69
+ "subscription_url": "https://api.github.com/repos/zacksiri/codemy-net/subscription",
70
+ "commits_url": "https://api.github.com/repos/zacksiri/codemy-net/commits{/sha}",
71
+ "git_commits_url": "https://api.github.com/repos/zacksiri/codemy-net/git/commits{/sha}",
72
+ "comments_url": "https://api.github.com/repos/zacksiri/codemy-net/comments{/number}",
73
+ "issue_comment_url": "https://api.github.com/repos/zacksiri/codemy-net/issues/comments/{number}",
74
+ "contents_url": "https://api.github.com/repos/zacksiri/codemy-net/contents/{+path}",
75
+ "compare_url": "https://api.github.com/repos/zacksiri/codemy-net/compare/{base}...{head}",
76
+ "merges_url": "https://api.github.com/repos/zacksiri/codemy-net/merges",
77
+ "archive_url": "https://api.github.com/repos/zacksiri/codemy-net/{archive_format}{/ref}",
78
+ "downloads_url": "https://api.github.com/repos/zacksiri/codemy-net/downloads",
79
+ "issues_url": "https://api.github.com/repos/zacksiri/codemy-net/issues{/number}",
80
+ "pulls_url": "https://api.github.com/repos/zacksiri/codemy-net/pulls{/number}",
81
+ "milestones_url": "https://api.github.com/repos/zacksiri/codemy-net/milestones{/number}",
82
+ "notifications_url": "https://api.github.com/repos/zacksiri/codemy-net/notifications{?since,all,participating}",
83
+ "labels_url": "https://api.github.com/repos/zacksiri/codemy-net/labels{/name}",
84
+ "releases_url": "https://api.github.com/repos/zacksiri/codemy-net/releases{/id}",
85
+ "created_at": "2014-04-18T09:25:46Z",
86
+ "updated_at": "2014-04-18T10:05:48Z",
87
+ "pushed_at": "2014-04-18T10:05:48Z",
88
+ "git_url": "git://github.com/zacksiri/codemy-net.git",
89
+ "ssh_url": "git@github.com:zacksiri/codemy-net.git",
90
+ "clone_url": "https://github.com/zacksiri/codemy-net.git",
91
+ "svn_url": "https://github.com/zacksiri/codemy-net",
92
+ "homepage": "https://github.com",
93
+ "size": 0,
94
+ "stargazers_count": 0,
95
+ "watchers_count": 0,
96
+ "language": null,
97
+ "has_issues": true,
98
+ "has_downloads": true,
99
+ "has_wiki": true,
100
+ "forks_count": 0,
101
+ "mirror_url": null,
102
+ "open_issues_count": 0,
103
+ "forks": 0,
104
+ "open_issues": 0,
105
+ "watchers": 0,
106
+ "default_branch": "master"
107
+ },
108
+ "sender": {
109
+ "login": "zacksiri",
110
+ "id": 134488,
111
+ "avatar_url": "https://avatars.githubusercontent.com/u/134488?",
112
+ "gravatar_id": "6cdec2364216556cf16d056a9c10af48",
113
+ "url": "https://api.github.com/users/zacksiri",
114
+ "html_url": "https://github.com/zacksiri",
115
+ "followers_url": "https://api.github.com/users/zacksiri/followers",
116
+ "following_url": "https://api.github.com/users/zacksiri/following{/other_user}",
117
+ "gists_url": "https://api.github.com/users/zacksiri/gists{/gist_id}",
118
+ "starred_url": "https://api.github.com/users/zacksiri/starred{/owner}{/repo}",
119
+ "subscriptions_url": "https://api.github.com/users/zacksiri/subscriptions",
120
+ "organizations_url": "https://api.github.com/users/zacksiri/orgs",
121
+ "repos_url": "https://api.github.com/users/zacksiri/repos",
122
+ "events_url": "https://api.github.com/users/zacksiri/events{/privacy}",
123
+ "received_events_url": "https://api.github.com/users/zacksiri/received_events",
124
+ "type": "User",
125
+ "site_admin": false
126
+ }
127
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "ref": "refs/heads/master",
3
+ "after": "732b51922df392091d153e6f6b267f514024378e",
4
+ "before": "95521cdb458736689ce4f4d10d5e9e71983ef9c5",
5
+ "created": false,
6
+ "deleted": false,
7
+ "forced": false,
8
+ "compare": "https://github.com/zacksiri/codemy-net/compare/95521cdb4587...732b51922df3",
9
+ "commits": [
10
+ {
11
+ "id": "732b51922df392091d153e6f6b267f514024378e",
12
+ "distinct": true,
13
+ "message": "update content",
14
+ "timestamp": "2014-04-18T17:05:39+07:00",
15
+ "url": "https://github.com/zacksiri/codemy-net/commit/732b51922df392091d153e6f6b267f514024378e",
16
+ "author": {
17
+ "name": "Zack Siri",
18
+ "email": "zack@artellectual.com",
19
+ "username": "zacksiri"
20
+ },
21
+ "committer": {
22
+ "name": "Zack Siri",
23
+ "email": "zack@artellectual.com",
24
+ "username": "zacksiri"
25
+ },
26
+ "added": [
27
+ "posts/1-building-an-api/README.md",
28
+ "posts/1-building-an-api/assets/writefully.png",
29
+ "posts/1-building-an-api/meta.yml"
30
+ ],
31
+ "removed": [
32
+ "posts/1-change-me/README.md",
33
+ "posts/1-change-me/assets/writefully.png",
34
+ "posts/1-change-me/meta.yml"
35
+ ],
36
+ "modified": []
37
+ }
38
+ ],
39
+ "head_commit": {
40
+ "id": "732b51922df392091d153e6f6b267f514024378e",
41
+ "distinct": true,
42
+ "message": "update content",
43
+ "timestamp": "2014-04-18T17:05:39+07:00",
44
+ "url": "https://github.com/zacksiri/codemy-net/commit/732b51922df392091d153e6f6b267f514024378e",
45
+ "author": {
46
+ "name": "Zack Siri",
47
+ "email": "zack@artellectual.com",
48
+ "username": "zacksiri"
49
+ },
50
+ "committer": {
51
+ "name": "Zack Siri",
52
+ "email": "zack@artellectual.com",
53
+ "username": "zacksiri"
54
+ },
55
+ "added": [
56
+ "posts/1-building-an-api/README.md",
57
+ "posts/1-building-an-api/assets/writefully.png",
58
+ "posts/1-building-an-api/meta.yml"
59
+ ],
60
+ "removed": [
61
+ "posts/1-change-me/README.md",
62
+ "posts/1-change-me/assets/writefully.png",
63
+ "posts/1-change-me/meta.yml"
64
+ ],
65
+ "modified": []
66
+ },
67
+ "repository": {
68
+ "id": 18908834,
69
+ "name": "codemy-net",
70
+ "url": "https://github.com/zacksiri/codemy-net",
71
+ "homepage": "https://github.com",
72
+ "watchers": 0,
73
+ "stargazers": 0,
74
+ "forks": 0,
75
+ "fork": false,
76
+ "size": 0,
77
+ "owner": {
78
+ "name": "zacksiri",
79
+ "email": "zack@artellectual.com"
80
+ },
81
+ "private": false,
82
+ "open_issues": 0,
83
+ "has_issues": true,
84
+ "has_downloads": true,
85
+ "has_wiki": true,
86
+ "created_at": 1397813146,
87
+ "pushed_at": 1397815548,
88
+ "master_branch": "master"
89
+ },
90
+ "pusher": {
91
+ "name": "zacksiri",
92
+ "email": "zack@artellectual.com"
93
+ }
94
+ }
@@ -0,0 +1,14 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ hash_selector_pattern:
4
+ title: "Ruby Hash Selector Pattern"
5
+ slug: "hash-selector-pattern"
6
+ content: "Blah"
7
+ type: "Post"
8
+ site: codemy_net
9
+
10
+ blah_post:
11
+ title: "Blah Post"
12
+ slug: "blah-post"
13
+ content: "Blah"
14
+ type: "Post"
@@ -0,0 +1,10 @@
1
+ codemy_net:
2
+ name: "Codemy.net"
3
+ slug: 'codemy-net'
4
+ domain: 'http://www.codemy.net'
5
+ owner: wf_owner_1
6
+
7
+ some_site:
8
+ name: "Some Site"
9
+ slug: 'some-site'
10
+ domain: 'http://www.somesite.com'
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Asset do
5
+ let(:index) { {site: 'codemy-net', resource: 'posts', slug: '1-hash-selector-pattern' } }
6
+ subject(:asset) { Asset.new(index) }
7
+ let(:url) { "https://codemycasts.s3.amazonaws.com/codemy-net/posts/1-hash-selector-pattern/assets/" }
8
+
9
+ let(:content_details) { Content.new(index).details }
10
+
11
+ its(:names) { should include 'hash-selector-cover.png' }
12
+ its(:endpoint) { should eq 'codemy-net/posts/1-hash-selector-pattern/assets'}
13
+
14
+ it "#url" do
15
+ subject.url(Writefully::Storage.endpoint).should eq url
16
+ end
17
+
18
+ it "#convert_for" do
19
+ subject.convert_for(content_details)["cover"].should include url
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Content do
5
+ let(:index) { {site: 'codemy-net', resource: 'posts', slug: '1-hash-selector-pattern' } }
6
+ let(:meta) { {
7
+ "title" => "Ruby Hash Selector Pattern",
8
+ "slug" => "ruby-hash-selector-pattern",
9
+ "tags" => ["Ruby"],
10
+ "playlists" => ["A Shot of Ruby"],
11
+ "details" => { "blurb" => "We show you an alternative to if / else and case / switch.",
12
+ "cover" => "assets/hash-selector-icon.png" },
13
+ "position" => 1
14
+ } }
15
+ subject(:content) { Writefully::Content.new(index) }
16
+
17
+ its(:body) { should include "# Hash Selector Pattern" }
18
+ its(:meta) { should eq meta }
19
+ its(:slug) { should eq 'hash-selector-pattern' }
20
+ its(:position) { should eq 1 }
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Indices do
5
+ let(:full_path) { ['/Users/zacksiri/Repositories/writefully/spec/dummy/content/codemy-net/posts/1-hash-selector-pattern/README.md'] }
6
+ let(:index) { [{site: 'codemy-net', resource: 'posts', slug: '1-hash-selector-pattern' }] }
7
+ subject { Indices }
8
+
9
+ before do
10
+ Writefully.stub(:options).and_return({content: '/Users/zacksiri/Repositories/writefully/spec/dummy/content/' })
11
+ end
12
+
13
+ it "#build_from" do
14
+ Indices.build_from(full_path).should eq index
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Postable do
5
+ subject { ::Post.new }
6
+
7
+ describe "#klass_from" do
8
+ it "should return Writefully::Tag" do
9
+ subject.klass_from("tag").should eq "Writefully::Tag"
10
+ end
11
+
12
+ it "should turn Playlist" do
13
+ subject.klass_from("playlist").should eq "Playlist"
14
+ end
15
+ end
16
+
17
+ it "should set published_at" do
18
+ subject.publish = true
19
+ subject.publish_resource
20
+ subject.published_at.should_not be_nil
21
+ end
22
+
23
+ it "should taxonomize correctly" do
24
+ subject.respond_to?(:playlists).should be_true
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Source do
5
+ subject(:source) { Writefully::Source }
6
+ let(:indices) { [{site: 'codemy-net', resource: 'posts', slug: '1-hash-selector-pattern'},
7
+ {site: 'codemy-net', resource: 'posts', slug: '2-rails-flash-partials'} ]}
8
+
9
+
10
+ let(:sample_paths) { ['posts/1-change-me/README.md',
11
+ 'posts/1-change-me/meta.yml',
12
+ 'posts/1-change-me/assets/writefully.png' ] }
13
+
14
+ its(:to_load) { should =~ ['post', 'playlist'] }
15
+ its(:valid_resources) { should =~ ['posts'] }
16
+
17
+ it "should open README" do
18
+ subject.sample_content("README.md").should include "# Welcome to Writefully!"
19
+ end
20
+
21
+ its(:sample_content_paths) { should eq sample_paths }
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ module Writefully
4
+ describe Taxon do
5
+ subject(:taxon) { Taxon.new(["Ruby", "Functional"], ["Ruby"], "Writefully::Tag")}
6
+
7
+ it "#non_existing" do
8
+ subject.non_existing.first.name.should eq "Functional"
9
+ end
10
+
11
+ its(:selector) { should eq :"writefully/tag" }
12
+ its(:type_attribute) { should eq ({ type: nil }) }
13
+
14
+ describe "when type is 'playlist'" do
15
+ subject(:taxon) { Taxon.new(["Beginning Ruby", "Beginner"], ["Beginner"], "Playlist") }
16
+ let(:attributes) { {name: "Beginning Ruby", slug: 'beginning-ruby', type: 'Playlist' } }
17
+
18
+ its(:selector) { should eq :playlist }
19
+ its(:type_attribute) { should eq ({type: "Playlist"}) }
20
+
21
+ it "#build_attributes" do
22
+ built_attributes = subject.build_attributes("Beginning Ruby")
23
+ built_attributes.should eq attributes
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,75 @@
1
+ require 'spec_helper'
2
+ require 'celluloid'
3
+ require 'writefully/tools'
4
+
5
+ module Writefully
6
+ module Tools
7
+ describe Dispatcher do
8
+
9
+ let(:job) { { worker: :journalists,
10
+ message: {
11
+ resource: 'posts',
12
+ slug: '1-hash-selector-pattern' }
13
+ }}
14
+
15
+ let(:retry_data) { job.merge({ tries: 2 })}
16
+ let(:failure) { job.merge({ tries: 6 }) }
17
+
18
+ describe "#run_job" do
19
+ it "should call dispatch" do
20
+ Dispatcher.any_instance.stub(:job).and_return(job)
21
+ Dispatcher.any_instance.stub(:dispatch).and_return(true)
22
+ dispatch = Dispatcher.new
23
+ dispatch.run_job.should be_true
24
+ dispatch.terminate
25
+ end
26
+
27
+ it "should call retry_job" do
28
+ Dispatcher.any_instance.stub(:job).and_return(retry_data)
29
+ Dispatcher.any_instance.stub(:retry_job).and_return(true)
30
+ dispatch = Dispatcher.new
31
+ dispatch.run_job.should be_true
32
+ dispatch.terminate
33
+ end
34
+
35
+ it "should call retry_job" do
36
+ Dispatcher.any_instance.stub(:job).and_return(failure)
37
+ Dispatcher.any_instance.stub(:mark_as_failed).and_return(true)
38
+ dispatch = Dispatcher.new
39
+ dispatch.run_job.should be_true
40
+ dispatch.terminate
41
+ end
42
+ end
43
+
44
+
45
+ it "should be retry" do
46
+ Dispatcher.any_instance.stub(:job).and_return(retry_data)
47
+ dispatch = Dispatcher.new
48
+ dispatch.is_job?.should be_true
49
+ dispatch.job_valid?.should be_false
50
+ dispatch.is_retry?.should be_true
51
+ dispatch.retry_valid?.should be_true
52
+ dispatch.terminate
53
+ end
54
+
55
+ it "should be job and valid" do
56
+ Dispatcher.any_instance.stub(:job).and_return(job)
57
+ dispatch = Dispatcher.new
58
+ dispatch.is_job?.should be_true
59
+ dispatch.job_valid?.should be_true
60
+ dispatch.is_retry?.should be_false
61
+ dispatch.terminate
62
+ end
63
+
64
+ it "should be false for everything" do
65
+ Dispatcher.any_instance.stub(:job).and_return(failure)
66
+ dispatch = Dispatcher.new
67
+ dispatch.is_job?.should be_true
68
+ dispatch.job_valid?.should be_false
69
+ dispatch.is_retry?.should be_true
70
+ dispatch.retry_valid?.should be_false
71
+ dispatch.terminate
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,78 @@
1
+ require 'spec_helper'
2
+ require 'celluloid'
3
+ require 'writefully/tools'
4
+
5
+ module Writefully
6
+ module Tools
7
+ describe Hammer do
8
+ let(:user_name) { 'zacksiri' }
9
+ let(:domain) { 'http://www.codemy.net' }
10
+ let(:site_slug) { 'codemy-net' }
11
+ let(:token) { 'sampletoken' }
12
+
13
+ let(:message) { {auth_token: token, user_name: user_name, domain: domain, site_slug: site_slug }}
14
+
15
+ let(:hook_config) {
16
+ { name: 'web',
17
+ events: ["push", "member"],
18
+ active: true,
19
+ config: {
20
+ url: "http://www.codemy.net/writefully/hook",
21
+ content_type: 'json',
22
+ secret: '00e4de0cf7647cd447b6659bd0b3b5fe'
23
+ }
24
+ }
25
+ }
26
+
27
+ before do
28
+ $stdout.stub(:write)
29
+ $stderr.stub(:write)
30
+ end
31
+
32
+ describe "#hook_config" do
33
+ it "should be correct" do
34
+ hammer = Hammer.new message
35
+ hammer.hook_config.should eq hook_config
36
+ hammer.terminate
37
+ end
38
+ end
39
+
40
+ describe "#forge" do
41
+ it "can forge" do
42
+ Github::Repos.any_instance.stub(:create).and_return(true)
43
+ hammer = Hammer.new message
44
+ hammer.forge.should be_true
45
+ hammer.terminate
46
+ end
47
+
48
+ it "should raise error" do
49
+ Github::Repos.any_instance.stub(:create).and_raise(StandardError)
50
+ hammer = Hammer.new message
51
+ expect {
52
+ hammer.forge
53
+ }.to raise_error
54
+ end
55
+ end
56
+
57
+ describe "#add_hook_for" do
58
+ it "should create hook" do
59
+ Github::Repos::Hooks.any_instance.stub(:create).and_return(true)
60
+ hammer = Hammer.new message
61
+ hammer.add_hook_for(site_slug).should be_true
62
+ hammer.terminate
63
+ end
64
+
65
+ it "should raise error" do
66
+ Github::Repos::Hooks.any_instance.stub(:create).and_raise(StandardError)
67
+ hammer = Hammer.new message
68
+ expect {
69
+ hammer.add_hook_for(site_slug)
70
+ }.to raise_error
71
+ end
72
+ end
73
+
74
+
75
+
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ require 'celluloid'
3
+ require 'writefully/tools'
4
+
5
+ module Writefully
6
+ module Tools
7
+ describe Initializer do
8
+ let(:message) { { user_name: "zacksiri", auth_token: 'sampletoken', site_slug: 'codemy-net', ssh_url: 'blah@blah.com:zacksiri/blah.git' } }
9
+
10
+ it "should have the correct command" do
11
+ initializer = Initializer.new(message)
12
+ initializer.content_folder_setup_command.should include message[:site_slug]
13
+ initializer.content_folder_setup_command.should include message[:ssh_url]
14
+ initializer.terminate
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,72 @@
1
+ require 'spec_helper'
2
+ require 'celluloid'
3
+ require 'writefully/tools'
4
+
5
+ module Writefully
6
+ module Tools
7
+ describe Pencil do
8
+ fixtures :"writefully/sites"
9
+ fixtures :"writefully/posts"
10
+
11
+ let(:index) { {site: 'codemy-net', resource: 'posts', slug: '1-hash-selector-pattern' } }
12
+ let(:index_2) { {site: 'codemy-net', resource: 'posts', slug: '2-rails-flash-partials' } }
13
+ let(:computed_attributes) {
14
+ {
15
+ "title" => "Ruby Hash Selector Pattern",
16
+ "slug" => "ruby-hash-selector-pattern",
17
+ "tags" => ["Ruby"],
18
+ "playlists" => ["A Shot of Ruby"],
19
+ "position" => 1,
20
+ "content" => "converted stuff",
21
+ "details" => "converted stuff"
22
+ }
23
+ }
24
+
25
+ before do
26
+ $stdout.stub(:write)
27
+ $stderr.stub(:write)
28
+ Asset.any_instance.stub(:convert_for).and_return("converted stuff")
29
+ end
30
+
31
+ it "#computed_attributes" do
32
+ pencil = Pencil.new(index)
33
+ pencil.computed_attributes.should eq computed_attributes
34
+ pencil.terminate
35
+ end
36
+
37
+ describe "#write" do
38
+ it "should create new post" do
39
+ pencil = Pencil.new(index)
40
+ expect {
41
+ pencil.write
42
+ }.to change(Post, :count).by(0)
43
+ pencil.terminate
44
+ end
45
+
46
+ it "should update existing post" do
47
+ pencil = Pencil.new(index_2)
48
+ expect {
49
+ pencil.write
50
+ }.to change(Post, :count).by(1)
51
+ pencil.terminate
52
+ end
53
+ end
54
+
55
+ describe "#can_update_db" do
56
+ it "can update" do
57
+ pencil = Pencil.new(index)
58
+ pencil.can_update_db?([true, true]).should be_true
59
+ pencil.terminate
60
+ end
61
+
62
+ it "can't update" do
63
+ pencil = Pencil.new(index)
64
+ expect {
65
+ pencil.can_update_db?([true])
66
+ }.to raise_error Writefully::Tools::Pencil::SomeAssetsNotUploaded
67
+ end
68
+ end
69
+
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ require 'celluloid'
3
+ require 'writefully/tools'
4
+
5
+ module Writefully
6
+ module Tools
7
+ describe Synchronizer do
8
+ let(:message) { { site_slug: 'codemy-net' } }
9
+
10
+ it "should have the correct command" do
11
+ sync = Synchronizer.new(message)
12
+ sync.sync_command.should include message[:site_slug]
13
+ sync.terminate
14
+ end
15
+ end
16
+ end
17
+ end