rq 0.1.7 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (723) hide show
  1. data/INSTALL +21 -0
  2. data/README +752 -190
  3. data/TODO +18 -11
  4. data/TUTORIAL +230 -0
  5. data/all/install.rb +127 -0
  6. data/all/install.sh +165 -0
  7. data/all/packages/INSTALL +5 -0
  8. data/all/packages/arrayfields-3.6.0.tgz +0 -0
  9. data/all/packages/lockfile-1.4.1.tgz +0 -0
  10. data/all/packages/posixlock-0.0.1.tgz +0 -0
  11. data/all/packages/ruby-1.8.6.tgz +0 -0
  12. data/all/packages/rubygems-0.9.2.tgz +0 -0
  13. data/all/packages/sqlite-2.8.15.tar.gz +0 -0
  14. data/all/packages/sqlite-ruby-1.3.1.tar.gz +0 -0
  15. data/bin/rq +830 -361
  16. data/bin/rq-3.0.0 +860 -0
  17. data/doc/classes/ARGV.html +134 -0
  18. data/doc/classes/ARGV.src/M000036.html +36 -0
  19. data/doc/classes/ARGV.src/M000037.html +25 -0
  20. data/doc/classes/OrderedHash.html +1043 -0
  21. data/doc/classes/OrderedHash.src/M000003.html +26 -0
  22. data/doc/classes/OrderedHash.src/M000004.html +31 -0
  23. data/doc/classes/OrderedHash.src/M000005.html +23 -0
  24. data/doc/classes/OrderedHash.src/M000006.html +23 -0
  25. data/doc/classes/OrderedHash.src/M000007.html +24 -0
  26. data/doc/classes/OrderedHash.src/M000009.html +24 -0
  27. data/doc/classes/OrderedHash.src/M000010.html +24 -0
  28. data/doc/classes/OrderedHash.src/M000011.html +24 -0
  29. data/doc/classes/OrderedHash.src/M000012.html +24 -0
  30. data/doc/classes/OrderedHash.src/M000013.html +24 -0
  31. data/doc/classes/OrderedHash.src/M000014.html +24 -0
  32. data/doc/classes/OrderedHash.src/M000016.html +26 -0
  33. data/doc/classes/OrderedHash.src/M000017.html +25 -0
  34. data/doc/classes/OrderedHash.src/M000018.html +23 -0
  35. data/doc/classes/OrderedHash.src/M000019.html +25 -0
  36. data/doc/classes/OrderedHash.src/M000020.html +23 -0
  37. data/doc/classes/OrderedHash.src/M000021.html +24 -0
  38. data/doc/classes/OrderedHash.src/M000022.html +24 -0
  39. data/doc/classes/OrderedHash.src/M000023.html +24 -0
  40. data/doc/classes/OrderedHash.src/M000024.html +29 -0
  41. data/doc/classes/OrderedHash.src/M000025.html +29 -0
  42. data/doc/classes/OrderedHash.src/M000026.html +24 -0
  43. data/doc/classes/OrderedHash.src/M000027.html +25 -0
  44. data/doc/classes/OrderedHash.src/M000028.html +23 -0
  45. data/doc/classes/OrderedHash.src/M000029.html +25 -0
  46. data/doc/classes/OrderedHash.src/M000030.html +24 -0
  47. data/doc/classes/OrderedHash.src/M000032.html +23 -0
  48. data/doc/classes/OrderedHash.src/M000033.html +25 -0
  49. data/doc/classes/OrderedHash.src/M000034.html +36 -0
  50. data/doc/classes/OrderedHash.src/M000035.html +23 -0
  51. data/doc/classes/RQ.html +647 -0
  52. data/doc/classes/RQ/Backer.html +240 -0
  53. data/doc/classes/RQ/Backer.src/M000121.html +31 -0
  54. data/doc/classes/RQ/ConfigFile.html +416 -0
  55. data/doc/classes/RQ/ConfigFile.src/M000100.html +34 -0
  56. data/doc/classes/RQ/ConfigFile.src/M000101.html +26 -0
  57. data/doc/classes/RQ/ConfigFile.src/M000102.html +33 -0
  58. data/doc/classes/RQ/ConfigFile.src/M000103.html +25 -0
  59. data/doc/classes/RQ/ConfigFile.src/M000104.html +34 -0
  60. data/doc/classes/RQ/ConfigFile.src/M000105.html +25 -0
  61. data/doc/classes/RQ/Configurator.html +249 -0
  62. data/doc/classes/RQ/Configurator.src/M000122.html +40 -0
  63. data/doc/classes/RQ/Creator.html +264 -0
  64. data/doc/classes/RQ/Creator.src/M000157.html +32 -0
  65. data/doc/classes/RQ/Cron.html +461 -0
  66. data/doc/classes/RQ/Deleter.html +259 -0
  67. data/doc/classes/RQ/Deleter.src/M000078.html +52 -0
  68. data/doc/classes/RQ/Executor.html +249 -0
  69. data/doc/classes/RQ/Executor.src/M000099.html +45 -0
  70. data/doc/classes/RQ/Feeder.html +1131 -0
  71. data/doc/classes/RQ/Feeder.src/M000079.html +67 -0
  72. data/doc/classes/RQ/Feeder.src/M000080.html +47 -0
  73. data/doc/classes/RQ/Feeder.src/M000081.html +98 -0
  74. data/doc/classes/RQ/Feeder.src/M000082.html +25 -0
  75. data/doc/classes/RQ/Feeder.src/M000083.html +30 -0
  76. data/doc/classes/RQ/Feeder.src/M000084.html +58 -0
  77. data/doc/classes/RQ/Feeder.src/M000085.html +37 -0
  78. data/doc/classes/RQ/Feeder.src/M000086.html +40 -0
  79. data/doc/classes/RQ/Feeder.src/M000087.html +37 -0
  80. data/doc/classes/RQ/Feeder.src/M000088.html +35 -0
  81. data/doc/classes/RQ/Feeder.src/M000089.html +47 -0
  82. data/doc/classes/RQ/Feeder.src/M000090.html +25 -0
  83. data/doc/classes/RQ/Feeder.src/M000091.html +78 -0
  84. data/doc/classes/RQ/Feeder.src/M000092.html +34 -0
  85. data/doc/classes/RQ/Feeder.src/M000093.html +36 -0
  86. data/doc/classes/RQ/Feeder.src/M000094.html +25 -0
  87. data/doc/classes/RQ/Feeder.src/M000095.html +27 -0
  88. data/doc/classes/RQ/IOViewer.html +256 -0
  89. data/doc/classes/RQ/Job.html +304 -0
  90. data/doc/classes/RQ/Job.src/M000168.html +26 -0
  91. data/doc/classes/RQ/Job.src/M000169.html +37 -0
  92. data/doc/classes/RQ/Job.src/M000170.html +23 -0
  93. data/doc/classes/RQ/Job/Methods.html +210 -0
  94. data/doc/classes/RQ/JobQueue.html +1780 -0
  95. data/doc/classes/RQ/JobQueue.src/M000176.html +31 -0
  96. data/doc/classes/RQ/JobQueue.src/M000177.html +34 -0
  97. data/doc/classes/RQ/JobQueue.src/M000178.html +60 -0
  98. data/doc/classes/RQ/JobQueue.src/M000179.html +63 -0
  99. data/doc/classes/RQ/JobQueue.src/M000180.html +73 -0
  100. data/doc/classes/RQ/JobQueue.src/M000181.html +217 -0
  101. data/doc/classes/RQ/JobQueue.src/M000182.html +50 -0
  102. data/doc/classes/RQ/JobQueue.src/M000183.html +83 -0
  103. data/doc/classes/RQ/JobQueue.src/M000184.html +25 -0
  104. data/doc/classes/RQ/JobQueue.src/M000185.html +83 -0
  105. data/doc/classes/RQ/JobQueue.src/M000186.html +28 -0
  106. data/doc/classes/RQ/JobQueue.src/M000187.html +26 -0
  107. data/doc/classes/RQ/JobQueue.src/M000188.html +26 -0
  108. data/doc/classes/RQ/JobQueue.src/M000189.html +32 -0
  109. data/doc/classes/RQ/JobQueue.src/M000190.html +30 -0
  110. data/doc/classes/RQ/JobQueue.src/M000191.html +37 -0
  111. data/doc/classes/RQ/JobQueue.src/M000192.html +36 -0
  112. data/doc/classes/RQ/JobQueue.src/M000193.html +25 -0
  113. data/doc/classes/RQ/JobQueue.src/M000194.html +25 -0
  114. data/doc/classes/RQ/JobQueue.src/M000195.html +25 -0
  115. data/doc/classes/RQ/JobQueue.src/M000196.html +25 -0
  116. data/doc/classes/RQ/JobQueue.src/M000197.html +25 -0
  117. data/doc/classes/RQ/JobQueue.src/M000198.html +73 -0
  118. data/doc/classes/RQ/JobQueue.src/M000199.html +25 -0
  119. data/doc/classes/RQ/JobQueue.src/M000200.html +38 -0
  120. data/doc/classes/RQ/JobQueue.src/M000201.html +28 -0
  121. data/doc/classes/RQ/JobQueue/Error.html +187 -0
  122. data/doc/classes/RQ/JobRunner.html +386 -0
  123. data/doc/classes/RQ/JobRunner.src/M000117.html +53 -0
  124. data/doc/classes/RQ/JobRunner.src/M000118.html +26 -0
  125. data/doc/classes/RQ/JobRunnerDaemon.html +590 -0
  126. data/doc/classes/RQ/JobRunnerDaemon.src/M000159.html +94 -0
  127. data/doc/classes/RQ/JobRunnerDaemon.src/M000160.html +27 -0
  128. data/doc/classes/RQ/JobRunnerDaemon.src/M000161.html +39 -0
  129. data/doc/classes/RQ/JobRunnerDaemon.src/M000162.html +27 -0
  130. data/doc/classes/RQ/JobRunnerDaemon.src/M000163.html +27 -0
  131. data/doc/classes/RQ/JobRunnerDaemon.src/M000164.html +28 -0
  132. data/doc/classes/RQ/JobRunnerDaemon.src/M000165.html +28 -0
  133. data/doc/classes/RQ/JobRunnerDaemon.src/M000166.html +37 -0
  134. data/doc/classes/RQ/JobRunnerDaemon.src/M000167.html +25 -0
  135. data/doc/classes/RQ/Lister.html +256 -0
  136. data/doc/classes/RQ/Lister.src/M000156.html +52 -0
  137. data/doc/classes/RQ/Locker.html +250 -0
  138. data/doc/classes/RQ/Locker.src/M000120.html +40 -0
  139. data/doc/classes/RQ/Logging.html +296 -0
  140. data/doc/classes/RQ/Logging.src/M000067.html +28 -0
  141. data/doc/classes/RQ/Logging/LogClassMethods.html +254 -0
  142. data/doc/classes/RQ/Logging/LogClassMethods.src/M000068.html +32 -0
  143. data/doc/classes/RQ/Logging/LogClassMethods.src/M000069.html +28 -0
  144. data/doc/classes/RQ/Logging/LogMethods.html +404 -0
  145. data/doc/classes/RQ/Logging/LogMethods.src/M000070.html +35 -0
  146. data/doc/classes/RQ/Logging/LogMethods.src/M000071.html +28 -0
  147. data/doc/classes/RQ/Logging/LogMethods.src/M000072.html +21 -0
  148. data/doc/classes/RQ/Logging/LogMethods.src/M000073.html +21 -0
  149. data/doc/classes/RQ/Logging/LogMethods.src/M000074.html +21 -0
  150. data/doc/classes/RQ/Logging/LogMethods.src/M000075.html +21 -0
  151. data/doc/classes/RQ/Logging/LogMethods.src/M000076.html +21 -0
  152. data/doc/classes/RQ/Logging/LogMethods.src/M000077.html +29 -0
  153. data/doc/classes/RQ/Logging/LoggerExt.html +194 -0
  154. data/doc/classes/RQ/Main.html +2110 -0
  155. data/doc/classes/RQ/MainHelper.html +607 -0
  156. data/doc/classes/RQ/MainHelper.src/M000171.html +33 -0
  157. data/doc/classes/RQ/MainHelper.src/M000172.html +32 -0
  158. data/doc/classes/RQ/MainHelper.src/M000173.html +44 -0
  159. data/doc/classes/RQ/OrderedAutoHash.html +258 -0
  160. data/doc/classes/RQ/OrderedAutoHash.src/M000205.html +25 -0
  161. data/doc/classes/RQ/OrderedAutoHash.src/M000206.html +25 -0
  162. data/doc/classes/RQ/QDB.html +1653 -0
  163. data/doc/classes/RQ/QDB.src/M000126.html +25 -0
  164. data/doc/classes/RQ/QDB.src/M000127.html +37 -0
  165. data/doc/classes/RQ/QDB.src/M000128.html +27 -0
  166. data/doc/classes/RQ/QDB.src/M000129.html +27 -0
  167. data/doc/classes/RQ/QDB.src/M000130.html +27 -0
  168. data/doc/classes/RQ/QDB.src/M000131.html +31 -0
  169. data/doc/classes/RQ/QDB.src/M000132.html +32 -0
  170. data/doc/classes/RQ/QDB.src/M000133.html +30 -0
  171. data/doc/classes/RQ/QDB.src/M000134.html +91 -0
  172. data/doc/classes/RQ/QDB.src/M000135.html +26 -0
  173. data/doc/classes/RQ/QDB.src/M000136.html +46 -0
  174. data/doc/classes/RQ/QDB.src/M000137.html +26 -0
  175. data/doc/classes/RQ/QDB.src/M000138.html +51 -0
  176. data/doc/classes/RQ/QDB.src/M000139.html +61 -0
  177. data/doc/classes/RQ/QDB.src/M000140.html +57 -0
  178. data/doc/classes/RQ/QDB.src/M000141.html +25 -0
  179. data/doc/classes/RQ/QDB.src/M000142.html +25 -0
  180. data/doc/classes/RQ/QDB.src/M000143.html +37 -0
  181. data/doc/classes/RQ/QDB.src/M000144.html +107 -0
  182. data/doc/classes/RQ/QDB.src/M000145.html +40 -0
  183. data/doc/classes/RQ/QDB.src/M000146.html +34 -0
  184. data/doc/classes/RQ/QDB.src/M000147.html +33 -0
  185. data/doc/classes/RQ/QDB.src/M000148.html +32 -0
  186. data/doc/classes/RQ/QDB.src/M000149.html +98 -0
  187. data/doc/classes/RQ/QDB.src/M000150.html +26 -0
  188. data/doc/classes/RQ/QDB.src/M000151.html +31 -0
  189. data/doc/classes/RQ/QDB.src/M000154.html +26 -0
  190. data/doc/classes/RQ/QDB/AbortedTransactionError.html +187 -0
  191. data/doc/classes/RQ/QDB/RollbackTransactionError.html +187 -0
  192. data/doc/classes/RQ/Querier.html +328 -0
  193. data/doc/classes/RQ/Querier.src/M000203.html +45 -0
  194. data/doc/classes/RQ/Querier.src/M000204.html +78 -0
  195. data/doc/classes/RQ/ReSubmitter.html +307 -0
  196. data/doc/classes/RQ/ReSubmitter.src/M000098.html +111 -0
  197. data/doc/classes/RQ/Recoverer.html +247 -0
  198. data/doc/classes/RQ/Refresher.html +346 -0
  199. data/doc/classes/RQ/Refresher.src/M000174.html +51 -0
  200. data/doc/classes/RQ/Refresher.src/M000175.html +44 -0
  201. data/doc/classes/RQ/Relayer.html +723 -0
  202. data/doc/classes/RQ/Relayer.src/M000106.html +91 -0
  203. data/doc/classes/RQ/Relayer.src/M000107.html +47 -0
  204. data/doc/classes/RQ/Relayer.src/M000108.html +46 -0
  205. data/doc/classes/RQ/Relayer.src/M000109.html +26 -0
  206. data/doc/classes/RQ/Relayer.src/M000110.html +46 -0
  207. data/doc/classes/RQ/Relayer.src/M000111.html +40 -0
  208. data/doc/classes/RQ/Relayer.src/M000112.html +37 -0
  209. data/doc/classes/RQ/Relayer.src/M000113.html +40 -0
  210. data/doc/classes/RQ/Relayer.src/M000114.html +27 -0
  211. data/doc/classes/RQ/Relayer.src/M000115.html +25 -0
  212. data/doc/classes/RQ/Relayer.src/M000116.html +38 -0
  213. data/doc/classes/RQ/Resource.html +187 -0
  214. data/doc/classes/RQ/ResourceManager.html +276 -0
  215. data/doc/classes/RQ/Rotater.html +324 -0
  216. data/doc/classes/RQ/Rotater.src/M000158.html +71 -0
  217. data/doc/classes/RQ/SleepCycle.html +322 -0
  218. data/doc/classes/RQ/SleepCycle.src/M000123.html +32 -0
  219. data/doc/classes/RQ/SleepCycle.src/M000124.html +27 -0
  220. data/doc/classes/RQ/SleepCycle.src/M000125.html +25 -0
  221. data/doc/classes/RQ/Snapshotter.html +250 -0
  222. data/doc/classes/RQ/Snapshotter.src/M000097.html +35 -0
  223. data/doc/classes/RQ/StatusLister.html +289 -0
  224. data/doc/classes/RQ/StatusLister.src/M000096.html +26 -0
  225. data/doc/classes/RQ/Submitter.html +319 -0
  226. data/doc/classes/RQ/Submitter.src/M000119.html +92 -0
  227. data/doc/classes/RQ/Toucher.html +384 -0
  228. data/doc/classes/RQ/Updater.html +304 -0
  229. data/doc/classes/RQ/Updater.src/M000202.html +97 -0
  230. data/doc/classes/RQ/Usage.html +346 -0
  231. data/doc/classes/RQ/Usage.src/M000038.html +29 -0
  232. data/doc/classes/RQ/Usage.src/M000039.html +72 -0
  233. data/doc/classes/RQ/Util.html +1043 -0
  234. data/doc/classes/RQ/Util.src/M000040.html +27 -0
  235. data/doc/classes/RQ/Util.src/M000041.html +26 -0
  236. data/doc/classes/RQ/Util.src/M000042.html +25 -0
  237. data/doc/classes/RQ/Util.src/M000043.html +25 -0
  238. data/doc/classes/RQ/Util.src/M000044.html +30 -0
  239. data/doc/classes/RQ/Util.src/M000045.html +25 -0
  240. data/doc/classes/RQ/Util.src/M000046.html +34 -0
  241. data/doc/classes/RQ/Util.src/M000047.html +31 -0
  242. data/doc/classes/RQ/Util.src/M000048.html +41 -0
  243. data/doc/classes/RQ/Util.src/M000049.html +27 -0
  244. data/doc/classes/RQ/Util.src/M000050.html +34 -0
  245. data/doc/classes/RQ/Util.src/M000051.html +28 -0
  246. data/doc/classes/RQ/Util.src/M000052.html +27 -0
  247. data/doc/classes/RQ/Util.src/M000053.html +31 -0
  248. data/doc/classes/RQ/Util.src/M000054.html +31 -0
  249. data/doc/classes/RQ/Util.src/M000055.html +31 -0
  250. data/doc/classes/RQ/Util.src/M000056.html +25 -0
  251. data/doc/classes/RQ/Util.src/M000057.html +25 -0
  252. data/doc/classes/RQ/Util.src/M000058.html +25 -0
  253. data/doc/classes/RQ/Util.src/M000059.html +25 -0
  254. data/doc/classes/RQ/Util.src/M000060.html +25 -0
  255. data/doc/classes/RQ/Util.src/M000061.html +27 -0
  256. data/doc/classes/RQ/Util.src/M000062.html +28 -0
  257. data/doc/classes/RQ/Util.src/M000063.html +39 -0
  258. data/doc/classes/RQ/Util.src/M000064.html +39 -0
  259. data/doc/classes/RQ/Util.src/M000065.html +31 -0
  260. data/doc/classes/RQ/Util.src/M000066.html +29 -0
  261. data/doc/classes/SQLite.html +120 -0
  262. data/doc/classes/SQLite/Database.html +546 -0
  263. data/doc/classes/SQLite/TypeTranslator.html +221 -0
  264. data/doc/created.rid +1 -0
  265. data/doc/dot/f_0.dot +14 -0
  266. data/doc/dot/f_0.jpg +0 -0
  267. data/doc/dot/f_1.dot +14 -0
  268. data/doc/dot/f_1.jpg +0 -0
  269. data/doc/dot/f_10.dot +802 -0
  270. data/doc/dot/f_10.jpg +0 -0
  271. data/doc/dot/f_11.dot +14 -0
  272. data/doc/dot/f_11.jpg +0 -0
  273. data/doc/dot/f_12.dot +802 -0
  274. data/doc/dot/f_12.jpg +0 -0
  275. data/doc/dot/f_13.dot +802 -0
  276. data/doc/dot/f_13.jpg +0 -0
  277. data/doc/dot/f_14.dot +802 -0
  278. data/doc/dot/f_14.jpg +0 -0
  279. data/doc/dot/f_15.dot +802 -0
  280. data/doc/dot/f_15.jpg +0 -0
  281. data/doc/dot/f_16.dot +802 -0
  282. data/doc/dot/f_16.jpg +0 -0
  283. data/doc/dot/f_17.dot +802 -0
  284. data/doc/dot/f_17.jpg +0 -0
  285. data/doc/dot/f_18.dot +14 -0
  286. data/doc/dot/f_18.jpg +0 -0
  287. data/doc/dot/f_19.dot +802 -0
  288. data/doc/dot/f_19.jpg +0 -0
  289. data/doc/dot/f_2.dot +14 -0
  290. data/doc/dot/f_2.jpg +0 -0
  291. data/doc/dot/f_20.dot +802 -0
  292. data/doc/dot/f_20.jpg +0 -0
  293. data/doc/dot/f_21.dot +802 -0
  294. data/doc/dot/f_21.jpg +0 -0
  295. data/doc/dot/f_22.dot +802 -0
  296. data/doc/dot/f_22.jpg +0 -0
  297. data/doc/dot/f_23.dot +802 -0
  298. data/doc/dot/f_23.jpg +0 -0
  299. data/doc/dot/f_24.dot +802 -0
  300. data/doc/dot/f_24.jpg +0 -0
  301. data/doc/dot/f_25.dot +817 -0
  302. data/doc/dot/f_25.jpg +0 -0
  303. data/doc/dot/f_26.dot +29 -0
  304. data/doc/dot/f_26.jpg +0 -0
  305. data/doc/dot/f_27.dot +802 -0
  306. data/doc/dot/f_27.jpg +0 -0
  307. data/doc/dot/f_28.dot +802 -0
  308. data/doc/dot/f_28.jpg +0 -0
  309. data/doc/dot/f_29.dot +802 -0
  310. data/doc/dot/f_29.jpg +0 -0
  311. data/doc/dot/f_3.dot +14 -0
  312. data/doc/dot/f_3.jpg +0 -0
  313. data/doc/dot/f_30.dot +802 -0
  314. data/doc/dot/f_30.jpg +0 -0
  315. data/doc/dot/f_31.dot +802 -0
  316. data/doc/dot/f_31.jpg +0 -0
  317. data/doc/dot/f_32.dot +802 -0
  318. data/doc/dot/f_32.jpg +0 -0
  319. data/doc/dot/f_33.dot +802 -0
  320. data/doc/dot/f_33.jpg +0 -0
  321. data/doc/dot/f_34.dot +802 -0
  322. data/doc/dot/f_34.jpg +0 -0
  323. data/doc/dot/f_35.dot +802 -0
  324. data/doc/dot/f_35.jpg +0 -0
  325. data/doc/dot/f_36.dot +802 -0
  326. data/doc/dot/f_36.jpg +0 -0
  327. data/doc/dot/f_37.dot +802 -0
  328. data/doc/dot/f_37.jpg +0 -0
  329. data/doc/dot/f_38.dot +54 -0
  330. data/doc/dot/f_38.jpg +0 -0
  331. data/doc/dot/f_39.dot +802 -0
  332. data/doc/dot/f_39.jpg +0 -0
  333. data/doc/dot/f_4.dot +802 -0
  334. data/doc/dot/f_4.jpg +0 -0
  335. data/doc/dot/f_40.dot +802 -0
  336. data/doc/dot/f_40.jpg +0 -0
  337. data/doc/dot/f_41.dot +802 -0
  338. data/doc/dot/f_41.jpg +0 -0
  339. data/doc/dot/f_42.dot +802 -0
  340. data/doc/dot/f_42.jpg +0 -0
  341. data/doc/dot/f_43.dot +802 -0
  342. data/doc/dot/f_43.jpg +0 -0
  343. data/doc/dot/f_44.dot +802 -0
  344. data/doc/dot/f_44.jpg +0 -0
  345. data/doc/dot/f_5.dot +802 -0
  346. data/doc/dot/f_5.jpg +0 -0
  347. data/doc/dot/f_6.dot +802 -0
  348. data/doc/dot/f_6.jpg +0 -0
  349. data/doc/dot/f_7.dot +802 -0
  350. data/doc/dot/f_7.jpg +0 -0
  351. data/doc/dot/f_8.dot +802 -0
  352. data/doc/dot/f_8.jpg +0 -0
  353. data/doc/dot/f_9.dot +802 -0
  354. data/doc/dot/f_9.jpg +0 -0
  355. data/doc/dot/m_10_0.dot +802 -0
  356. data/doc/dot/m_10_0.jpg +0 -0
  357. data/doc/dot/m_11_0.dot +734 -0
  358. data/doc/dot/m_11_0.jpg +0 -0
  359. data/doc/dot/m_12_0.dot +802 -0
  360. data/doc/dot/m_12_0.jpg +0 -0
  361. data/doc/dot/m_13_0.dot +802 -0
  362. data/doc/dot/m_13_0.jpg +0 -0
  363. data/doc/dot/m_14_0.dot +802 -0
  364. data/doc/dot/m_14_0.jpg +0 -0
  365. data/doc/dot/m_15_0.dot +802 -0
  366. data/doc/dot/m_15_0.jpg +0 -0
  367. data/doc/dot/m_16_0.dot +802 -0
  368. data/doc/dot/m_16_0.jpg +0 -0
  369. data/doc/dot/m_17_0.dot +802 -0
  370. data/doc/dot/m_17_0.jpg +0 -0
  371. data/doc/dot/m_18_0.dot +734 -0
  372. data/doc/dot/m_18_0.jpg +0 -0
  373. data/doc/dot/m_19_0.dot +802 -0
  374. data/doc/dot/m_19_0.jpg +0 -0
  375. data/doc/dot/m_20_0.dot +802 -0
  376. data/doc/dot/m_20_0.jpg +0 -0
  377. data/doc/dot/m_21_0.dot +802 -0
  378. data/doc/dot/m_21_0.jpg +0 -0
  379. data/doc/dot/m_22_0.dot +802 -0
  380. data/doc/dot/m_22_0.jpg +0 -0
  381. data/doc/dot/m_23_0.dot +802 -0
  382. data/doc/dot/m_23_0.jpg +0 -0
  383. data/doc/dot/m_24_0.dot +802 -0
  384. data/doc/dot/m_24_0.jpg +0 -0
  385. data/doc/dot/m_25_0.dot +802 -0
  386. data/doc/dot/m_25_0.jpg +0 -0
  387. data/doc/dot/m_26_0.dot +734 -0
  388. data/doc/dot/m_26_0.jpg +0 -0
  389. data/doc/dot/m_27_0.dot +802 -0
  390. data/doc/dot/m_27_0.jpg +0 -0
  391. data/doc/dot/m_28_0.dot +802 -0
  392. data/doc/dot/m_28_0.jpg +0 -0
  393. data/doc/dot/m_29_0.dot +802 -0
  394. data/doc/dot/m_29_0.jpg +0 -0
  395. data/doc/dot/m_30_0.dot +802 -0
  396. data/doc/dot/m_30_0.jpg +0 -0
  397. data/doc/dot/m_31_0.dot +802 -0
  398. data/doc/dot/m_31_0.jpg +0 -0
  399. data/doc/dot/m_32_0.dot +802 -0
  400. data/doc/dot/m_32_0.jpg +0 -0
  401. data/doc/dot/m_33_0.dot +802 -0
  402. data/doc/dot/m_33_0.jpg +0 -0
  403. data/doc/dot/m_34_0.dot +802 -0
  404. data/doc/dot/m_34_0.jpg +0 -0
  405. data/doc/dot/m_35_0.dot +802 -0
  406. data/doc/dot/m_35_0.jpg +0 -0
  407. data/doc/dot/m_36_0.dot +802 -0
  408. data/doc/dot/m_36_0.jpg +0 -0
  409. data/doc/dot/m_37_0.dot +802 -0
  410. data/doc/dot/m_37_0.jpg +0 -0
  411. data/doc/dot/m_38_0.dot +54 -0
  412. data/doc/dot/m_38_0.jpg +0 -0
  413. data/doc/dot/m_39_0.dot +802 -0
  414. data/doc/dot/m_39_0.jpg +0 -0
  415. data/doc/dot/m_40_0.dot +802 -0
  416. data/doc/dot/m_40_0.jpg +0 -0
  417. data/doc/dot/m_41_0.dot +802 -0
  418. data/doc/dot/m_41_0.jpg +0 -0
  419. data/doc/dot/m_42_0.dot +802 -0
  420. data/doc/dot/m_42_0.jpg +0 -0
  421. data/doc/dot/m_43_0.dot +802 -0
  422. data/doc/dot/m_43_0.jpg +0 -0
  423. data/doc/dot/m_44_0.dot +802 -0
  424. data/doc/dot/m_44_0.jpg +0 -0
  425. data/doc/dot/m_4_0.dot +802 -0
  426. data/doc/dot/m_4_0.jpg +0 -0
  427. data/doc/dot/m_5_0.dot +802 -0
  428. data/doc/dot/m_5_0.jpg +0 -0
  429. data/doc/dot/m_6_0.dot +802 -0
  430. data/doc/dot/m_6_0.jpg +0 -0
  431. data/doc/dot/m_7_0.dot +802 -0
  432. data/doc/dot/m_7_0.jpg +0 -0
  433. data/doc/dot/m_8_0.dot +802 -0
  434. data/doc/dot/m_8_0.jpg +0 -0
  435. data/doc/dot/m_9_0.dot +802 -0
  436. data/doc/dot/m_9_0.jpg +0 -0
  437. data/doc/files/DEPENDS.html +107 -0
  438. data/doc/files/HISTORY.html +316 -0
  439. data/doc/files/INSTALL.html +126 -0
  440. data/doc/files/README.html +1223 -0
  441. data/doc/files/TODO.html +148 -0
  442. data/doc/files/TUTORIAL.html +392 -0
  443. data/doc/files/VERSION.html +107 -0
  444. data/doc/files/bin/rq_rb.html +231 -0
  445. data/doc/files/install_rb.html +188 -0
  446. data/doc/files/install_rb.src/M000001.html +53 -0
  447. data/doc/files/install_rb.src/M000002.html +43 -0
  448. data/doc/files/lib/rq-1_0_0/backer_rb.html +174 -0
  449. data/doc/files/lib/rq-1_0_0/configfile_rb.html +174 -0
  450. data/doc/files/lib/rq-1_0_0/configurator_rb.html +174 -0
  451. data/doc/files/lib/rq-1_0_0/creator_rb.html +174 -0
  452. data/doc/files/lib/rq-1_0_0/defaultconfig_txt.html +110 -0
  453. data/doc/files/lib/rq-1_0_0/deleter_rb.html +174 -0
  454. data/doc/files/lib/rq-1_0_0/executor_rb.html +174 -0
  455. data/doc/files/lib/rq-1_0_0/feeder_rb.html +178 -0
  456. data/doc/files/lib/rq-1_0_0/job_rb.html +176 -0
  457. data/doc/files/lib/rq-1_0_0/jobqueue_rb.html +177 -0
  458. data/doc/files/lib/rq-1_0_0/jobrunner_rb.html +175 -0
  459. data/doc/files/lib/rq-1_0_0/jobrunnerdaemon_rb.html +179 -0
  460. data/doc/files/lib/rq-1_0_0/lister_rb.html +174 -0
  461. data/doc/files/lib/rq-1_0_0/locker_rb.html +175 -0
  462. data/doc/files/lib/rq-1_0_0/logging_rb.html +178 -0
  463. data/doc/files/lib/rq-1_0_0/mainhelper_rb.html +175 -0
  464. data/doc/files/lib/rq-1_0_0/qdb_rb.html +177 -0
  465. data/doc/files/lib/rq-1_0_0/querier_rb.html +174 -0
  466. data/doc/files/lib/rq-1_0_0/refresher_rb.html +167 -0
  467. data/doc/files/lib/rq-1_0_0/relayer_rb.html +178 -0
  468. data/doc/files/lib/rq-1_0_0/sleepcycle_rb.html +167 -0
  469. data/doc/files/lib/rq-1_0_0/snapshotter_rb.html +174 -0
  470. data/doc/files/lib/rq-1_0_0/statuslister_rb.html +174 -0
  471. data/doc/files/lib/rq-1_0_0/submitter_rb.html +174 -0
  472. data/doc/files/lib/rq-1_0_0/updater_rb.html +174 -0
  473. data/doc/files/lib/rq-1_0_0/usage_rb.html +174 -0
  474. data/doc/files/lib/rq-1_0_0/util_rb.html +176 -0
  475. data/doc/files/lib/rq-2_0_0/backer_rb.html +180 -0
  476. data/doc/files/lib/rq-2_0_0/configfile_rb.html +180 -0
  477. data/doc/files/lib/rq-2_0_0/configurator_rb.html +180 -0
  478. data/doc/files/lib/rq-2_0_0/creator_rb.html +180 -0
  479. data/doc/files/lib/rq-2_0_0/defaultconfig_txt.html +110 -0
  480. data/doc/files/lib/rq-2_0_0/deleter_rb.html +180 -0
  481. data/doc/files/lib/rq-2_0_0/executor_rb.html +180 -0
  482. data/doc/files/lib/rq-2_0_0/feeder_rb.html +184 -0
  483. data/doc/files/lib/rq-2_0_0/job_rb.html +182 -0
  484. data/doc/files/lib/rq-2_0_0/jobqueue_rb.html +185 -0
  485. data/doc/files/lib/rq-2_0_0/jobrunner_rb.html +181 -0
  486. data/doc/files/lib/rq-2_0_0/jobrunnerdaemon_rb.html +185 -0
  487. data/doc/files/lib/rq-2_0_0/lister_rb.html +180 -0
  488. data/doc/files/lib/rq-2_0_0/locker_rb.html +181 -0
  489. data/doc/files/lib/rq-2_0_0/logging_rb.html +184 -0
  490. data/doc/files/lib/rq-2_0_0/mainhelper_rb.html +181 -0
  491. data/doc/files/lib/rq-2_0_0/orderedautohash_rb.html +182 -0
  492. data/doc/files/lib/rq-2_0_0/orderedhash_rb.html +138 -0
  493. data/doc/files/lib/rq-2_0_0/qdb_rb.html +184 -0
  494. data/doc/files/lib/rq-2_0_0/querier_rb.html +180 -0
  495. data/doc/files/lib/rq-2_0_0/refresher_rb.html +173 -0
  496. data/doc/files/lib/rq-2_0_0/relayer_rb.html +184 -0
  497. data/doc/files/lib/rq-2_0_0/rotater_rb.html +180 -0
  498. data/doc/files/lib/rq-2_0_0/sleepcycle_rb.html +173 -0
  499. data/doc/files/lib/rq-2_0_0/snapshotter_rb.html +180 -0
  500. data/doc/files/lib/rq-2_0_0/statuslister_rb.html +180 -0
  501. data/doc/files/lib/rq-2_0_0/submitter_rb.html +181 -0
  502. data/doc/files/lib/rq-2_0_0/updater_rb.html +180 -0
  503. data/doc/files/lib/rq-2_0_0/usage_rb.html +180 -0
  504. data/doc/files/lib/rq-2_0_0/util_rb.html +182 -0
  505. data/doc/files/lib/rq-2_3_1/backer_rb.html +182 -0
  506. data/doc/files/lib/rq-2_3_1/configfile_rb.html +182 -0
  507. data/doc/files/lib/rq-2_3_1/configurator_rb.html +182 -0
  508. data/doc/files/lib/rq-2_3_1/creator_rb.html +182 -0
  509. data/doc/files/lib/rq-2_3_1/defaultconfig_txt.html +110 -0
  510. data/doc/files/lib/rq-2_3_1/deleter_rb.html +182 -0
  511. data/doc/files/lib/rq-2_3_1/executor_rb.html +182 -0
  512. data/doc/files/lib/rq-2_3_1/feeder_rb.html +187 -0
  513. data/doc/files/lib/rq-2_3_1/job_rb.html +185 -0
  514. data/doc/files/lib/rq-2_3_1/jobqueue_rb.html +187 -0
  515. data/doc/files/lib/rq-2_3_1/jobrunner_rb.html +184 -0
  516. data/doc/files/lib/rq-2_3_1/jobrunnerdaemon_rb.html +187 -0
  517. data/doc/files/lib/rq-2_3_1/lister_rb.html +182 -0
  518. data/doc/files/lib/rq-2_3_1/locker_rb.html +183 -0
  519. data/doc/files/lib/rq-2_3_1/logging_rb.html +186 -0
  520. data/doc/files/lib/rq-2_3_1/mainhelper_rb.html +183 -0
  521. data/doc/files/lib/rq-2_3_1/orderedautohash_rb.html +184 -0
  522. data/doc/files/lib/rq-2_3_1/orderedhash_rb.html +138 -0
  523. data/doc/files/lib/rq-2_3_1/qdb_rb.html +188 -0
  524. data/doc/files/lib/rq-2_3_1/querier_rb.html +182 -0
  525. data/doc/files/lib/rq-2_3_1/refresher_rb.html +175 -0
  526. data/doc/files/lib/rq-2_3_1/relayer_rb.html +186 -0
  527. data/doc/files/lib/rq-2_3_1/resubmitter_rb.html +183 -0
  528. data/doc/files/lib/rq-2_3_1/rotater_rb.html +182 -0
  529. data/doc/files/lib/rq-2_3_1/sleepcycle_rb.html +175 -0
  530. data/doc/files/lib/rq-2_3_1/snapshotter_rb.html +182 -0
  531. data/doc/files/lib/rq-2_3_1/statuslister_rb.html +182 -0
  532. data/doc/files/lib/rq-2_3_1/submitter_rb.html +183 -0
  533. data/doc/files/lib/rq-2_3_1/updater_rb.html +182 -0
  534. data/doc/files/lib/rq-2_3_1/usage_rb.html +182 -0
  535. data/doc/files/lib/rq-2_3_1/util_rb.html +184 -0
  536. data/doc/files/lib/rq-2_3_1_rb.html +153 -0
  537. data/doc/files/lib/rq-2_3_2/backer_rb.html +186 -0
  538. data/doc/files/lib/rq-2_3_2/configfile_rb.html +186 -0
  539. data/doc/files/lib/rq-2_3_2/configurator_rb.html +186 -0
  540. data/doc/files/lib/rq-2_3_2/creator_rb.html +186 -0
  541. data/doc/files/lib/rq-2_3_2/defaultconfig_txt.html +110 -0
  542. data/doc/files/lib/rq-2_3_2/deleter_rb.html +186 -0
  543. data/doc/files/lib/rq-2_3_2/executor_rb.html +186 -0
  544. data/doc/files/lib/rq-2_3_2/feeder_rb.html +191 -0
  545. data/doc/files/lib/rq-2_3_2/ioviewer_rb.html +186 -0
  546. data/doc/files/lib/rq-2_3_2/job_rb.html +189 -0
  547. data/doc/files/lib/rq-2_3_2/jobqueue_rb.html +192 -0
  548. data/doc/files/lib/rq-2_3_2/jobrunner_rb.html +188 -0
  549. data/doc/files/lib/rq-2_3_2/jobrunnerdaemon_rb.html +191 -0
  550. data/doc/files/lib/rq-2_3_2/lister_rb.html +186 -0
  551. data/doc/files/lib/rq-2_3_2/locker_rb.html +187 -0
  552. data/doc/files/lib/rq-2_3_2/logging_rb.html +190 -0
  553. data/doc/files/lib/rq-2_3_2/mainhelper_rb.html +188 -0
  554. data/doc/files/lib/rq-2_3_2/orderedautohash_rb.html +188 -0
  555. data/doc/files/lib/rq-2_3_2/orderedhash_rb.html +138 -0
  556. data/doc/files/lib/rq-2_3_2/qdb_rb.html +193 -0
  557. data/doc/files/lib/rq-2_3_2/querier_rb.html +186 -0
  558. data/doc/files/lib/rq-2_3_2/recoverer_rb.html +186 -0
  559. data/doc/files/lib/rq-2_3_2/refresher_rb.html +179 -0
  560. data/doc/files/lib/rq-2_3_2/relayer_rb.html +190 -0
  561. data/doc/files/lib/rq-2_3_2/resubmitter_rb.html +187 -0
  562. data/doc/files/lib/rq-2_3_2/rotater_rb.html +186 -0
  563. data/doc/files/lib/rq-2_3_2/sleepcycle_rb.html +179 -0
  564. data/doc/files/lib/rq-2_3_2/snapshotter_rb.html +186 -0
  565. data/doc/files/lib/rq-2_3_2/statuslister_rb.html +186 -0
  566. data/doc/files/lib/rq-2_3_2/submitter_rb.html +187 -0
  567. data/doc/files/lib/rq-2_3_2/updater_rb.html +186 -0
  568. data/doc/files/lib/rq-2_3_2/usage_rb.html +186 -0
  569. data/doc/files/lib/rq-2_3_2/util_rb.html +188 -0
  570. data/doc/files/lib/rq-2_3_3/backer_rb.html +186 -0
  571. data/doc/files/lib/rq-2_3_3/configfile_rb.html +186 -0
  572. data/doc/files/lib/rq-2_3_3/configurator_rb.html +186 -0
  573. data/doc/files/lib/rq-2_3_3/creator_rb.html +186 -0
  574. data/doc/files/lib/rq-2_3_3/defaultconfig_txt.html +110 -0
  575. data/doc/files/lib/rq-2_3_3/deleter_rb.html +186 -0
  576. data/doc/files/lib/rq-2_3_3/executor_rb.html +186 -0
  577. data/doc/files/lib/rq-2_3_3/feeder_rb.html +191 -0
  578. data/doc/files/lib/rq-2_3_3/ioviewer_rb.html +186 -0
  579. data/doc/files/lib/rq-2_3_3/job_rb.html +189 -0
  580. data/doc/files/lib/rq-2_3_3/jobqueue_rb.html +192 -0
  581. data/doc/files/lib/rq-2_3_3/jobrunner_rb.html +188 -0
  582. data/doc/files/lib/rq-2_3_3/jobrunnerdaemon_rb.html +191 -0
  583. data/doc/files/lib/rq-2_3_3/lister_rb.html +186 -0
  584. data/doc/files/lib/rq-2_3_3/locker_rb.html +187 -0
  585. data/doc/files/lib/rq-2_3_3/logging_rb.html +190 -0
  586. data/doc/files/lib/rq-2_3_3/mainhelper_rb.html +188 -0
  587. data/doc/files/lib/rq-2_3_3/orderedautohash_rb.html +188 -0
  588. data/doc/files/lib/rq-2_3_3/orderedhash_rb.html +138 -0
  589. data/doc/files/lib/rq-2_3_3/qdb_rb.html +193 -0
  590. data/doc/files/lib/rq-2_3_3/querier_rb.html +186 -0
  591. data/doc/files/lib/rq-2_3_3/recoverer_rb.html +186 -0
  592. data/doc/files/lib/rq-2_3_3/refresher_rb.html +179 -0
  593. data/doc/files/lib/rq-2_3_3/relayer_rb.html +190 -0
  594. data/doc/files/lib/rq-2_3_3/resubmitter_rb.html +187 -0
  595. data/doc/files/lib/rq-2_3_3/rotater_rb.html +187 -0
  596. data/doc/files/lib/rq-2_3_3/sleepcycle_rb.html +179 -0
  597. data/doc/files/lib/rq-2_3_3/snapshotter_rb.html +186 -0
  598. data/doc/files/lib/rq-2_3_3/statuslister_rb.html +186 -0
  599. data/doc/files/lib/rq-2_3_3/submitter_rb.html +187 -0
  600. data/doc/files/lib/rq-2_3_3/updater_rb.html +186 -0
  601. data/doc/files/lib/rq-2_3_3/usage_rb.html +186 -0
  602. data/doc/files/lib/rq-2_3_3/util_rb.html +188 -0
  603. data/doc/files/lib/rq-3_0_0/backer_rb.html +194 -0
  604. data/doc/files/lib/rq-3_0_0/configfile_rb.html +194 -0
  605. data/doc/files/lib/rq-3_0_0/configurator_rb.html +194 -0
  606. data/doc/files/lib/rq-3_0_0/creator_rb.html +194 -0
  607. data/doc/files/lib/rq-3_0_0/cron_rb.html +194 -0
  608. data/doc/files/lib/rq-3_0_0/defaultconfig_txt.html +110 -0
  609. data/doc/files/lib/rq-3_0_0/deleter_rb.html +194 -0
  610. data/doc/files/lib/rq-3_0_0/executor_rb.html +194 -0
  611. data/doc/files/lib/rq-3_0_0/feeder_rb.html +199 -0
  612. data/doc/files/lib/rq-3_0_0/ioviewer_rb.html +194 -0
  613. data/doc/files/lib/rq-3_0_0/job_rb.html +197 -0
  614. data/doc/files/lib/rq-3_0_0/jobqueue_rb.html +200 -0
  615. data/doc/files/lib/rq-3_0_0/jobrunner_rb.html +196 -0
  616. data/doc/files/lib/rq-3_0_0/jobrunnerdaemon_rb.html +199 -0
  617. data/doc/files/lib/rq-3_0_0/lister_rb.html +194 -0
  618. data/doc/files/lib/rq-3_0_0/locker_rb.html +195 -0
  619. data/doc/files/lib/rq-3_0_0/logging_rb.html +198 -0
  620. data/doc/files/lib/rq-3_0_0/mainhelper_rb.html +196 -0
  621. data/doc/files/lib/rq-3_0_0/orderedautohash_rb.html +196 -0
  622. data/doc/files/lib/rq-3_0_0/orderedhash_rb.html +138 -0
  623. data/doc/files/lib/rq-3_0_0/qdb_rb.html +201 -0
  624. data/doc/files/lib/rq-3_0_0/querier_rb.html +194 -0
  625. data/doc/files/lib/rq-3_0_0/recoverer_rb.html +194 -0
  626. data/doc/files/lib/rq-3_0_0/refresher_rb.html +187 -0
  627. data/doc/files/lib/rq-3_0_0/relayer_rb.html +198 -0
  628. data/doc/files/lib/rq-3_0_0/resource_rb.html +194 -0
  629. data/doc/files/lib/rq-3_0_0/resourcemanager_rb.html +187 -0
  630. data/doc/files/lib/rq-3_0_0/resubmitter_rb.html +195 -0
  631. data/doc/files/lib/rq-3_0_0/rotater_rb.html +195 -0
  632. data/doc/files/lib/rq-3_0_0/sleepcycle_rb.html +187 -0
  633. data/doc/files/lib/rq-3_0_0/snapshotter_rb.html +194 -0
  634. data/doc/files/lib/rq-3_0_0/sqlite_rb.html +160 -0
  635. data/doc/files/lib/rq-3_0_0/statuslister_rb.html +194 -0
  636. data/doc/files/lib/rq-3_0_0/submitter_rb.html +195 -0
  637. data/doc/files/lib/rq-3_0_0/toucher_rb.html +195 -0
  638. data/doc/files/lib/rq-3_0_0/updater_rb.html +194 -0
  639. data/doc/files/lib/rq-3_0_0/usage_rb.html +194 -0
  640. data/doc/files/lib/rq-3_0_0/util_rb.html +196 -0
  641. data/doc/files/lib/rq_rb.html +244 -0
  642. data/doc/fr_class_index.html +73 -0
  643. data/doc/fr_file_index.html +71 -0
  644. data/doc/fr_method_index.html +323 -0
  645. data/doc/index.html +24 -0
  646. data/doc/rdoc-style.css +172 -0
  647. data/extconf.rb +150 -0
  648. data/gemspec.rb +32 -0
  649. data/install.rb +75 -8
  650. data/lib/{rq-0.1.7.rb → rq-3.0.0.rb} +52 -10
  651. data/lib/{rq-0.1.7 → rq-3.0.0}/backer.rb +11 -7
  652. data/lib/{rq-0.1.7 → rq-3.0.0}/configfile.rb +21 -17
  653. data/lib/{rq-0.1.7 → rq-3.0.0}/configurator.rb +10 -6
  654. data/lib/rq-3.0.0/creator.rb +46 -0
  655. data/lib/rq-3.0.0/cron.rb +125 -0
  656. data/lib/{rq-0.1.7 → rq-3.0.0}/defaultconfig.txt +0 -0
  657. data/lib/rq-3.0.0/deleter.rb +51 -0
  658. data/lib/rq-3.0.0/executor.rb +40 -0
  659. data/lib/{rq-0.1.7 → rq-3.0.0}/feeder.rb +245 -91
  660. data/lib/rq-3.0.0/i686-linux/_sqlite.so +0 -0
  661. data/lib/rq-3.0.0/ioviewer.rb +48 -0
  662. data/lib/rq-3.0.0/job.rb +51 -0
  663. data/lib/rq-3.0.0/jobqueue.rb +899 -0
  664. data/lib/rq-3.0.0/jobrunner.rb +104 -0
  665. data/lib/{rq-0.1.7 → rq-3.0.0}/jobrunnerdaemon.rb +41 -27
  666. data/lib/rq-3.0.0/lister.rb +47 -0
  667. data/lib/rq-3.0.0/local/bin/sqlite +0 -0
  668. data/lib/rq-3.0.0/local/include/sqlite.h +868 -0
  669. data/lib/rq-3.0.0/local/lib/libsqlite.a +0 -0
  670. data/lib/rq-3.0.0/local/lib/libsqlite.la +35 -0
  671. data/lib/rq-3.0.0/local/lib/libsqlite.so +0 -0
  672. data/lib/rq-3.0.0/local/lib/libsqlite.so.0 +0 -0
  673. data/lib/rq-3.0.0/local/lib/libsqlite.so.0.8.6 +0 -0
  674. data/lib/rq-3.0.0/local/lib/pkgconfig/sqlite.pc +12 -0
  675. data/lib/{rq-0.1.7 → rq-3.0.0}/locker.rb +12 -6
  676. data/lib/{rq-0.1.7 → rq-3.0.0}/logging.rb +49 -42
  677. data/lib/rq-3.0.0/mainhelper.rb +184 -0
  678. data/lib/rq-3.0.0/orderedautohash.rb +39 -0
  679. data/lib/rq-3.0.0/orderedhash.rb +240 -0
  680. data/lib/{rq-0.1.7 → rq-3.0.0}/qdb.rb +183 -84
  681. data/lib/rq-3.0.0/querier.rb +98 -0
  682. data/lib/rq-3.0.0/recoverer.rb +28 -0
  683. data/lib/{rq-0.1.7 → rq-3.0.0}/refresher.rb +16 -8
  684. data/lib/rq-3.0.0/relayer.rb +283 -0
  685. data/lib/rq-3.0.0/resource.rb +22 -0
  686. data/lib/rq-3.0.0/resourcemanager.rb +40 -0
  687. data/lib/rq-3.0.0/resubmitter.rb +96 -0
  688. data/lib/rq-3.0.0/rotater.rb +98 -0
  689. data/lib/{rq-0.1.7 → rq-3.0.0}/sleepcycle.rb +14 -14
  690. data/lib/rq-3.0.0/snapshotter.rb +40 -0
  691. data/lib/rq-3.0.0/sqlite.rb +293 -0
  692. data/lib/rq-3.0.0/statuslister.rb +48 -0
  693. data/lib/rq-3.0.0/submitter.rb +109 -0
  694. data/lib/rq-3.0.0/toucher.rb +177 -0
  695. data/lib/rq-3.0.0/updater.rb +95 -0
  696. data/lib/rq-3.0.0/usage.rb +1157 -0
  697. data/lib/{rq-0.1.7 → rq-3.0.0}/util.rb +74 -56
  698. data/lib/rq.rb +52 -12
  699. data/rdoc.sh +17 -0
  700. data/rq +3 -1
  701. data/white_box/joblist +8 -0
  702. metadata +779 -96
  703. data/DEPENDS +0 -5
  704. data/HISTORY +0 -26
  705. data/VERSION +0 -1
  706. data/bin/rq-0.1.7 +0 -410
  707. data/lib/rq-0.1.7/creator.rb +0 -23
  708. data/lib/rq-0.1.7/deleter.rb +0 -39
  709. data/lib/rq-0.1.7/executor.rb +0 -41
  710. data/lib/rq-0.1.7/job.rb +0 -51
  711. data/lib/rq-0.1.7/jobqueue.rb +0 -432
  712. data/lib/rq-0.1.7/jobrunner.rb +0 -63
  713. data/lib/rq-0.1.7/lister.rb +0 -22
  714. data/lib/rq-0.1.7/mainhelper.rb +0 -53
  715. data/lib/rq-0.1.7/querier.rb +0 -33
  716. data/lib/rq-0.1.7/snapshotter.rb +0 -25
  717. data/lib/rq-0.1.7/statuslister.rb +0 -22
  718. data/lib/rq-0.1.7/submitter.rb +0 -90
  719. data/lib/rq-0.1.7/updater.rb +0 -95
  720. data/lib/rq-0.1.7/usage.rb +0 -609
  721. data/rdoc.cmd +0 -2
  722. data/rq.gemspec +0 -36
  723. data/rq.help +0 -552
