resque-web 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +39 -0
  3. data/Rakefile +34 -0
  4. data/app/assets/images/resque_web/idle.png +0 -0
  5. data/app/assets/images/resque_web/lifebuoy.png +0 -0
  6. data/app/assets/images/resque_web/poll.png +0 -0
  7. data/app/assets/images/resque_web/rails.png +0 -0
  8. data/app/assets/images/resque_web/working.png +0 -0
  9. data/app/assets/javascripts/resque_web/application.js +105 -0
  10. data/app/assets/javascripts/resque_web/bootstrap.js.coffee +4 -0
  11. data/app/assets/javascripts/resque_web/jquery.relative-date.js +47 -0
  12. data/app/assets/stylesheets/resque_web/application.css +13 -0
  13. data/app/assets/stylesheets/resque_web/bootstrap_and_overrides.css +146 -0
  14. data/app/controllers/resque_web/application_controller.rb +15 -0
  15. data/app/controllers/resque_web/failures_controller.rb +62 -0
  16. data/app/controllers/resque_web/overview_controller.rb +7 -0
  17. data/app/controllers/resque_web/queues_controller.rb +12 -0
  18. data/app/controllers/resque_web/stats_controller.rb +17 -0
  19. data/app/controllers/resque_web/workers_controller.rb +18 -0
  20. data/app/controllers/resque_web/working_controller.rb +4 -0
  21. data/app/helpers/resque_web/application_helper.rb +65 -0
  22. data/app/helpers/resque_web/failures_helper.rb +54 -0
  23. data/app/helpers/resque_web/overview_helper.rb +6 -0
  24. data/app/helpers/resque_web/queues_helper.rb +72 -0
  25. data/app/helpers/resque_web/stats_helper.rb +54 -0
  26. data/app/helpers/resque_web/workers_helper.rb +16 -0
  27. data/app/helpers/resque_web/working_helper.rb +19 -0
  28. data/app/views/layouts/resque_web/application.html.erb +58 -0
  29. data/app/views/resque_web/failures/_failed_job.html.erb +53 -0
  30. data/app/views/resque_web/failures/_overview.html.erb +24 -0
  31. data/app/views/resque_web/failures/index.html.erb +33 -0
  32. data/app/views/resque_web/failures/show.html.erb +20 -0
  33. data/app/views/resque_web/overview/show.html.erb +4 -0
  34. data/app/views/resque_web/queues/_queues.html.erb +4 -0
  35. data/app/views/resque_web/queues/_queues_advanced.html.erb +14 -0
  36. data/app/views/resque_web/queues/_queues_basic.html.erb +17 -0
  37. data/app/views/resque_web/queues/index.html.erb +1 -0
  38. data/app/views/resque_web/queues/show.html.erb +26 -0
  39. data/app/views/resque_web/stats/key.html.erb +26 -0
  40. data/app/views/resque_web/stats/keys.html.erb +19 -0
  41. data/app/views/resque_web/stats/redis.html.erb +14 -0
  42. data/app/views/resque_web/stats/resque.html.erb +14 -0
  43. data/app/views/resque_web/workers/index.html.erb +19 -0
  44. data/app/views/resque_web/workers/show.html.erb +38 -0
  45. data/app/views/resque_web/working/_working.html.erb +34 -0
  46. data/app/views/resque_web/working/index.html.erb +1 -0
  47. data/config/initializers/resque_config.rb +3 -0
  48. data/config/routes.rb +26 -0
  49. data/lib/resque_web.rb +4 -0
  50. data/lib/resque_web/engine.rb +8 -0
  51. data/lib/resque_web/version.rb +3 -0
  52. data/test/dummy/Rakefile +6 -0
  53. data/test/dummy/app/assets/javascripts/application.js +13 -0
  54. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  55. data/test/dummy/app/controllers/application_controller.rb +5 -0
  56. data/test/dummy/app/helpers/application_helper.rb +2 -0
  57. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  58. data/test/dummy/bin/bundle +3 -0
  59. data/test/dummy/bin/rails +4 -0
  60. data/test/dummy/bin/rake +4 -0
  61. data/test/dummy/config.ru +4 -0
  62. data/test/dummy/config/application.rb +23 -0
  63. data/test/dummy/config/boot.rb +5 -0
  64. data/test/dummy/config/database.yml +25 -0
  65. data/test/dummy/config/environment.rb +5 -0
  66. data/test/dummy/config/environments/development.rb +29 -0
  67. data/test/dummy/config/environments/production.rb +80 -0
  68. data/test/dummy/config/environments/test.rb +36 -0
  69. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  70. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  71. data/test/dummy/config/initializers/inflections.rb +16 -0
  72. data/test/dummy/config/initializers/mime_types.rb +5 -0
  73. data/test/dummy/config/initializers/secret_token.rb +12 -0
  74. data/test/dummy/config/initializers/session_store.rb +3 -0
  75. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  76. data/test/dummy/config/locales/en.yml +23 -0
  77. data/test/dummy/config/routes.rb +4 -0
  78. data/test/dummy/db/development.sqlite3 +0 -0
  79. data/test/dummy/db/schema.rb +16 -0
  80. data/test/dummy/db/test.sqlite3 +0 -0
  81. data/test/dummy/log/test.log +1351 -0
  82. data/test/dummy/public/404.html +58 -0
  83. data/test/dummy/public/422.html +58 -0
  84. data/test/dummy/public/500.html +57 -0
  85. data/test/dummy/public/favicon.ico +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/00d7e4d5eefd54b7a2b5415b3f4f0619 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/02a14af754d35f9d015020c827dc4aad +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/060ba1e3c27350033cb45603b40ec988 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/0aa776b181456a7f52abf642461a339d +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/0ad1874459c89c2b7b055fbfc086093c +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/0d7923c4212365467631d19aafa9ae2c +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/14882e8f1f7d019b37950944b1053585 +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/15d6969ab8e6cc86d7e4ec72a9f29473 +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/16bf950594dc4e49b471963acc1a15d4 +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/1a3e7714b622f1753a451d9417ce2934 +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/1cabd5edcfb985bf0e754597f453c2d8 +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/1f93ad5cf36f5c7e5bec2b9cecedfe5c +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/201c8ed8e16a6bad90959a270eb42af5 +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/2352f28661a506c2c3e144d28bf6a6ca +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/2359b362b8c593ecacced9da62d27781 +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/23d4f21bc0a61aa91d818a1cbefbfa38 +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/24fe9e2e6b73f666f6f50460b5fe12db +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/267d0243760c55e0ff8039158fbfa98d +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/2768ee82dea9ebd337e20faa4c08eda4 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/29c7be01674c14314b1321da043c31cd +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/2b60e487f5394d3820f0d9008328de94 +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/32fdb0387d5cd8aba5f0185f10ccaf6b +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/36bf84c5368755f6fbc0c1808cfe7c5d +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/373b0c58027ae58f732cc7e48e62a522 +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/3fde4850b9ad7516ecd360a4c20cae8b +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/47e84a019922f151c4815a3cd738beb6 +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/4d22200fb380d8ae9d5f07525088622f +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/4ef303154e5471cbc5a1b7b312a5fbd3 +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/4ff25675e9d69ac5d68dff1d4372f3d1 +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/50caadcf8e73c45ce4720b9a1f6f833d +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/510c0a3f6fbee936a507ab77436c1713 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/530c2753f447f8c666f628c5b5d65782 +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/54745c7a7543c4a5899cf4a7c285c505 +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/58c7ee7b861e3bd17b1eb3c09a0ccb7e +0 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/5ae7043abf033ad9c1db3190239296f4 +0 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/5d4f24f37f52ec24be03c3ae69a710c2 +0 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/5e3a1f4192671516ef3c5b040d3a04ec +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/6104f6b3d705c20e2485d2bb6f388f11 +0 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/61883ec63e4f9e11b14de9de4ca5157c +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/61a6ced52f8ef4bc0e18a0f42c45376e +0 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/67bdb77a662fa6c60ca6ec804ec4e72c +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/67c23683dbf4e2e805770a041018f256 +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/6c9f5bc4bee5fb0d8056b4c75fafef1e +0 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/6e4717cabfe91d260f46c4adb0acae43 +0 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/6ee0033c04cc130b81becd605709135b +0 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/706b6b4aca8f925cbbff8a4bf161cd03 +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/722f2a204ab15e0261bc526aa3ea4a3d +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/79973091687030ef9b77e73884ab0c78 +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/7bdd86db98ea61e2b45fa7a427617a3c +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/7eab29f4bea09503894bcabf91a971b0 +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/7eadf8ac6771f3b20086c935c28b0b95 +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/815e702f76d5de58787af0b2954544b4 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/821dd3a673cddb023723b5a4b98fd493 +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/8362592cdd4c1b1517d5e3fba760f0d3 +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/8855c560fba1bd85e26f55568144a4d5 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/885603ea8649d78da8ba6674b31dd289 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/88e93f0cb6b7ecfaf55472f4aade58f9 +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/8c71f2e04c07ba078f3fed661fea07ca +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/8c86ace126a96b8c90b30f12a136fa81 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/8d0a322f394a2e12a350a4caf9b2c80e +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/8fbf100e961e22baca23d1850b41e4d5 +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/9048f98bf002a866ef7831c71f7124d6 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/92ad487c49bf84126118e1ada216eb52 +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/938ed33abaeec8bfc22e533de5d92fd6 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/9780116ab7edfbe2fc71dab2b7d361f8 +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/99cfb6fcfcd8fc23cc41ccfa12576a38 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/9a13af754490df860af9928bcd00fbd3 +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/9b1a227146b80c04976c0a885c248f82 +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/9f48e8c551b5f898ca5667d92067e33d +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/a0113b5b044a3468edab999708723b3d +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/a64f702451323ab621d1836cdb352123 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/aa5c2d7aaabb3df93a734411e42a3bfc +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/abd1afcb16ba6e09d6002038d03d56b7 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/acda3fb5202cc9aefb599fd43a058105 +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/ade126a20aa1092d23cc0afaf17c164b +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/ae5d2a05a28b6aea379acad80dd0b343 +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/b02ffe2d07d7ce606d1c3a0656d82bfe +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/b13218598c5f77a5c239c023e3fff575 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/b1952fdaabef91d96f551aead4200069 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/b1d2f68953967d51ade8c6d223c2a2aa +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/b4505cc242ed408c99b7b2466d1f6099 +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/b5e993500308f32fff09cd7e0ee89efd +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/b99c09238dcefa3d795f9f7594d819b7 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/bae95ffbad9e9c33e3d4492a4b986c0b +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/baf363f79f6cd9b6a2b3688b77b58aba +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/bc2f95ead37a4ea1f050f6f21a446d7c +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/be47e0dd1cd9914997311db690cf38d7 +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/bfc8b2b4f4c3f91fdc360b426adb2d94 +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/c0a0dbfbf315a3edf26670c0f5ca7ecb +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/c11cf414168c34e88a7c152937e0041c +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/c2607067849ffce81a050a64bdf2e31b +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/c29df33a00fdc6a29f73386c3e0ae5f4 +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/c4902d10c0dbd2ef1e2edbb71c13456a +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/c79e7b418287c2b4155c8aecd24be5a7 +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/c7f7c001ba2ad5623ead9e6f2d6188e9 +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/c81b1182b5c851c35680c7acc88d4812 +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/c90e9c573e54b170859449cb2ceb3a7a +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/c981eb8fa4e3e9ae04dbf1b7b8d7f395 +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/cb1265ab418e2013b182c8deafcf897e +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/cee0dd733846ecda4ac940c6f033fb28 +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/ceebd7d45f23e34cda37b878e2af5b18 +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/d0cf471bea69c5583f5cb22f924c9d81 +0 -0
  192. data/test/dummy/tmp/cache/assets/development/sprockets/d2c37ec460e77ea6ea41bbc670889f89 +0 -0
  193. data/test/dummy/tmp/cache/assets/development/sprockets/d3347e44949d8909be6fb1d64cfb9967 +0 -0
  194. data/test/dummy/tmp/cache/assets/development/sprockets/d592f7f190f2ed0852437aeaf413ffb7 +0 -0
  195. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  196. data/test/dummy/tmp/cache/assets/development/sprockets/d9f00b466d45c065d1281b100de9311f +0 -0
  197. data/test/dummy/tmp/cache/assets/development/sprockets/dc0f4af8c3937297fe2fd3f5f4906763 +0 -0
  198. data/test/dummy/tmp/cache/assets/development/sprockets/e05ff4f8801c918dc89fef1d37880568 +0 -0
  199. data/test/dummy/tmp/cache/assets/development/sprockets/e2bae9a171482111f585b481dc2c04c8 +0 -0
  200. data/test/dummy/tmp/cache/assets/development/sprockets/e46693bc631ec8f6c63f67a75c33f785 +0 -0
  201. data/test/dummy/tmp/cache/assets/development/sprockets/e5d439d83d3f264ee47b9f82005a4eef +0 -0
  202. data/test/dummy/tmp/cache/assets/development/sprockets/e64aa4663498f985d9a5c2c65a0f2401 +0 -0
  203. data/test/dummy/tmp/cache/assets/development/sprockets/eb8ceeb4c92c6bd813a541d672206eff +0 -0
  204. data/test/dummy/tmp/cache/assets/development/sprockets/ebf2449fa00d257e175bd62b6a757bd3 +0 -0
  205. data/test/dummy/tmp/cache/assets/development/sprockets/eece52c31fc27f6dbb1d3e9dad9c6a67 +0 -0
  206. data/test/dummy/tmp/cache/assets/development/sprockets/f28711adf8b5584c6956034b86f4cbee +0 -0
  207. data/test/dummy/tmp/cache/assets/development/sprockets/f375226842bb99acc2a5a8f2396b54d3 +0 -0
  208. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  209. data/test/dummy/tmp/cache/assets/development/sprockets/f8181ea5c5ea111ed8a3f0c5c0d59ebe +0 -0
  210. data/test/dummy/tmp/cache/assets/development/sprockets/f83b6fecae01f81acf9c39e710258b98 +0 -0
  211. data/test/dummy/tmp/cache/assets/development/sprockets/fa282debca304f7fac3307d091f5ecac +0 -0
  212. data/test/dummy/tmp/cache/assets/development/sprockets/fab96f7950f4025de51c865e118904a7 +0 -0
  213. data/test/dummy/tmp/cache/assets/development/sprockets/fee8b1f906f22a2ad21ffc8f21dec56b +0 -0
  214. data/test/dummy/tmp/cache/assets/development/sprockets/ff4777d609a0a67e637cc1530d6dc7b2 +0 -0
  215. data/test/dummy/tmp/cache/assets/test/sprockets/00d7e4d5eefd54b7a2b5415b3f4f0619 +0 -0
  216. data/test/dummy/tmp/cache/assets/test/sprockets/0aa776b181456a7f52abf642461a339d +0 -0
  217. data/test/dummy/tmp/cache/assets/test/sprockets/0ad1874459c89c2b7b055fbfc086093c +0 -0
  218. data/test/dummy/tmp/cache/assets/test/sprockets/0d7923c4212365467631d19aafa9ae2c +0 -0
  219. data/test/dummy/tmp/cache/assets/test/sprockets/16bf950594dc4e49b471963acc1a15d4 +0 -0
  220. data/test/dummy/tmp/cache/assets/test/sprockets/1a3e7714b622f1753a451d9417ce2934 +0 -0
  221. data/test/dummy/tmp/cache/assets/test/sprockets/201c8ed8e16a6bad90959a270eb42af5 +0 -0
  222. data/test/dummy/tmp/cache/assets/test/sprockets/2359b362b8c593ecacced9da62d27781 +0 -0
  223. data/test/dummy/tmp/cache/assets/test/sprockets/23d4f21bc0a61aa91d818a1cbefbfa38 +0 -0
  224. data/test/dummy/tmp/cache/assets/test/sprockets/267d0243760c55e0ff8039158fbfa98d +0 -0
  225. data/test/dummy/tmp/cache/assets/test/sprockets/2b60e487f5394d3820f0d9008328de94 +0 -0
  226. data/test/dummy/tmp/cache/assets/test/sprockets/32fdb0387d5cd8aba5f0185f10ccaf6b +0 -0
  227. data/test/dummy/tmp/cache/assets/test/sprockets/373b0c58027ae58f732cc7e48e62a522 +0 -0
  228. data/test/dummy/tmp/cache/assets/test/sprockets/4d22200fb380d8ae9d5f07525088622f +0 -0
  229. data/test/dummy/tmp/cache/assets/test/sprockets/4ef303154e5471cbc5a1b7b312a5fbd3 +0 -0
  230. data/test/dummy/tmp/cache/assets/test/sprockets/50caadcf8e73c45ce4720b9a1f6f833d +0 -0
  231. data/test/dummy/tmp/cache/assets/test/sprockets/510c0a3f6fbee936a507ab77436c1713 +0 -0
  232. data/test/dummy/tmp/cache/assets/test/sprockets/54745c7a7543c4a5899cf4a7c285c505 +0 -0
  233. data/test/dummy/tmp/cache/assets/test/sprockets/5d4f24f37f52ec24be03c3ae69a710c2 +0 -0
  234. data/test/dummy/tmp/cache/assets/test/sprockets/5e3a1f4192671516ef3c5b040d3a04ec +0 -0
  235. data/test/dummy/tmp/cache/assets/test/sprockets/61883ec63e4f9e11b14de9de4ca5157c +0 -0
  236. data/test/dummy/tmp/cache/assets/test/sprockets/61a6ced52f8ef4bc0e18a0f42c45376e +0 -0
  237. data/test/dummy/tmp/cache/assets/test/sprockets/67c23683dbf4e2e805770a041018f256 +0 -0
  238. data/test/dummy/tmp/cache/assets/test/sprockets/6c9f5bc4bee5fb0d8056b4c75fafef1e +0 -0
  239. data/test/dummy/tmp/cache/assets/test/sprockets/6e4717cabfe91d260f46c4adb0acae43 +0 -0
  240. data/test/dummy/tmp/cache/assets/test/sprockets/722f2a204ab15e0261bc526aa3ea4a3d +0 -0
  241. data/test/dummy/tmp/cache/assets/test/sprockets/815e702f76d5de58787af0b2954544b4 +0 -0
  242. data/test/dummy/tmp/cache/assets/test/sprockets/8362592cdd4c1b1517d5e3fba760f0d3 +0 -0
  243. data/test/dummy/tmp/cache/assets/test/sprockets/8855c560fba1bd85e26f55568144a4d5 +0 -0
  244. data/test/dummy/tmp/cache/assets/test/sprockets/88e93f0cb6b7ecfaf55472f4aade58f9 +0 -0
  245. data/test/dummy/tmp/cache/assets/test/sprockets/8c71f2e04c07ba078f3fed661fea07ca +0 -0
  246. data/test/dummy/tmp/cache/assets/test/sprockets/8d0a322f394a2e12a350a4caf9b2c80e +0 -0
  247. data/test/dummy/tmp/cache/assets/test/sprockets/8fbf100e961e22baca23d1850b41e4d5 +0 -0
  248. data/test/dummy/tmp/cache/assets/test/sprockets/92ad487c49bf84126118e1ada216eb52 +0 -0
  249. data/test/dummy/tmp/cache/assets/test/sprockets/938ed33abaeec8bfc22e533de5d92fd6 +0 -0
  250. data/test/dummy/tmp/cache/assets/test/sprockets/9780116ab7edfbe2fc71dab2b7d361f8 +0 -0
  251. data/test/dummy/tmp/cache/assets/test/sprockets/abd1afcb16ba6e09d6002038d03d56b7 +0 -0
  252. data/test/dummy/tmp/cache/assets/test/sprockets/ade126a20aa1092d23cc0afaf17c164b +0 -0
  253. data/test/dummy/tmp/cache/assets/test/sprockets/ae5d2a05a28b6aea379acad80dd0b343 +0 -0
  254. data/test/dummy/tmp/cache/assets/test/sprockets/b13218598c5f77a5c239c023e3fff575 +0 -0
  255. data/test/dummy/tmp/cache/assets/test/sprockets/b1952fdaabef91d96f551aead4200069 +0 -0
  256. data/test/dummy/tmp/cache/assets/test/sprockets/b1d2f68953967d51ade8c6d223c2a2aa +0 -0
  257. data/test/dummy/tmp/cache/assets/test/sprockets/b4505cc242ed408c99b7b2466d1f6099 +0 -0
  258. data/test/dummy/tmp/cache/assets/test/sprockets/b99c09238dcefa3d795f9f7594d819b7 +0 -0
  259. data/test/dummy/tmp/cache/assets/test/sprockets/c11cf414168c34e88a7c152937e0041c +0 -0
  260. data/test/dummy/tmp/cache/assets/test/sprockets/c29df33a00fdc6a29f73386c3e0ae5f4 +0 -0
  261. data/test/dummy/tmp/cache/assets/test/sprockets/c90e9c573e54b170859449cb2ceb3a7a +0 -0
  262. data/test/dummy/tmp/cache/assets/test/sprockets/d2c37ec460e77ea6ea41bbc670889f89 +0 -0
  263. data/test/dummy/tmp/cache/assets/test/sprockets/d592f7f190f2ed0852437aeaf413ffb7 +0 -0
  264. data/test/dummy/tmp/cache/assets/test/sprockets/d9f00b466d45c065d1281b100de9311f +0 -0
  265. data/test/dummy/tmp/cache/assets/test/sprockets/e05ff4f8801c918dc89fef1d37880568 +0 -0
  266. data/test/dummy/tmp/cache/assets/test/sprockets/e46693bc631ec8f6c63f67a75c33f785 +0 -0
  267. data/test/dummy/tmp/cache/assets/test/sprockets/e5d439d83d3f264ee47b9f82005a4eef +0 -0
  268. data/test/dummy/tmp/cache/assets/test/sprockets/eb8ceeb4c92c6bd813a541d672206eff +0 -0
  269. data/test/dummy/tmp/cache/assets/test/sprockets/f8181ea5c5ea111ed8a3f0c5c0d59ebe +0 -0
  270. data/test/dummy/tmp/cache/assets/test/sprockets/fee8b1f906f22a2ad21ffc8f21dec56b +0 -0
  271. data/test/functional/failures_controller_test.rb +73 -0
  272. data/test/functional/overview_controller_test.rb +7 -0
  273. data/test/functional/queues_controller_test.rb +20 -0
  274. data/test/functional/stats_controller_test.rb +7 -0
  275. data/test/functional/workers_controller_test.rb +7 -0
  276. data/test/functional/working_controller_test.rb +7 -0
  277. data/test/test_helper.rb +23 -0
  278. data/test/unit/helpers/failures_helper_test.rb +4 -0
  279. data/test/unit/helpers/jobs_helper_test.rb +4 -0
  280. data/test/unit/helpers/overview_helper_test.rb +4 -0
  281. data/test/unit/helpers/queues_helper_test.rb +4 -0
  282. data/test/unit/helpers/retry_controller_helper_test.rb +4 -0
  283. data/test/unit/helpers/stats_helper_test.rb +4 -0
  284. data/test/unit/helpers/workers_helper_test.rb +4 -0
  285. data/test/unit/helpers/working_helper_test.rb +4 -0
  286. metadata +632 -0
@@ -0,0 +1,7 @@
1
+ module ResqueWeb
2
+ class OverviewController < ApplicationController
3
+ def show
4
+ render :layout => !request.xhr?, :locals => { :polling => request.xhr? }
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ module ResqueWeb
2
+ class QueuesController < ApplicationController
3
+ def show
4
+ set_subtabs view_context.queue_names
5
+ end
6
+
7
+ def destroy
8
+ Resque.remove_queue(params[:id])
9
+ redirect_to queues_path
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ module ResqueWeb
2
+ class StatsController < ApplicationController
3
+ subtabs :resque, :redis, :keys
4
+
5
+ def index
6
+ redirect_to :action => 'resque'
7
+ end
8
+
9
+ def keys
10
+ if params[:id]
11
+ render 'key'
12
+ else
13
+ render 'keys'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module ResqueWeb
2
+ class WorkersController < ApplicationController
3
+ before_filter :display_subtabs
4
+
5
+ def show
6
+ if params[:id] && params[:id] != 'all'
7
+ @workers = view_context.worker_hosts[params[:id]].map { |id| Resque::Worker.find(id) }
8
+ else
9
+ @workers = Resque.workers
10
+ end
11
+ end
12
+
13
+ def display_subtabs
14
+ set_subtabs view_context.worker_hosts.map(&:first)
15
+ end
16
+ private :display_subtabs
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module ResqueWeb
2
+ class WorkingController < ApplicationController
3
+ end
4
+ end
@@ -0,0 +1,65 @@
1
+ module ResqueWeb
2
+ module ApplicationHelper
3
+
4
+ PER_PAGE = 20
5
+
6
+ def tabs
7
+ {'overview' => overview_path,
8
+ 'working' => working_index_path,
9
+ 'failures' => failures_path,
10
+ 'queues' => queues_path,
11
+ 'workers' => workers_path,
12
+ 'stats' => stats_path
13
+ }
14
+ end
15
+
16
+ def tab(name,path)
17
+ content_tag :li, link_to(name.capitalize, path), :class => current_tab?(name) ? "active" : nil
18
+ end
19
+
20
+ def current_tab
21
+ params[:controller].gsub(/resque_web\//, "#{root_path}")
22
+ end
23
+
24
+ def current_tab?(name)
25
+ params[:controller] == name.to_s
26
+ end
27
+
28
+ attr_reader :subtabs
29
+
30
+ def subtab(name)
31
+ content_tag :li, link_to(name, "#{current_tab}/#{name}"), :class => current_subtab?(name) ? "current" : nil
32
+ end
33
+
34
+ def current_subtab?(name)
35
+ params[:id] == name.to_s
36
+ end
37
+
38
+ def pagination(options = {})
39
+ start = options[:start] || 1
40
+ per_page = options[:per_page] || PER_PAGE
41
+ total = options[:total] || 0
42
+ return if total < per_page
43
+
44
+ markup = ""
45
+ if start - per_page >= 0
46
+ markup << link_to(raw("&laquo; less"), params.merge(:start => start - per_page), :class => 'btn less')
47
+ end
48
+
49
+ if start + per_page <= total
50
+ markup << link_to(raw("more &raquo;"), params.merge(:start => start + per_page), :class => 'btn more')
51
+ end
52
+
53
+ content_tag :p, raw(markup), :class => 'pagination'
54
+ end
55
+
56
+ def poll(polling=false)
57
+ if polling
58
+ text = "Last Updated: #{Time.now.strftime("%H:%M:%S")}".html_safe
59
+ else
60
+ text = "<a href='#{h(request.path)}' rel='poll'>Live Poll</a>".html_safe
61
+ end
62
+ content_tag :p, text, :class => 'poll'
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,54 @@
1
+ module ResqueWeb
2
+ module FailuresHelper
3
+ def each_failure(&block)
4
+ Resque::Failure.each(failure_start_at, failure_per_page, params[:queue], params[:class], &block)
5
+ end
6
+
7
+ def failure_date_format
8
+ "%Y/%m/%d %T %z"
9
+ end
10
+
11
+ def multiple_failure_queues?
12
+ @multiple_failure_queues ||= Resque::Failure.queues.size > 1
13
+ end
14
+
15
+ def failure_queue
16
+ multiple_failure_queues? ? params[:id] : 'failed'
17
+ end
18
+
19
+ def failure_size
20
+ @failure_size ||= Resque::Failure.count(params[:id], params[:class])
21
+ end
22
+
23
+ def failure_per_page
24
+ @failures_per_page ||= params[:class] ? failure_size : 20
25
+ end
26
+
27
+ def failure_start_at
28
+ params[:start].to_i
29
+ end
30
+
31
+ def failure_end_at
32
+ if failure_start_at + failure_per_page > failure_size
33
+ failure_size
34
+ else
35
+ failure_start_at + failure_per_page
36
+ end
37
+ end
38
+
39
+ def failure_class_counts(queue = params[:id])
40
+ classes = Hash.new(0)
41
+ Resque::Failure.each(0, Resque::Failure.count(queue), queue) do |_, item|
42
+ class_name = item['payload']['class'] if item['payload']
43
+ class_name ||= "nil"
44
+ classes[class_name] += 1
45
+ end
46
+ classes.sort_by { |name,_| name }
47
+ end
48
+
49
+ def job_arguments(job)
50
+ return 'nil' unless job['payload']
51
+ Array(job['payload']['args']).map { |arg| arg.inspect }.join("\n")
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,6 @@
1
+ module ResqueWeb
2
+ module OverviewHelper
3
+ include QueuesHelper
4
+ include WorkingHelper
5
+ end
6
+ end
@@ -0,0 +1,72 @@
1
+ require 'resque/failure/redis_multi_queue'
2
+
3
+ module ResqueWeb
4
+ module QueuesHelper
5
+ def queues_partial_name
6
+ if Resque::Failure.backend == Resque::Failure::RedisMultiQueue
7
+ 'resque_web/queues/queues_advanced'
8
+ else
9
+ 'resque_web/queues/queues_basic'
10
+ end
11
+ end
12
+
13
+ def queue_names
14
+ Resque.queues.sort_by(&:to_s)
15
+ end
16
+
17
+ def queue_start_at
18
+ params[:start].to_i
19
+ end
20
+
21
+ def queue_end_at
22
+ if queue_start_at + queue_per_page > queue_size
23
+ queue_size
24
+ else
25
+ queue_start_at + queue_per_page
26
+ end
27
+ end
28
+
29
+ def queue_per_page
30
+ 20
31
+ end
32
+
33
+ def queue_size(queue_name = params[:id])
34
+ Resque.size queue_name
35
+ end
36
+
37
+ def queue_jobs
38
+ @queue_jobs ||= Resque.peek(params[:id], queue_start_at, queue_per_page)
39
+ end
40
+
41
+ def failed_queue_names
42
+ Resque::Failure.queues.sort_by(&:to_s)
43
+ end
44
+
45
+ def failed_queue_name(original_queue_name)
46
+ "#{original_queue_name}_failed"
47
+ end
48
+
49
+ def failed_queue_class(queue_name)
50
+ Resque::Failure.count(queue_name).zero? ? "failed" : "failure"
51
+ end
52
+
53
+ def failed_queue_size(queue_name)
54
+ Resque::Failure.count(queue_name)
55
+ end
56
+
57
+ def failed_queue_info(queue_name)
58
+ failed_queue = failed_queue_name(queue_name)
59
+ size = failed_queue_size(failed_queue)
60
+
61
+ if size > 0
62
+ css_class = "badge badge-important"
63
+ badge = link_to(size, failure_path(failed_queue))
64
+ else
65
+ css_class = "badge"
66
+ badge = size.to_s
67
+ end
68
+
69
+ raw "<span class=\"#{css_class}\">#{badge}</span>"
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,54 @@
1
+ module ResqueWeb
2
+ module StatsHelper
3
+ def resque_info
4
+ Resque.info.sort_by { |i| i[0].to_s }
5
+ end
6
+
7
+ def redis_info
8
+ Resque.redis.info.to_a.sort_by { |i| i[0].to_s }
9
+ end
10
+
11
+ def redis_key_type(key)
12
+ Resque.redis.type(key)
13
+ end
14
+
15
+ def redis_key_size(key)
16
+ # FIXME: there's a potential race in this method if a key is modified
17
+ # "in flight". Not sure how to fix it, unfortunately :(
18
+ case redis_key_type(key)
19
+ when 'none'
20
+ 0
21
+ when 'list'
22
+ Resque.redis.llen(key)
23
+ when 'set'
24
+ Resque.redis.scard(key)
25
+ when 'string'
26
+ string = Resque.redis.get(key)
27
+ string ? string.length : 0
28
+ when 'zset'
29
+ Resque.redis.zcard(key)
30
+ end
31
+ end
32
+
33
+ def redis_get_array(key, start=0)
34
+ case redis_key_type(key)
35
+ when 'none'
36
+ []
37
+ when 'list'
38
+ Resque.redis.lrange(key, start, start + 20)
39
+ when 'set'
40
+ Resque.redis.smembers(key)[start..(start + 20)]
41
+ when 'string'
42
+ [Resque.redis.get(key)]
43
+ when 'zset'
44
+ Resque.redis.zrange(key, start, start + 20)
45
+ when 'hash'
46
+ Resque.redis.hgetall(key)
47
+ end
48
+ end
49
+
50
+ def current_subtab?(name)
51
+ params[:action] == name.to_s
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,16 @@
1
+ module ResqueWeb
2
+ module WorkersHelper
3
+ def worker_hosts
4
+ @worker_hosts ||= begin
5
+ hosts = Hash.new { [] }
6
+
7
+ Resque.workers.each do |worker|
8
+ host, _ = worker.to_s.split(':')
9
+ hosts[host] += [worker.to_s]
10
+ end
11
+
12
+ hosts
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ module ResqueWeb
2
+ module WorkingHelper
3
+ def workers
4
+ @workers ||= Resque.workers
5
+ end
6
+
7
+ def jobs
8
+ @jobs ||= workers.map(&:job)
9
+ end
10
+
11
+ def worker_jobs
12
+ @worker_jobs ||= workers.zip(jobs).reject { |w, j| w.idle? || j['queue'].nil? }
13
+ end
14
+
15
+ def sorted_worker_jobs
16
+ @sorted_worker_jobs ||= worker_jobs.sort_by { |w, j| j['run_at'] || '' }
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <meta name="description" content="">
7
+ <meta name="viewport" content="width=device-width">
8
+ <title>Resque.</title>
9
+ <%= stylesheet_link_tag "resque_web/application", :media => "all" %>
10
+ <%= javascript_include_tag "resque_web/application" %>
11
+ <%= csrf_meta_tags %>
12
+ </head>
13
+ <body>
14
+
15
+ <div class="navbar navbar-inverse navbar-fixed-top">
16
+ <div class="navbar-inner">
17
+ <div class="container">
18
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
19
+ <span class="icon-bar"></span>
20
+ <span class="icon-bar"></span>
21
+ <span class="icon-bar"></span>
22
+ </a>
23
+ <img src="/assets/resque_web/lifebuoy.png" alt="" class="logo">
24
+ <%= link_to "Resque.", root_path, :class => "brand" %>
25
+ <div class="nav-collapse collapse">
26
+ <ul class="nav">
27
+ <% tabs.each do |tab_name,path| %>
28
+ <%= tab tab_name,path %>
29
+ <% end %>
30
+ </ul>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+ <% unless subtabs.empty? %>
37
+ <ul class="nav subnav">
38
+ <div class="container">
39
+ <% subtabs.each do |tab_name| %>
40
+ <%= subtab tab_name %>
41
+ <% end %>
42
+ </div>
43
+ </ul>
44
+ <% end %>
45
+
46
+ <div class="container" id="main">
47
+ <%= yield %>
48
+ </div>
49
+
50
+ <footer id="footer">
51
+ <div class="container">
52
+ <p>Powered by <a href="http://github.com/resque/resque">Resque</a> v<%=Resque::Version%></p>
53
+ <p>Connected to Redis namespace <%= Resque.redis.namespace %> on <%=Resque.redis_id%></p>
54
+ </div>
55
+ </footer>
56
+
57
+ </body>
58
+ </html>
@@ -0,0 +1,53 @@
1
+ <li>
2
+ <dl>
3
+ <% if job.nil? %>
4
+ <dt>Error</dt>
5
+ <dd>Job <%= id %> could not be parsed; perhaps it contains invalid JSON?</dd>
6
+ <% else %>
7
+ <dt>Worker</dt>
8
+ <dd>
9
+ <%= job['worker'].split(':')[0...2].join(':') %>
10
+ on <b class="label label-info"><%= job['queue'] %></b >
11
+ at <b><span class="time"><%= Time.parse(job['failed_at']).strftime(failure_date_format) %></span></b>
12
+
13
+ <% if job['retried_at'] %>
14
+ <div class="retried">
15
+ Retried <b><span class="time"><%= Time.parse(job['retried_at']).strftime(failure_date_format) %></span></b>
16
+ <%= link_to "Remove", failure_path(:queue=>failure_queue,:id=>id), :method => :delete, :class => 'remove', :rel => 'remove' %>
17
+ </div>
18
+ <% else %>
19
+ <div class="controls">
20
+ <%= link_to "Retry", retry_failure_path(:queue=>failure_queue,:id=>id), :method => :put %>
21
+ or
22
+ <%= link_to "Remove", failure_path(:queue=>failure_queue,:id=>id), :method => :delete %>
23
+ </div>
24
+ <% end %>
25
+ </dd>
26
+ <dt>Class</dt>
27
+ <dd>
28
+ <% if job['payload'] && job['payload']['class'] %>
29
+ <%= link_to failures_path(:class=>job['payload']['class'],:queue=>params[:queue]) do %>
30
+ <code><%= job['payload']['class'] %></code>
31
+ <% end %>
32
+ <% else %>
33
+ <code>nil</code>
34
+ <% end %>
35
+ </dd>
36
+ <dt>Arguments</dt>
37
+ <dd><pre><%= job_arguments(job) %></pre></dd>
38
+ <dt>Exception</dt>
39
+ <dd><code><%= job['exception'] %></code></dd>
40
+ <dt>Error</dt>
41
+ <dd class="error">
42
+ <% if job['backtrace'] %>
43
+ <a href="#" class="backtrace"><%= job['error'] %></a>
44
+ <pre style='display:none'><%=h job['backtrace'].join("\n") %></pre>
45
+ <% else %>
46
+ <%=h job['error'] %>
47
+ <% end %>
48
+ </dd>
49
+ <% end %>
50
+ </dl>
51
+ <div class="r">
52
+ </div>
53
+ </li>