@@ -0,0 +1,860 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #
4
+ # === the rq program
5
+ #
6
+ # the rq program is the single command line interface by which all queue
7
+ # operations are affected. it always takes, as it's first argument, the name of
8
+ # the queue to be operated on. the second argument is always the mode of
9
+ # operation. the action taken and meaning of subsequent arguments depends
10
+ # directory on the mode of operation. for example the command
11
+ #
12
+ # rq queue create
13
+ #
14
+ # has the the mode _create_ and will create the queue _queue_. similarly the
15
+ # command
16
+ #
17
+ # rq queue submit my_job.sh huge_input_file.dat
18
+ #
19
+ # runs in _submit_ mode and will sumbit a job to _queue_.
20
+ #
21
+ # run
22
+ #
23
+ # rq --help
24
+ #
25
+ # or see README
26
+ #
27
+ # for the detailed instructions for each of the operation modes
28
+ #
29
+
30
+ require 'rq-3.0.0'
31
+ module RQ
32
+ #
33
+ # the Main class is responsible for parsing command line paramters and
34
+ # switches, doing some validation, initializing logging, and, ultimately,
35
+ # delegating the bulk of the work to a MainHelper based on the _mode_ given.
36
+ # the relationship between Main and MainHelper is a tight one by design - the
37
+ # primary purpose of it being to prevent the Main class from becoming 10000
38
+ # lines long. the delegators used include:
39
+ #
40
+ # * Creator
41
+ # * Submitter
42
+ # * Lister
43
+ # * StatusLister
44
+ # * Deleter
45
+ # * Updater
46
+ # * Querier
47
+ # * Executor
48
+ # * Configurator
49
+ # * Snapshotter
50
+ # * Locker
51
+ # * Backer
52
+ # * Rotater
53
+ # * Feeder
54
+ # * IOViewer
55
+ #
56
+ class Main
57
+ #--{{{
58
+ include Util
59
+ include Logging
60
+ include Usage
61
+
62
+ # an enumeration of option specifications used to parse command line
63
+ OPTSPEC =
64
+ #--{{{
65
+ [
66
+ [
67
+ '--priority=priority', '-p',
68
+ 'modes <submit, resubmit> : set the job(s) priority - lowest(0) .. highest(n) - (default 0)'
69
+ ],
70
+ [
71
+ '--tag=tag', '-t',
72
+ 'modes <submit, resubmit> : set the job(s) user data tag'
73
+ ],
74
+ [
75
+ '--runner=runner',
76
+ 'modes <submit, resubmit> : set the job(s) required runner(s)'
77
+ ],
78
+ [
79
+ '--restartable',
80
+ 'modes <submit, resubmit> : set the job(s) to be restartable on node reboot'
81
+ ],
82
+ [
83
+ '--stage',
84
+ 'modes <submit, resubmit> : set the job(s) initial state to be holding (default pending)'
85
+ ],
86
+ [
87
+ '--infile=infile', '-i',
88
+ 'modes <submit, resubmit> : infile'
89
+ ],
90
+ [
91
+ '--stdin=[stdin]', '-s',
92
+ 'modes <submit, resubmit, update> : stdin'
93
+ ],
94
+
95
+ [
96
+ '--quiet', '-q',
97
+ 'modes <submit, resubmit, feed> : do not echo submitted jobs, fail silently if
98
+ another process is already feeding'
99
+ ],
100
+ [
101
+ '--daemon', '-D',
102
+ 'modes <feed> : spawn a daemon'
103
+ ],
104
+ [
105
+ '--max_feed=max_feed',
106
+ 'modes <feed> : the maximum number of concurrent jobs run'
107
+ ],
108
+ [
109
+ '--retries=retries',
110
+ 'modes <feed> : specify transaction retries'
111
+ ],
112
+ [
113
+ '--min_sleep=min_sleep',
114
+ 'modes <feed> : specify min sleep'
115
+ ],
116
+ [
117
+ '--max_sleep=max_sleep',
118
+ 'modes <feed> : specify max sleep'
119
+ ],
120
+ [
121
+ '--exit=exit_code_map',
122
+ 'modes <status> : specify and exit code map'
123
+ ],
124
+ [
125
+ '--fields=fields', '-f',
126
+ 'limit which fields of output to display'
127
+ ],
128
+ [
129
+ '--snapshot', '-s',
130
+ 'operate on snapshot of queue'
131
+ ],
132
+ [
133
+ '--editor=editor', '-e',
134
+ 'editor command capable of opening multiple files at once = (default ENV["RQ_EDITOR"] || "vim -R -o")'
135
+ ],
136
+ [
137
+ '--verbosity=verbostiy', '-v',
138
+ '0|fatal < 1|error < 2|warn < 3|info < 4|debug - (default info)'
139
+ ],
140
+ [
141
+ '--log=path','-l',
142
+ 'set log file - (default stderr)'
143
+ ],
144
+ [
145
+ '--log_age=log_age',
146
+ 'daily | weekly | monthly - what age will cause log rolling (default nil)'
147
+ ],
148
+ [
149
+ '--log_size=log_size',
150
+ 'size in bytes - what size will cause log rolling (default nil)'
151
+ ],
152
+ [
153
+ '--dot_rq_dir=[dot_rq_dir]',
154
+ 'base dir for log/pidfile storage (default ~/.rq/full/path/to/queue)'
155
+ ],
156
+ # [
157
+ # '--config=path',
158
+ # 'valid path - specify config file (default nil)'
159
+ # ],
160
+ # [
161
+ # '--template=[path]',
162
+ # 'valid path - generate a template config file in path (default stdout)'
163
+ # ],
164
+ [
165
+ '--help', '-h',
166
+ 'this message'
167
+ ],
168
+ [
169
+ '--version',
170
+ 'show version number'
171
+ ],
172
+ ]
173
+ #--}}}
174
+
175
+ # the default config file searched for has this basename
176
+ CONFIG_DEFAULT_PATH = 'rq.conf'
177
+
178
+ # config files are searched for using this list of locations
179
+ CONFIG_SEARCH_PATH = %w( . ~ /dmsp/reference/etc /usr/local/etc /usr/etc /etc )
180
+
181
+ # the queue can be specified in the environment
182
+ Q = ENV['RQ_Q'] || ENV['RQ_QUEUE']
183
+
184
+ attr :logger
185
+ attr :argv
186
+ attr :env
187
+ attr :stdin
188
+ attr :job_stdin
189
+ attr :cmd
190
+ attr :options
191
+ attr :qpath
192
+ attr :mode
193
+ attr :q
194
+ attr :daemon
195
+ attr :quiet
196
+ attr :fields
197
+ attr :dot_rq_dir
198
+
199
+ alias_method 'stdin?', 'stdin'
200
+ alias_method 'job_stdin?', 'job_stdin'
201
+ alias_method 'quiet?', 'quiet'
202
+
203
+ # given a command line and environment run the rq program
204
+ def initialize argv = ARGV, env = ENV
205
+ #--{{{
206
+ begin
207
+ @logger = Logger::new STDERR
208
+ @argv = Util::mcp(argv.to_a)
209
+ @env = Util::mcp(env.to_hash)
210
+ @cmd = ([File::expand_path($0)] + ARGV).join(' ')
211
+ @stdin = parse_stdin
212
+
213
+ parse_options
214
+
215
+ if(@options.has_key?('name'))
216
+ $0 = ([@options['name']] + ARGV).join(' ')
217
+ end
218
+
219
+ if(@options.has_key?('help') or @argv.include?('help'))
220
+ usage('port' => STDOUT, 'long' => true)
221
+ exit EXIT_SUCCESS
222
+ end
223
+
224
+ if(@options.has_key?('template') or (idx = @argv.index('template')))
225
+ gen_template(@options['template'] || @argv[idx + 1])
226
+ exit EXIT_SUCCESS
227
+ end
228
+
229
+ if @options.has_key?('version')
230
+ puts RQ::VERSION
231
+ exit EXIT_SUCCESS
232
+ end
233
+
234
+ if(@options.has_key?('stdin'))
235
+ @options['stdin'] ||= '-'
236
+ @job_stdin = @options['stdin']
237
+ end
238
+
239
+ if(@options.has_key?('quiet'))
240
+ @quiet = true
241
+ end
242
+
243
+ if(@options.has_key?('fields'))
244
+ @fields = @options['fields'].split(%r/,/).map{|f| f.strip}
245
+ @fields.uniq!
246
+ end
247
+
248
+ parse_argv
249
+
250
+ setup_dot_rq_dir
251
+
252
+ status = run
253
+
254
+ case status
255
+ when Integer
256
+ exit status
257
+ else
258
+ exit(status ? EXIT_SUCCESS : EXIT_FAILURE)
259
+ end
260
+ rescue => e
261
+ unless SystemExit === e
262
+ logerr e
263
+ exit EXIT_FAILURE
264
+ else
265
+ exit e.status
266
+ end
267
+ end
268
+ #--}}}
269
+ end
270
+ # extract command lines args
271
+ def parse_argv
272
+ #--{{{
273
+ @qpath = Q || @argv.shift
274
+ @mode = @argv.shift
275
+ #--}}}
276
+ end
277
+ # determine storage for logs/pidfiles
278
+ def setup_dot_rq_dir
279
+ #--{{{
280
+ if(@options.has_key?('dot_rq_dir'))
281
+ @dot_rq_dir = @options['dot_rq_dir']
282
+ end
283
+ if @dot_rq_dir.nil?
284
+ home = ENV['HOME'] || File::expand_path('~') rescue abort("ENV['HOME'] is unset!")
285
+ @dot_rq_dir = File::join home, '.rq', @qpath
286
+ end
287
+ FileUtils.mkdir_p @dot_rq_dir
288
+ #--}}}
289
+ end
290
+ # select a MainHelper based on mode and delegate to it
291
+ def run
292
+ #--{{{
293
+ @qpath = Util::realpath @qpath
294
+
295
+ if @mode.nil? or @mode.strip.empty?
296
+ usage 'port' => STDERR, 'long' => false
297
+ exit EXIT_FAILURE
298
+ end
299
+
300
+ shortcuts = {
301
+ 'c' => 'create',
302
+ 's' => 'submit',
303
+ 'r' => 'resubmit',
304
+ 're' => 'resubmit',
305
+ 'l' => 'list',
306
+ 'ls' => 'list',
307
+ 't' => 'status',
308
+ 'd' => 'delete',
309
+ 'rm' => 'delete',
310
+ 'u' => 'update',
311
+ 'q' => 'query',
312
+ 'e' => 'execute',
313
+ 'C' => 'configure',
314
+ 'S' => 'snapshot',
315
+ 'L' => 'lock',
316
+ 'B' => 'backup',
317
+ 'R' => 'rotate',
318
+ 'h' => 'help',
319
+ 'H' => 'help',
320
+ 'f' => 'feed',
321
+ 'io' => 'ioview',
322
+ '0' => 'stdin',
323
+ '1' => 'stdout',
324
+ '2' => 'stderr',
325
+ 'to' => 'touch',
326
+ 'ta' => 'tail',
327
+ 'cron' => 'cron',
328
+ }
329
+
330
+ if((longmode = shortcuts[@mode]))
331
+ @mode = longmode
332
+ end
333
+
334
+ begin
335
+ case @mode
336
+ when 'create'
337
+ create
338
+ when 'submit'
339
+ submit
340
+ when 'resubmit'
341
+ resubmit
342
+ when 'list'
343
+ list
344
+ when 'status'
345
+ status
346
+ when 'delete'
347
+ delete
348
+ when 'update'
349
+ update
350
+ when 'query'
351
+ query
352
+ when 'execute'
353
+ execute
354
+ when 'configure'
355
+ configure
356
+ when 'snapshot'
357
+ snapshot
358
+ when 'lock'
359
+ lock
360
+ when 'backup'
361
+ backup
362
+ when 'rotate'
363
+ rotate
364
+ when 'help'
365
+ usage 'port' => STDOUT, 'long' => true
366
+ exit EXIT_SUCCESS
367
+ when 'feed'
368
+ feed
369
+ when 'start'
370
+ start
371
+ when 'shutdown'
372
+ shutdown
373
+ when 'stop'
374
+ stop
375
+ when 'restart'
376
+ restart
377
+ when 'pid'
378
+ pid
379
+ when 'feeder'
380
+ feeder
381
+ when 'recover'
382
+ recover
383
+ when 'ioview'
384
+ ioview
385
+ when 'stdin'
386
+ dump_stdin
387
+ when 'stdout'
388
+ dump_stdout
389
+ when 'stderr'
390
+ dump_stderr
391
+ when 'stdin4'
392
+ stdin4
393
+ when 'stdout4'
394
+ stdout4
395
+ when 'stderr4'
396
+ stderr4
397
+ when 'touch'
398
+ touch
399
+ when 'tail'
400
+ tail
401
+ when 'cron'
402
+ cron
403
+ else
404
+ raise "invalid mode <#{ @mode }>"
405
+ end
406
+ self
407
+ rescue Errno::EPIPE => e
408
+ raise if STDOUT.tty?
409
+ end
410
+
411
+ EXIT_SUCCESS
412
+ #--}}}
413
+ end
414
+ # delegated to a Creator
415
+ def create
416
+ #--{{{
417
+ init_logging
418
+ creator = Creator::new self
419
+ creator.create
420
+ #--}}}
421
+ end
422
+ # delegated to a Submitter
423
+ def submit
424
+ #--{{{
425
+ init_logging
426
+ submitter = Submitter::new self
427
+ submitter.submit
428
+ #--}}}
429
+ end
430
+ # delegated to a ReSubmitter
431
+ def resubmit
432
+ #--{{{
433
+ init_logging
434
+ resubmitter = ReSubmitter::new self
435
+ resubmitter.resubmit
436
+ #--}}}
437
+ end
438
+ # delegated to a Lister
439
+ def list
440
+ #--{{{
441
+ init_logging
442
+ @options['snapshot'] = true
443
+ lister = Lister::new self
444
+ lister.list
445
+ #--}}}
446
+ end
447
+ # delegated to a StatusLister
448
+ def status
449
+ #--{{{
450
+ init_logging
451
+ @options['snapshot'] = true
452
+ statuslister = StatusLister::new self
453
+ statuslister.statuslist
454
+ #--}}}
455
+ end
456
+ # delegated to a Deleter
457
+ def delete
458
+ #--{{{
459
+ init_logging
460
+ deleter = Deleter::new self
461
+ deleter.delete
462
+ #--}}}
463
+ end
464
+ # delegated to a Updater
465
+ def update
466
+ #--{{{
467
+ init_logging
468
+ updater = Updater::new self
469
+ updater.update
470
+ #--}}}
471
+ end
472
+ # delegated to a Querier
473
+ def query
474
+ #--{{{
475
+ init_logging
476
+ querier = Querier::new self
477
+ querier.query
478
+ #--}}}
479
+ end
480
+ # delegated to a Executor
481
+ def execute
482
+ #--{{{
483
+ init_logging
484
+ executor = Executor::new self
485
+ executor.execute
486
+ #--}}}
487
+ end
488
+ # delegated to a Configurator
489
+ def configure
490
+ #--{{{
491
+ init_logging
492
+ configurator = Configurator::new self
493
+ configurator.configure
494
+ #--}}}
495
+ end
496
+ # delegated to a Snapshotter
497
+ def snapshot
498
+ #--{{{
499
+ init_logging
500
+ snapshotter = Snapshotter::new self
501
+ snapshotter.snapshot
502
+ #--}}}
503
+ end
504
+ # delegated to a Locker
505
+ def lock
506
+ #--{{{
507
+ init_logging
508
+ locker = Locker::new self
509
+ locker.lock
510
+ #--}}}
511
+ end
512
+ # delegated to a Backer
513
+ def backup
514
+ #--{{{
515
+ init_logging
516
+ backer = Backer::new self
517
+ backer.backup
518
+ #--}}}
519
+ end
520
+ # delegated to a Rotater
521
+ def rotate
522
+ #--{{{
523
+ init_logging
524
+ rotater = Rotater::new self
525
+ rotater.rotate
526
+ #--}}}
527
+ end
528
+ # delegated to a Feeder
529
+ def feed
530
+ #--{{{
531
+ feeder = Feeder::new self
532
+ feeder.feed
533
+ #--}}}
534
+ end
535
+ # quietly start a daemon process
536
+ def start
537
+ #--{{{
538
+ unless exists
539
+ @options['daemon'] = true
540
+ @options['quiet'] = true
541
+ @options['log'] ||= File.join(@dot_rq_dir, 'log')
542
+ feeder = Feeder::new self
543
+ feeder.feed
544
+ end
545
+ #--}}}
546
+ end
547
+ # clean stop
548
+ def shutdown
549
+ #--{{{
550
+ pid = (exists and signal_feeder('TERM'))
551
+ puts "pid <#{ pid }> signaled to stop a.s.a.p" if pid
552
+ exit(Integer === pid ? 0 : 1)
553
+ #--}}}
554
+ end
555
+ # hard stop
556
+ def stop
557
+ #--{{{
558
+ pid = (exists and signal_feeder('KILL'))
559
+ puts "pid <#{ pid }> signaled to stop now" if pid
560
+ exit(Integer === pid ? 0 : 1)
561
+ #--}}}
562
+ end
563
+ # sighup based restart
564
+ def restart
565
+ #--{{{
566
+ pid = (exists and signal_feeder('HUP'))
567
+ puts "pid <#{ pid }> signaled to restart" if pid
568
+ exit(Integer === pid ? 0 : 1)
569
+ #--}}}
570
+ end
571
+ # is a feeder running?
572
+ def feeder
573
+ #--{{{
574
+ arg = @argv.shift
575
+ case arg
576
+ when /pid/
577
+ pid
578
+ else
579
+ puts "---\nfeeder : #{ exists ? true : false }"
580
+ end
581
+ #--}}}
582
+ end
583
+ # pid of any running feeder
584
+ def pid
585
+ #--{{{
586
+ puts "---\npid : #{ exists || '~' }"
587
+ #--}}}
588
+ end
589
+ # attempt sqlite db recovery
590
+ def recover
591
+ #--{{{
592
+ init_logging
593
+ recoverer = Recoverer::new self
594
+ recoverer.recover
595
+ #--}}}
596
+ end
597
+ # spawn external process to view stdin/stdout/stderr of jids
598
+ def ioview
599
+ #--{{{
600
+ init_logging
601
+ ioviewer = IOViewer::new self
602
+ ioviewer.ioview
603
+ #--}}}
604
+ end
605
+ # dump stdin for jid
606
+ def dump_stdin
607
+ #--{{{
608
+ dump_ios 'stdin', jids4(@argv)
609
+ #--}}}
610
+ end
611
+ # dump stdout for jid
612
+ def dump_stdout
613
+ #--{{{
614
+ dump_ios 'stdout', jids4(@argv)
615
+ #--}}}
616
+ end
617
+ # dump stderr for jid
618
+ def dump_stderr
619
+ #--{{{
620
+ dump_ios 'stderr', jids4(@argv)
621
+ #--}}}
622
+ end
623
+ # dump stdin path for jid
624
+ def stdin4 jids = nil
625
+ #--{{{
626
+ if jids
627
+ File.join @qpath, 'stdin', jids.to_s
628
+ else
629
+ jids = jids4 @argv
630
+ #STDOUT << "---\n"
631
+ jids.flatten.each do |jid|
632
+ iopath = File.join @qpath, 'stdin', jid.to_s
633
+ #STDOUT << " - " << iopath << "\n"
634
+ puts iopath
635
+ end
636
+ end
637
+ #--}}}
638
+ end
639
+ # dump stdout path for jid
640
+ def stdout4 jids = nil
641
+ #--{{{
642
+ if jids
643
+ File.join @qpath, 'stdout', jids.to_s
644
+ else
645
+ jids = jids4 @argv
646
+ #STDOUT << "---\n"
647
+ jids.flatten.each do |jid|
648
+ iopath = File.join @qpath, 'stdout', jid.to_s
649
+ #STDOUT << " - " << iopath << "\n"
650
+ puts iopath
651
+ end
652
+ end
653
+ #--}}}
654
+ end
655
+ # dump stderr path for jid
656
+ def stderr4 jids = nil
657
+ #--{{{
658
+ if jids
659
+ File.join @qpath, 'stderr', jids.to_s
660
+ else
661
+ jids = jids4 @argv
662
+ #STDOUT << "---\n"
663
+ jids.flatten.each do |jid|
664
+ iopath = File.join @qpath, 'stderr', jid.to_s
665
+ #STDOUT << " - " << iopath << "\n"
666
+ puts iopath
667
+ end
668
+ end
669
+ #--}}}
670
+ end
671
+ # delegated to a Toucher
672
+ def touch
673
+ #--{{{
674
+ init_logging
675
+ toucher = Toucher::new self
676
+ toucher.touch
677
+ #--}}}
678
+ end
679
+ # spawn external process to tail stdin/stdout/stderr of jids
680
+ def tail
681
+ #--{{{
682
+ @options['editor'] = 'tail -F'
683
+ init_logging
684
+ ioviewer = IOViewer::new self
685
+ ioviewer.ioview rescue nil
686
+ #--}}}
687
+ end
688
+ # add/delete crontab entry
689
+ def cron
690
+ #--{{{
691
+ init_logging
692
+ cron = Cron::new self
693
+ cron.cron
694
+ #--}}}
695
+ end
696
+
697
+ def dump_ios which, jids
698
+ #--{{{
699
+ jids.each do |jid|
700
+ iopath = send "#{ which }4", jid
701
+ begin
702
+ cat iopath
703
+ rescue
704
+ next
705
+ end
706
+ end
707
+ #--}}}
708
+ end
709
+ def cat path
710
+ #--{{{
711
+ system("cat #{ path } 2>/dev/null") or open(path){|f| f.each{|line| print line}}
712
+ #--}}}
713
+ end
714
+ def jids4 *list
715
+ #--{{{
716
+ jids = list.flatten.map{|elem| Integer elem}
717
+ #@stdin.each{|line| line.strip!; next if line.empty?; jids << line} if @stdin
718
+ if @stdin
719
+ mainhelper = MainHelper.new(self)
720
+ jobs = []
721
+ mainhelper.loadio @stdin, 'stdin', jobs
722
+ jobs.each{|job| jids << job['jid']}
723
+ jids.map!{|jid| Integer(jid) rescue abort("bad jid <#{ jid.inspect }>")}
724
+ end
725
+ jids
726
+ #--}}}
727
+ end
728
+
729
+ def exists
730
+ #--{{{
731
+ begin
732
+ signal_feeder 0
733
+ rescue Errno::ESRCH
734
+ false
735
+ end
736
+ #--}}}
737
+ end
738
+ def signal_feeder sig
739
+ #--{{{
740
+ feeder = Feeder::new self
741
+ pidfilepath = feeder.gen_pidfilepath
742
+ pid = Integer(IO::read(pidfilepath)) rescue nil
743
+ begin
744
+ Process::kill(sig, pid)
745
+ pid
746
+ rescue
747
+ nil
748
+ end
749
+ #--}}}
750
+ end
751
+ # parses '-' from cmdline, but not if it's after a '--'
752
+ def parse_stdin
753
+ #--{{{
754
+ dash_dash, dash = %w( -- - ).map{|d| @argv.index d}
755
+ if dash
756
+ if dash_dash
757
+ if dash < dash_dash
758
+ @argv.delete '-'
759
+ STDIN
760
+ end
761
+ else
762
+ @argv.delete '-'
763
+ STDIN
764
+ end
765
+ end
766
+ #--}}}
767
+ end
768
+ # uses OPTSPEC to parse command line switches
769
+ def parse_options
770
+ #--{{{
771
+ @op = OptionParser.new
772
+ @options = {}
773
+ OPTSPEC.each do |spec|
774
+ k = spec.first.gsub(%r/(?:--)|(?:=.*$)|(?:\s+)/o,'')
775
+ @op.def_option(*spec){|v| v = v.to_s; @options[k] = v.empty? ? nil : v}
776
+ #@op.def_option(*spec){|v| @options[k] = v}
777
+ end
778
+
779
+ if((env_opts = (ENV['RQ_OPTS'] || ENV['RQ_OPTIONS'])))
780
+ require 'shellwords'
781
+ @op.parse! Shellwords.shellwords(env_opts)
782
+ end
783
+
784
+ @op.parse! @argv
785
+
786
+ @options
787
+ #--}}}
788
+ end
789
+ # initialize logging object - all classes then use this object
790
+ def init_logging
791
+ #--{{{
792
+ log, log_age, log_size, verbosity =
793
+ @options.values_at 'log', 'log_age', 'log_size', 'verbosity'
794
+ log_age = atoi log_age rescue nil
795
+ log_size = atoi log_size rescue nil
796
+ $logger = @logger = Logger::new(log || STDERR, log_age, log_size)
797
+ #
798
+ # hack to fix Logger sync bug
799
+ #
800
+ @logger.class.instance_eval do
801
+ attr :logdev unless @logger.respond_to?(:logdev)
802
+ end
803
+
804
+ @logdev = @logger.logdev.dev
805
+ @logdev.sync = true
806
+ level = nil
807
+ verbosity ||= 'info'
808
+ verbosity =
809
+ case verbosity
810
+ when /^\s*(?:4|d|debug)\s*$/io
811
+ level = 'Logging::DEBUG'
812
+ 4
813
+ when /^\s*(?:3|i|info)\s*$/io
814
+ level = 'Logging::INFO'
815
+ 3
816
+ when /^\s*(?:2|w|warn)\s*$/io
817
+ level = 'Logging::WARN'
818
+ 2
819
+ when /^\s*(?:1|e|error)\s*$/io
820
+ level = 'Logging::ERROR'
821
+ 1
822
+ when /^\s*(?:0|f|fatal)\s*$/io
823
+ level = 'Logging::FATAL'
824
+ 0
825
+ else
826
+ abort "illegal verbosity setting <#{ verbosity }>"
827
+ end
828
+ @logger.level = 2 - ((verbosity % 5) - 2)
829
+ #debug {"logging level <#{ level }>"}
830
+ @logger
831
+ #--}}}
832
+ end
833
+ # initialize configuration file - not currenlty utilized
834
+ def init_config
835
+ #--{{{
836
+ @config =
837
+ if @options['config']
838
+ ConfigFile::new(@options['config'])
839
+ else
840
+ ConfigFile::any CONFIG_DEFAULT_PATH, CONFIG_SEARCH_PATH
841
+ end
842
+ debug { "config.path <#{ @config.path }>" }
843
+ @config
844
+ #--}}}
845
+ end
846
+ # generate a template/sample config file which can then be edited
847
+ def gen_template template
848
+ #--{{{
849
+ ConfigFile::gen_template(template)
850
+ self
851
+ #--}}}
852
+ end
853
+ #--}}}
854
+ end
855
+ end
856
+
857
+ #
858
+ # run main program unless included as a library (testing purposes)
859
+ #
860
+ RQ::Main::new ARGV, ENV