MARQ 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (635) hide show
  1. data/LICENSE +20 -0
  2. data/R/CustomDS.R +80 -0
  3. data/R/GEO.R +249 -0
  4. data/R/MA.R +359 -0
  5. data/README.rdoc +29 -0
  6. data/bin/marq_config +170 -0
  7. data/install_scripts/CustomDS/Rakefile +223 -0
  8. data/install_scripts/GEO/Rakefile +258 -0
  9. data/install_scripts/GEO/platforms/GPL100.yaml +7 -0
  10. data/install_scripts/GEO/platforms/GPL1002.yaml +7 -0
  11. data/install_scripts/GEO/platforms/GPL1007.yaml +7 -0
  12. data/install_scripts/GEO/platforms/GPL101.yaml +7 -0
  13. data/install_scripts/GEO/platforms/GPL1010.yaml +7 -0
  14. data/install_scripts/GEO/platforms/GPL1073.yaml +7 -0
  15. data/install_scripts/GEO/platforms/GPL1074.yaml +4 -0
  16. data/install_scripts/GEO/platforms/GPL1090.yaml +7 -0
  17. data/install_scripts/GEO/platforms/GPL1104.yaml +7 -0
  18. data/install_scripts/GEO/platforms/GPL118.yaml +7 -0
  19. data/install_scripts/GEO/platforms/GPL1205.yaml +4 -0
  20. data/install_scripts/GEO/platforms/GPL1211.yaml +7 -0
  21. data/install_scripts/GEO/platforms/GPL1213.yaml +7 -0
  22. data/install_scripts/GEO/platforms/GPL1219.yaml +4 -0
  23. data/install_scripts/GEO/platforms/GPL1223.yaml +7 -0
  24. data/install_scripts/GEO/platforms/GPL1226.yaml +7 -0
  25. data/install_scripts/GEO/platforms/GPL1229.yaml +7 -0
  26. data/install_scripts/GEO/platforms/GPL1230.yaml +7 -0
  27. data/install_scripts/GEO/platforms/GPL1231.yaml +7 -0
  28. data/install_scripts/GEO/platforms/GPL1232.yaml +7 -0
  29. data/install_scripts/GEO/platforms/GPL1260.yaml +4 -0
  30. data/install_scripts/GEO/platforms/GPL1261.yaml +4 -0
  31. data/install_scripts/GEO/platforms/GPL127.yaml +4 -0
  32. data/install_scripts/GEO/platforms/GPL128.yaml +7 -0
  33. data/install_scripts/GEO/platforms/GPL1290.yaml +7 -0
  34. data/install_scripts/GEO/platforms/GPL1292.yaml +7 -0
  35. data/install_scripts/GEO/platforms/GPL1293.yaml +7 -0
  36. data/install_scripts/GEO/platforms/GPL1294.yaml +7 -0
  37. data/install_scripts/GEO/platforms/GPL1295.yaml +7 -0
  38. data/install_scripts/GEO/platforms/GPL13.yaml +4 -0
  39. data/install_scripts/GEO/platforms/GPL1310.yaml +7 -0
  40. data/install_scripts/GEO/platforms/GPL1313.yaml +7 -0
  41. data/install_scripts/GEO/platforms/GPL1323.yaml +7 -0
  42. data/install_scripts/GEO/platforms/GPL1331.yaml +7 -0
  43. data/install_scripts/GEO/platforms/GPL1352.yaml +4 -0
  44. data/install_scripts/GEO/platforms/GPL1355.yaml +4 -0
  45. data/install_scripts/GEO/platforms/GPL1382.yaml +7 -0
  46. data/install_scripts/GEO/platforms/GPL1387.yaml +7 -0
  47. data/install_scripts/GEO/platforms/GPL1397.yaml +4 -0
  48. data/install_scripts/GEO/platforms/GPL14.yaml +7 -0
  49. data/install_scripts/GEO/platforms/GPL1412.yaml +7 -0
  50. data/install_scripts/GEO/platforms/GPL1415.yaml +7 -0
  51. data/install_scripts/GEO/platforms/GPL1420.yaml +7 -0
  52. data/install_scripts/GEO/platforms/GPL144.yaml +7 -0
  53. data/install_scripts/GEO/platforms/GPL1449.yaml +7 -0
  54. data/install_scripts/GEO/platforms/GPL1458.yaml +7 -0
  55. data/install_scripts/GEO/platforms/GPL1523.yaml +7 -0
  56. data/install_scripts/GEO/platforms/GPL1524.yaml +7 -0
  57. data/install_scripts/GEO/platforms/GPL1528.yaml +7 -0
  58. data/install_scripts/GEO/platforms/GPL153.yaml +7 -0
  59. data/install_scripts/GEO/platforms/GPL1530.yaml +7 -0
  60. data/install_scripts/GEO/platforms/GPL1535.yaml +4 -0
  61. data/install_scripts/GEO/platforms/GPL155.yaml +7 -0
  62. data/install_scripts/GEO/platforms/GPL163.yaml +7 -0
  63. data/install_scripts/GEO/platforms/GPL168.yaml +7 -0
  64. data/install_scripts/GEO/platforms/GPL169.yaml +7 -0
  65. data/install_scripts/GEO/platforms/GPL1704.yaml +4 -0
  66. data/install_scripts/GEO/platforms/GPL1708.yaml +7 -0
  67. data/install_scripts/GEO/platforms/GPL1739.yaml +7 -0
  68. data/install_scripts/GEO/platforms/GPL1740.yaml +4 -0
  69. data/install_scripts/GEO/platforms/GPL1749.yaml +7 -0
  70. data/install_scripts/GEO/platforms/GPL177.yaml +7 -0
  71. data/install_scripts/GEO/platforms/GPL1790.yaml +7 -0
  72. data/install_scripts/GEO/platforms/GPL1792.yaml +7 -0
  73. data/install_scripts/GEO/platforms/GPL181.yaml +7 -0
  74. data/install_scripts/GEO/platforms/GPL1818.yaml +7 -0
  75. data/install_scripts/GEO/platforms/GPL1820.yaml +4 -0
  76. data/install_scripts/GEO/platforms/GPL1823.yaml +7 -0
  77. data/install_scripts/GEO/platforms/GPL1826.yaml +7 -0
  78. data/install_scripts/GEO/platforms/GPL183.yaml +7 -0
  79. data/install_scripts/GEO/platforms/GPL1831.yaml +7 -0
  80. data/install_scripts/GEO/platforms/GPL1833.yaml +7 -0
  81. data/install_scripts/GEO/platforms/GPL1872.yaml +4 -0
  82. data/install_scripts/GEO/platforms/GPL1911.yaml +7 -0
  83. data/install_scripts/GEO/platforms/GPL1914.yaml +4 -0
  84. data/install_scripts/GEO/platforms/GPL1928.yaml +7 -0
  85. data/install_scripts/GEO/platforms/GPL1942.yaml +7 -0
  86. data/install_scripts/GEO/platforms/GPL1945.yaml +7 -0
  87. data/install_scripts/GEO/platforms/GPL1964.yaml +7 -0
  88. data/install_scripts/GEO/platforms/GPL198.yaml +4 -0
  89. data/install_scripts/GEO/platforms/GPL1981.yaml +4 -0
  90. data/install_scripts/GEO/platforms/GPL200.yaml +7 -0
  91. data/install_scripts/GEO/platforms/GPL2006.yaml +7 -0
  92. data/install_scripts/GEO/platforms/GPL201.yaml +4 -0
  93. data/install_scripts/GEO/platforms/GPL2011.yaml +7 -0
  94. data/install_scripts/GEO/platforms/GPL2026.yaml +7 -0
  95. data/install_scripts/GEO/platforms/GPL205.yaml +7 -0
  96. data/install_scripts/GEO/platforms/GPL207.yaml +7 -0
  97. data/install_scripts/GEO/platforms/GPL2136.yaml +7 -0
  98. data/install_scripts/GEO/platforms/GPL220.yaml +7 -0
  99. data/install_scripts/GEO/platforms/GPL226.yaml +7 -0
  100. data/install_scripts/GEO/platforms/GPL24.yaml +4 -0
  101. data/install_scripts/GEO/platforms/GPL246.yaml +4 -0
  102. data/install_scripts/GEO/platforms/GPL247.yaml +7 -0
  103. data/install_scripts/GEO/platforms/GPL2507.yaml +4 -0
  104. data/install_scripts/GEO/platforms/GPL2529.yaml +4 -0
  105. data/install_scripts/GEO/platforms/GPL2531.yaml +7 -0
  106. data/install_scripts/GEO/platforms/GPL254.yaml +7 -0
  107. data/install_scripts/GEO/platforms/GPL2569.yaml +7 -0
  108. data/install_scripts/GEO/platforms/GPL257.yaml +7 -0
  109. data/install_scripts/GEO/platforms/GPL2598.yaml +7 -0
  110. data/install_scripts/GEO/platforms/GPL260.yaml +7 -0
  111. data/install_scripts/GEO/platforms/GPL2614.yaml +4 -0
  112. data/install_scripts/GEO/platforms/GPL2622.yaml +7 -0
  113. data/install_scripts/GEO/platforms/GPL2623.yaml +7 -0
  114. data/install_scripts/GEO/platforms/GPL2660.yaml +7 -0
  115. data/install_scripts/GEO/platforms/GPL2670.yaml +7 -0
  116. data/install_scripts/GEO/platforms/GPL2677.yaml +7 -0
  117. data/install_scripts/GEO/platforms/GPL2700.yaml +4 -0
  118. data/install_scripts/GEO/platforms/GPL2721.yaml +7 -0
  119. data/install_scripts/GEO/platforms/GPL2727.yaml +7 -0
  120. data/install_scripts/GEO/platforms/GPL273.yaml +7 -0
  121. data/install_scripts/GEO/platforms/GPL2763.yaml +7 -0
  122. data/install_scripts/GEO/platforms/GPL2824.yaml +7 -0
  123. data/install_scripts/GEO/platforms/GPL284.yaml +7 -0
  124. data/install_scripts/GEO/platforms/GPL287.yaml +4 -0
  125. data/install_scripts/GEO/platforms/GPL2872.yaml +7 -0
  126. data/install_scripts/GEO/platforms/GPL288.yaml +4 -0
  127. data/install_scripts/GEO/platforms/GPL2883.yaml +7 -0
  128. data/install_scripts/GEO/platforms/GPL289.yaml +4 -0
  129. data/install_scripts/GEO/platforms/GPL2895.yaml +4 -0
  130. data/install_scripts/GEO/platforms/GPL2897.yaml +7 -0
  131. data/install_scripts/GEO/platforms/GPL2902.yaml +7 -0
  132. data/install_scripts/GEO/platforms/GPL2987.yaml +4 -0
  133. data/install_scripts/GEO/platforms/GPL2995.yaml +7 -0
  134. data/install_scripts/GEO/platforms/GPL3039.yaml +4 -0
  135. data/install_scripts/GEO/platforms/GPL3050.yaml +7 -0
  136. data/install_scripts/GEO/platforms/GPL3084.yaml +7 -0
  137. data/install_scripts/GEO/platforms/GPL3113.yaml +7 -0
  138. data/install_scripts/GEO/platforms/GPL317.yaml +7 -0
  139. data/install_scripts/GEO/platforms/GPL319.yaml +7 -0
  140. data/install_scripts/GEO/platforms/GPL32.yaml +4 -0
  141. data/install_scripts/GEO/platforms/GPL3222.yaml +7 -0
  142. data/install_scripts/GEO/platforms/GPL3295.yaml +7 -0
  143. data/install_scripts/GEO/platforms/GPL3305.yaml +4 -0
  144. data/install_scripts/GEO/platforms/GPL3306.yaml +7 -0
  145. data/install_scripts/GEO/platforms/GPL3307.yaml +7 -0
  146. data/install_scripts/GEO/platforms/GPL333.yaml +4 -0
  147. data/install_scripts/GEO/platforms/GPL3341.yaml +7 -0
  148. data/install_scripts/GEO/platforms/GPL3349.yaml +7 -0
  149. data/install_scripts/GEO/platforms/GPL339.yaml +4 -0
  150. data/install_scripts/GEO/platforms/GPL340.yaml +4 -0
  151. data/install_scripts/GEO/platforms/GPL3408.yaml +7 -0
  152. data/install_scripts/GEO/platforms/GPL341.yaml +4 -0
  153. data/install_scripts/GEO/platforms/GPL3415.yaml +4 -0
  154. data/install_scripts/GEO/platforms/GPL3423.yaml +7 -0
  155. data/install_scripts/GEO/platforms/GPL3440.yaml +7 -0
  156. data/install_scripts/GEO/platforms/GPL3457.yaml +4 -0
  157. data/install_scripts/GEO/platforms/GPL3504.yaml +4 -0
  158. data/install_scripts/GEO/platforms/GPL3506.yaml +4 -0
  159. data/install_scripts/GEO/platforms/GPL355.yaml +7 -0
  160. data/install_scripts/GEO/platforms/GPL3558.yaml +7 -0
  161. data/install_scripts/GEO/platforms/GPL3607.yaml +7 -0
  162. data/install_scripts/GEO/platforms/GPL368.yaml +4 -0
  163. data/install_scripts/GEO/platforms/GPL3695.yaml +7 -0
  164. data/install_scripts/GEO/platforms/GPL371.yaml +7 -0
  165. data/install_scripts/GEO/platforms/GPL3834.yaml +4 -0
  166. data/install_scripts/GEO/platforms/GPL4006.yaml +7 -0
  167. data/install_scripts/GEO/platforms/GPL4055.yaml +7 -0
  168. data/install_scripts/GEO/platforms/GPL409.yaml +7 -0
  169. data/install_scripts/GEO/platforms/GPL4191.yaml +7 -0
  170. data/install_scripts/GEO/platforms/GPL4226.yaml +7 -0
  171. data/install_scripts/GEO/platforms/GPL4371.yaml +7 -0
  172. data/install_scripts/GEO/platforms/GPL4567.yaml +4 -0
  173. data/install_scripts/GEO/platforms/GPL4685.yaml +4 -0
  174. data/install_scripts/GEO/platforms/GPL483.yaml +7 -0
  175. data/install_scripts/GEO/platforms/GPL49.yaml +7 -0
  176. data/install_scripts/GEO/platforms/GPL50.yaml +7 -0
  177. data/install_scripts/GEO/platforms/GPL500.yaml +7 -0
  178. data/install_scripts/GEO/platforms/GPL507.yaml +4 -0
  179. data/install_scripts/GEO/platforms/GPL51.yaml +7 -0
  180. data/install_scripts/GEO/platforms/GPL513.yaml +7 -0
  181. data/install_scripts/GEO/platforms/GPL519.yaml +7 -0
  182. data/install_scripts/GEO/platforms/GPL52.yaml +7 -0
  183. data/install_scripts/GEO/platforms/GPL529.yaml +7 -0
  184. data/install_scripts/GEO/platforms/GPL53.yaml +7 -0
  185. data/install_scripts/GEO/platforms/GPL5356.yaml +7 -0
  186. data/install_scripts/GEO/platforms/GPL538.yaml +7 -0
  187. data/install_scripts/GEO/platforms/GPL54.yaml +7 -0
  188. data/install_scripts/GEO/platforms/GPL543.yaml +7 -0
  189. data/install_scripts/GEO/platforms/GPL544.yaml +7 -0
  190. data/install_scripts/GEO/platforms/GPL545.yaml +7 -0
  191. data/install_scripts/GEO/platforms/GPL546.yaml +7 -0
  192. data/install_scripts/GEO/platforms/GPL547.yaml +7 -0
  193. data/install_scripts/GEO/platforms/GPL549.yaml +7 -0
  194. data/install_scripts/GEO/platforms/GPL550.yaml +4 -0
  195. data/install_scripts/GEO/platforms/GPL56.yaml +7 -0
  196. data/install_scripts/GEO/platforms/GPL560.yaml +4 -0
  197. data/install_scripts/GEO/platforms/GPL564.yaml +7 -0
  198. data/install_scripts/GEO/platforms/GPL57.yaml +7 -0
  199. data/install_scripts/GEO/platforms/GPL570.yaml +4 -0
  200. data/install_scripts/GEO/platforms/GPL571.yaml +4 -0
  201. data/install_scripts/GEO/platforms/GPL576.yaml +7 -0
  202. data/install_scripts/GEO/platforms/GPL58.yaml +7 -0
  203. data/install_scripts/GEO/platforms/GPL5823.yaml +4 -0
  204. data/install_scripts/GEO/platforms/GPL59.yaml +7 -0
  205. data/install_scripts/GEO/platforms/GPL5915.yaml +4 -0
  206. data/install_scripts/GEO/platforms/GPL5947.yaml +7 -0
  207. data/install_scripts/GEO/platforms/GPL61.yaml +7 -0
  208. data/install_scripts/GEO/platforms/GPL64.yaml +7 -0
  209. data/install_scripts/GEO/platforms/GPL6419.yaml +7 -0
  210. data/install_scripts/GEO/platforms/GPL6424.yaml +7 -0
  211. data/install_scripts/GEO/platforms/GPL65.yaml +7 -0
  212. data/install_scripts/GEO/platforms/GPL6574.yaml +4 -0
  213. data/install_scripts/GEO/platforms/GPL6649.yaml +4 -0
  214. data/install_scripts/GEO/platforms/GPL67.yaml +7 -0
  215. data/install_scripts/GEO/platforms/GPL6720.yaml +7 -0
  216. data/install_scripts/GEO/platforms/GPL7054.yaml +4 -0
  217. data/install_scripts/GEO/platforms/GPL737.yaml +7 -0
  218. data/install_scripts/GEO/platforms/GPL738.yaml +7 -0
  219. data/install_scripts/GEO/platforms/GPL74.yaml +4 -0
  220. data/install_scripts/GEO/platforms/GPL75.yaml +4 -0
  221. data/install_scripts/GEO/platforms/GPL76.yaml +4 -0
  222. data/install_scripts/GEO/platforms/GPL764.yaml +7 -0
  223. data/install_scripts/GEO/platforms/GPL772.yaml +7 -0
  224. data/install_scripts/GEO/platforms/GPL782.yaml +7 -0
  225. data/install_scripts/GEO/platforms/GPL783.yaml +7 -0
  226. data/install_scripts/GEO/platforms/GPL784.yaml +7 -0
  227. data/install_scripts/GEO/platforms/GPL80.yaml +4 -0
  228. data/install_scripts/GEO/platforms/GPL81.yaml +4 -0
  229. data/install_scripts/GEO/platforms/GPL82.yaml +4 -0
  230. data/install_scripts/GEO/platforms/GPL83.yaml +4 -0
  231. data/install_scripts/GEO/platforms/GPL85.yaml +4 -0
  232. data/install_scripts/GEO/platforms/GPL86.yaml +4 -0
  233. data/install_scripts/GEO/platforms/GPL87.yaml +4 -0
  234. data/install_scripts/GEO/platforms/GPL870.yaml +7 -0
  235. data/install_scripts/GEO/platforms/GPL875.yaml +7 -0
  236. data/install_scripts/GEO/platforms/GPL884.yaml +7 -0
  237. data/install_scripts/GEO/platforms/GPL887.yaml +7 -0
  238. data/install_scripts/GEO/platforms/GPL89.yaml +4 -0
  239. data/install_scripts/GEO/platforms/GPL890.yaml +7 -0
  240. data/install_scripts/GEO/platforms/GPL891.yaml +7 -0
  241. data/install_scripts/GEO/platforms/GPL90.yaml +7 -0
  242. data/install_scripts/GEO/platforms/GPL91.yaml +4 -0
  243. data/install_scripts/GEO/platforms/GPL92.yaml +4 -0
  244. data/install_scripts/GEO/platforms/GPL920.yaml +7 -0
  245. data/install_scripts/GEO/platforms/GPL922.yaml +7 -0
  246. data/install_scripts/GEO/platforms/GPL924.yaml +7 -0
  247. data/install_scripts/GEO/platforms/GPL93.yaml +4 -0
  248. data/install_scripts/GEO/platforms/GPL96.yaml +4 -0
  249. data/install_scripts/GEO/platforms/GPL968.yaml +4 -0
  250. data/install_scripts/GEO/platforms/GPL97.yaml +4 -0
  251. data/install_scripts/GEO/platforms/GPL98.yaml +7 -0
  252. data/install_scripts/GEO/platforms/GPL981.yaml +7 -0
  253. data/install_scripts/GEO/platforms/GPL99.yaml +7 -0
  254. data/install_scripts/GEO/platforms/GPL999.yaml +7 -0
  255. data/install_scripts/GEO/series/GSE10018.yaml +61 -0
  256. data/install_scripts/GEO/series/GSE1002.yaml +135 -0
  257. data/install_scripts/GEO/series/GSE10066.yaml +31 -0
  258. data/install_scripts/GEO/series/GSE10073.yaml +19 -0
  259. data/install_scripts/GEO/series/GSE10091.yaml +15 -0
  260. data/install_scripts/GEO/series/GSE101.yaml +17 -0
  261. data/install_scripts/GEO/series/GSE10100.yaml +15 -0
  262. data/install_scripts/GEO/series/GSE10101.yaml +15 -0
  263. data/install_scripts/GEO/series/GSE10102.yaml +15 -0
  264. data/install_scripts/GEO/series/GSE10267.yaml +37 -0
  265. data/install_scripts/GEO/series/GSE10268.yaml +115 -0
  266. data/install_scripts/GEO/series/GSE10279.yaml +23 -0
  267. data/install_scripts/GEO/series/GSE103.yaml +19 -0
  268. data/install_scripts/GEO/series/GSE104.yaml +19 -0
  269. data/install_scripts/GEO/series/GSE10514.yaml +27 -0
  270. data/install_scripts/GEO/series/GSE10521.yaml +56 -0
  271. data/install_scripts/GEO/series/GSE10554.yaml +19 -0
  272. data/install_scripts/GEO/series/GSE1073.yaml +127 -0
  273. data/install_scripts/GEO/series/GSE10860.yaml +25 -0
  274. data/install_scripts/GEO/series/GSE10930.yaml +15 -0
  275. data/install_scripts/GEO/series/GSE10933.yaml +15 -0
  276. data/install_scripts/GEO/series/GSE10944.yaml +21 -0
  277. data/install_scripts/GEO/series/GSE10947.yaml +21 -0
  278. data/install_scripts/GEO/series/GSE10948.yaml +21 -0
  279. data/install_scripts/GEO/series/GSE11061.yaml +19 -0
  280. data/install_scripts/GEO/series/GSE11071.yaml +67 -0
  281. data/install_scripts/GEO/series/GSE11111.yaml +25 -0
  282. data/install_scripts/GEO/series/GSE11236.yaml +25 -0
  283. data/install_scripts/GEO/series/GSE11282.yaml +19 -0
  284. data/install_scripts/GEO/series/GSE11377.yaml +19 -0
  285. data/install_scripts/GEO/series/GSE11380.yaml +13 -0
  286. data/install_scripts/GEO/series/GSE11397.yaml +55 -0
  287. data/install_scripts/GEO/series/GSE11412.yaml +11 -0
  288. data/install_scripts/GEO/series/GSE11452.yaml +354 -0
  289. data/install_scripts/GEO/series/GSE11620.yaml +33 -0
  290. data/install_scripts/GEO/series/GSE11621.yaml +31 -0
  291. data/install_scripts/GEO/series/GSE11651.yaml +94 -0
  292. data/install_scripts/GEO/series/GSE11754.yaml +29 -0
  293. data/install_scripts/GEO/series/GSE11799.yaml +59 -0
  294. data/install_scripts/GEO/series/GSE11856.yaml +11 -0
  295. data/install_scripts/GEO/series/GSE11878.yaml +19 -0
  296. data/install_scripts/GEO/series/GSE11983.yaml +15 -0
  297. data/install_scripts/GEO/series/GSE12004.yaml +41 -0
  298. data/install_scripts/GEO/series/GSE12055.yaml +109 -0
  299. data/install_scripts/GEO/series/GSE12061.yaml +13 -0
  300. data/install_scripts/GEO/series/GSE12104.yaml +10 -0
  301. data/install_scripts/GEO/series/GSE12138.yaml +13 -0
  302. data/install_scripts/GEO/series/GSE12150.yaml +32 -0
  303. data/install_scripts/GEO/series/GSE12684.yaml +47 -0
  304. data/install_scripts/GEO/series/GSE12685.yaml +34 -0
  305. data/install_scripts/GEO/series/GSE1365.yaml +14 -0
  306. data/install_scripts/GEO/series/GSE1404.yaml +596 -0
  307. data/install_scripts/GEO/series/GSE1492.yaml +15 -0
  308. data/install_scripts/GEO/series/GSE15222.yaml +731 -0
  309. data/install_scripts/GEO/series/GSE1553.yaml +23 -0
  310. data/install_scripts/GEO/series/GSE1617.yaml +39 -0
  311. data/install_scripts/GEO/series/GSE1688.yaml +36 -0
  312. data/install_scripts/GEO/series/GSE1693.yaml +60 -0
  313. data/install_scripts/GEO/series/GSE1752.yaml +32 -0
  314. data/install_scripts/GEO/series/GSE1753.yaml +16 -0
  315. data/install_scripts/GEO/series/GSE1754.yaml +19 -0
  316. data/install_scripts/GEO/series/GSE1758.yaml +15 -0
  317. data/install_scripts/GEO/series/GSE1759.yaml +18 -0
  318. data/install_scripts/GEO/series/GSE1760.yaml +18 -0
  319. data/install_scripts/GEO/series/GSE1763.yaml +19 -0
  320. data/install_scripts/GEO/series/GSE1915.yaml +39 -0
  321. data/install_scripts/GEO/series/GSE1927.yaml +14 -0
  322. data/install_scripts/GEO/series/GSE1941.yaml +23 -0
  323. data/install_scripts/GEO/series/GSE1942.yaml +31 -0
  324. data/install_scripts/GEO/series/GSE1944.yaml +58 -0
  325. data/install_scripts/GEO/series/GSE1975.yaml +65 -0
  326. data/install_scripts/GEO/series/GSE20.yaml +24 -0
  327. data/install_scripts/GEO/series/GSE2107.yaml +14 -0
  328. data/install_scripts/GEO/series/GSE2159.yaml +31 -0
  329. data/install_scripts/GEO/series/GSE2246.yaml +157 -0
  330. data/install_scripts/GEO/series/GSE2263.yaml +57 -0
  331. data/install_scripts/GEO/series/GSE2267.yaml +155 -0
  332. data/install_scripts/GEO/series/GSE23.yaml +58 -0
  333. data/install_scripts/GEO/series/GSE2329.yaml +43 -0
  334. data/install_scripts/GEO/series/GSE2330.yaml +55 -0
  335. data/install_scripts/GEO/series/GSE2349.yaml +19 -0
  336. data/install_scripts/GEO/series/GSE2412.yaml +58 -0
  337. data/install_scripts/GEO/series/GSE2419.yaml +27 -0
  338. data/install_scripts/GEO/series/GSE2420.yaml +29 -0
  339. data/install_scripts/GEO/series/GSE2434.yaml +37 -0
  340. data/install_scripts/GEO/series/GSE2526.yaml +23 -0
  341. data/install_scripts/GEO/series/GSE2579.yaml +19 -0
  342. data/install_scripts/GEO/series/GSE2806.yaml +11 -0
  343. data/install_scripts/GEO/series/GSE2831.yaml +35 -0
  344. data/install_scripts/GEO/series/GSE2832.yaml +17 -0
  345. data/install_scripts/GEO/series/GSE29.yaml +16 -0
  346. data/install_scripts/GEO/series/GSE3006.yaml +35 -0
  347. data/install_scripts/GEO/series/GSE3043.yaml +18 -0
  348. data/install_scripts/GEO/series/GSE3122.yaml +12 -0
  349. data/install_scripts/GEO/series/GSE3130.yaml +12 -0
  350. data/install_scripts/GEO/series/GSE3151.yaml +118 -0
  351. data/install_scripts/GEO/series/GSE3160.yaml +31 -0
  352. data/install_scripts/GEO/series/GSE3190.yaml +14 -0
  353. data/install_scripts/GEO/series/GSE3205.yaml +36 -0
  354. data/install_scripts/GEO/series/GSE3206.yaml +23 -0
  355. data/install_scripts/GEO/series/GSE3315.yaml +13 -0
  356. data/install_scripts/GEO/series/GSE3335.yaml +15 -0
  357. data/install_scripts/GEO/series/GSE34.yaml +31 -0
  358. data/install_scripts/GEO/series/GSE3470.yaml +15 -0
  359. data/install_scripts/GEO/series/GSE35.yaml +80 -0
  360. data/install_scripts/GEO/series/GSE3503.yaml +19 -0
  361. data/install_scripts/GEO/series/GSE3683.yaml +83 -0
  362. data/install_scripts/GEO/series/GSE3684.yaml +19 -0
  363. data/install_scripts/GEO/series/GSE3685.yaml +31 -0
  364. data/install_scripts/GEO/series/GSE3686.yaml +63 -0
  365. data/install_scripts/GEO/series/GSE3687.yaml +83 -0
  366. data/install_scripts/GEO/series/GSE3802.yaml +19 -0
  367. data/install_scripts/GEO/series/GSE3803.yaml +19 -0
  368. data/install_scripts/GEO/series/GSE3804.yaml +19 -0
  369. data/install_scripts/GEO/series/GSE3805.yaml +19 -0
  370. data/install_scripts/GEO/series/GSE3813.yaml +9 -0
  371. data/install_scripts/GEO/series/GSE3814.yaml +71 -0
  372. data/install_scripts/GEO/series/GSE3815.yaml +75 -0
  373. data/install_scripts/GEO/series/GSE3817.yaml +13 -0
  374. data/install_scripts/GEO/series/GSE3818.yaml +15 -0
  375. data/install_scripts/GEO/series/GSE3819.yaml +13 -0
  376. data/install_scripts/GEO/series/GSE3820.yaml +61 -0
  377. data/install_scripts/GEO/series/GSE3821.yaml +55 -0
  378. data/install_scripts/GEO/series/GSE3844.yaml +11 -0
  379. data/install_scripts/GEO/series/GSE3853.yaml +31 -0
  380. data/install_scripts/GEO/series/GSE3935.yaml +12 -0
  381. data/install_scripts/GEO/series/GSE3969.yaml +14 -0
  382. data/install_scripts/GEO/series/GSE4049.yaml +80 -0
  383. data/install_scripts/GEO/series/GSE4144.yaml +9 -0
  384. data/install_scripts/GEO/series/GSE4261.yaml +59 -0
  385. data/install_scripts/GEO/series/GSE4295.yaml +63 -0
  386. data/install_scripts/GEO/series/GSE4398.yaml +50 -0
  387. data/install_scripts/GEO/series/GSE4719.yaml +76 -0
  388. data/install_scripts/GEO/series/GSE4720.yaml +78 -0
  389. data/install_scripts/GEO/series/GSE4721.yaml +14 -0
  390. data/install_scripts/GEO/series/GSE4807.yaml +67 -0
  391. data/install_scripts/GEO/series/GSE4826.yaml +39 -0
  392. data/install_scripts/GEO/series/GSE4934.yaml +23 -0
  393. data/install_scripts/GEO/series/GSE5027.yaml +31 -0
  394. data/install_scripts/GEO/series/GSE5070.yaml +25 -0
  395. data/install_scripts/GEO/series/GSE5238.yaml +31 -0
  396. data/install_scripts/GEO/series/GSE5267.yaml +55 -0
  397. data/install_scripts/GEO/series/GSE5281.yaml +492 -0
  398. data/install_scripts/GEO/series/GSE5290.yaml +24 -0
  399. data/install_scripts/GEO/series/GSE5376.yaml +107 -0
  400. data/install_scripts/GEO/series/GSE5575.yaml +13 -0
  401. data/install_scripts/GEO/series/GSE5835.yaml +25 -0
  402. data/install_scripts/GEO/series/GSE5836.yaml +37 -0
  403. data/install_scripts/GEO/series/GSE5837.yaml +37 -0
  404. data/install_scripts/GEO/series/GSE5938.yaml +187 -0
  405. data/install_scripts/GEO/series/GSE600.yaml +29 -0
  406. data/install_scripts/GEO/series/GSE6018.yaml +55 -0
  407. data/install_scripts/GEO/series/GSE6066.yaml +20 -0
  408. data/install_scripts/GEO/series/GSE6067.yaml +31 -0
  409. data/install_scripts/GEO/series/GSE6068.yaml +55 -0
  410. data/install_scripts/GEO/series/GSE6070.yaml +31 -0
  411. data/install_scripts/GEO/series/GSE6071.yaml +30 -0
  412. data/install_scripts/GEO/series/GSE6072.yaml +37 -0
  413. data/install_scripts/GEO/series/GSE6101.yaml +26 -0
  414. data/install_scripts/GEO/series/GSE6111.yaml +20 -0
  415. data/install_scripts/GEO/series/GSE6190.yaml +30 -0
  416. data/install_scripts/GEO/series/GSE6277.yaml +19 -0
  417. data/install_scripts/GEO/series/GSE6331.yaml +51 -0
  418. data/install_scripts/GEO/series/GSE6346.yaml +49 -0
  419. data/install_scripts/GEO/series/GSE6358.yaml +22 -0
  420. data/install_scripts/GEO/series/GSE6405.yaml +36 -0
  421. data/install_scripts/GEO/series/GSE6450.yaml +51 -0
  422. data/install_scripts/GEO/series/GSE6687.yaml +15 -0
  423. data/install_scripts/GEO/series/GSE6705.yaml +19 -0
  424. data/install_scripts/GEO/series/GSE6801.yaml +27 -0
  425. data/install_scripts/GEO/series/GSE6847.yaml +18 -0
  426. data/install_scripts/GEO/series/GSE6870.yaml +23 -0
  427. data/install_scripts/GEO/series/GSE7103.yaml +28 -0
  428. data/install_scripts/GEO/series/GSE7140.yaml +19 -0
  429. data/install_scripts/GEO/series/GSE7188.yaml +23 -0
  430. data/install_scripts/GEO/series/GSE7261.yaml +16 -0
  431. data/install_scripts/GEO/series/GSE7337.yaml +19 -0
  432. data/install_scripts/GEO/series/GSE7338.yaml +19 -0
  433. data/install_scripts/GEO/series/GSE7362.yaml +123 -0
  434. data/install_scripts/GEO/series/GSE7369.yaml +15 -0
  435. data/install_scripts/GEO/series/GSE7525.yaml +33 -0
  436. data/install_scripts/GEO/series/GSE7537.yaml +27 -0
  437. data/install_scripts/GEO/series/GSE7645.yaml +152 -0
  438. data/install_scripts/GEO/series/GSE7660.yaml +41 -0
  439. data/install_scripts/GEO/series/GSE7820.yaml +30 -0
  440. data/install_scripts/GEO/series/GSE79.yaml +32 -0
  441. data/install_scripts/GEO/series/GSE8035.yaml +19 -0
  442. data/install_scripts/GEO/series/GSE8088.yaml +13 -0
  443. data/install_scripts/GEO/series/GSE8089.yaml +19 -0
  444. data/install_scripts/GEO/series/GSE8111.yaml +15 -0
  445. data/install_scripts/GEO/series/GSE8237.yaml +35 -0
  446. data/install_scripts/GEO/series/GSE8326.yaml +37 -0
  447. data/install_scripts/GEO/series/GSE8399.yaml +13 -0
  448. data/install_scripts/GEO/series/GSE850.yaml +15 -0
  449. data/install_scripts/GEO/series/GSE8506.yaml +32 -0
  450. data/install_scripts/GEO/series/GSE8542.yaml +47 -0
  451. data/install_scripts/GEO/series/GSE8558.yaml +19 -0
  452. data/install_scripts/GEO/series/GSE8559.yaml +47 -0
  453. data/install_scripts/GEO/series/GSE8613.yaml +19 -0
  454. data/install_scripts/GEO/series/GSE8629.yaml +18 -0
  455. data/install_scripts/GEO/series/GSE8729.yaml +19 -0
  456. data/install_scripts/GEO/series/GSE8761.yaml +55 -0
  457. data/install_scripts/GEO/series/GSE8765.yaml +15 -0
  458. data/install_scripts/GEO/series/GSE8805.yaml +64 -0
  459. data/install_scripts/GEO/series/GSE8825.yaml +79 -0
  460. data/install_scripts/GEO/series/GSE8895.yaml +31 -0
  461. data/install_scripts/GEO/series/GSE8897.yaml +17 -0
  462. data/install_scripts/GEO/series/GSE8898.yaml +18 -0
  463. data/install_scripts/GEO/series/GSE8900.yaml +43 -0
  464. data/install_scripts/GEO/series/GSE8982.yaml +106 -0
  465. data/install_scripts/GEO/series/GSE920.yaml +20 -0
  466. data/install_scripts/GEO/series/GSE960.yaml +10 -0
  467. data/install_scripts/GEO/series/GSE961.yaml +14 -0
  468. data/install_scripts/GEO/series/GSE962.yaml +20 -0
  469. data/install_scripts/GEO/series/GSE963.yaml +14 -0
  470. data/install_scripts/GEO/series/GSE964.yaml +14 -0
  471. data/install_scripts/GEO/series/GSE965.yaml +14 -0
  472. data/install_scripts/GEO/series/GSE966.yaml +14 -0
  473. data/install_scripts/GEO/series/GSE993.yaml +9 -0
  474. data/lib/MARQ.rb +79 -0
  475. data/lib/MARQ/CustomDS.rb +99 -0
  476. data/lib/MARQ/GEO.rb +585 -0
  477. data/lib/MARQ/ID.rb +148 -0
  478. data/lib/MARQ/MADB.rb +243 -0
  479. data/lib/MARQ/annotations.rb +740 -0
  480. data/lib/MARQ/fdr.rb +177 -0
  481. data/lib/MARQ/main.rb +227 -0
  482. data/lib/MARQ/rankproduct.rb +146 -0
  483. data/lib/MARQ/score.rb +395 -0
  484. data/merb/Rakefile +35 -0
  485. data/merb/app/controllers/application.rb +2 -0
  486. data/merb/app/controllers/exceptions.rb +13 -0
  487. data/merb/app/controllers/help.rb +22 -0
  488. data/merb/app/controllers/main.rb +72 -0
  489. data/merb/app/controllers/normalize.rb +41 -0
  490. data/merb/app/controllers/results.rb +247 -0
  491. data/merb/app/controllers/series.rb +44 -0
  492. data/merb/app/helpers/global_helpers.rb +5 -0
  493. data/merb/app/helpers/main_helper.rb +5 -0
  494. data/merb/app/helpers/results_helper.rb +50 -0
  495. data/merb/app/stylesheets/marq.sass +561 -0
  496. data/merb/app/stylesheets/marq_mixins.sass +23 -0
  497. data/merb/app/stylesheets/rounded_corners.sass +35 -0
  498. data/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
  499. data/merb/app/views/exceptions/not_found.html.erb +47 -0
  500. data/merb/app/views/help/_menu.html.haml +4 -0
  501. data/merb/app/views/help/index.html.haml +110 -0
  502. data/merb/app/views/help/meth.html.haml +301 -0
  503. data/merb/app/views/help/quick.html.haml +149 -0
  504. data/merb/app/views/layout/application.html.haml +27 -0
  505. data/merb/app/views/main/index.html.haml +96 -0
  506. data/merb/app/views/normalize/index.html.haml +51 -0
  507. data/merb/app/views/partials/_annotations.html.haml +37 -0
  508. data/merb/app/views/partials/_enrichment.html.haml +17 -0
  509. data/merb/app/views/partials/_experiment.html.haml +33 -0
  510. data/merb/app/views/partials/_ie.html.haml +19 -0
  511. data/merb/app/views/partials/_video.html.haml +5 -0
  512. data/merb/app/views/results/compare.html.haml +161 -0
  513. data/merb/app/views/results/error.html.haml +5 -0
  514. data/merb/app/views/results/explore_hits.html.haml +54 -0
  515. data/merb/app/views/results/images.html.haml +18 -0
  516. data/merb/app/views/results/main.html.haml +125 -0
  517. data/merb/app/views/results/wait.html.haml +10 -0
  518. data/merb/app/views/series/main.html.haml +99 -0
  519. data/merb/autotest/discover.rb +1 -0
  520. data/merb/autotest/merb.rb +149 -0
  521. data/merb/autotest/merb_rspec.rb +165 -0
  522. data/merb/config.ru +76 -0
  523. data/merb/config/environments/development.rb +15 -0
  524. data/merb/config/environments/production.rb +10 -0
  525. data/merb/config/environments/rake.rb +11 -0
  526. data/merb/config/environments/staging.rb +10 -0
  527. data/merb/config/environments/test.rb +12 -0
  528. data/merb/config/init.rb +66 -0
  529. data/merb/config/rack.rb +11 -0
  530. data/merb/config/router.rb +64 -0
  531. data/merb/doc/rdoc/generators/merb_generator.rb +1362 -0
  532. data/merb/doc/rdoc/generators/template/merb/api_grease.js +640 -0
  533. data/merb/doc/rdoc/generators/template/merb/index.html.erb +37 -0
  534. data/merb/doc/rdoc/generators/template/merb/merb.css +252 -0
  535. data/merb/doc/rdoc/generators/template/merb/merb.rb +351 -0
  536. data/merb/doc/rdoc/generators/template/merb/merb_doc_styles.css +492 -0
  537. data/merb/doc/rdoc/generators/template/merb/prototype.js +2515 -0
  538. data/merb/lib/helper.rb +452 -0
  539. data/merb/public/favicon.ico +0 -0
  540. data/merb/public/images/guide/annotations.png +0 -0
  541. data/merb/public/images/guide/compare.png +0 -0
  542. data/merb/public/images/guide/compare_page.png +0 -0
  543. data/merb/public/images/guide/download.png +0 -0
  544. data/merb/public/images/guide/genes.png +0 -0
  545. data/merb/public/images/guide/hits.png +0 -0
  546. data/merb/public/images/guide/name.png +0 -0
  547. data/merb/public/images/guide/organism.png +0 -0
  548. data/merb/public/images/guide/table.png +0 -0
  549. data/merb/public/images/loadingAnimation.gif +0 -0
  550. data/merb/public/images/logo_ARTECS.jpg +0 -0
  551. data/merb/public/images/logo_BCU.jpg +0 -0
  552. data/merb/public/images/logo_MICRO.png +0 -0
  553. data/merb/public/images/macFFBgHack.png +0 -0
  554. data/merb/public/images/merb.jpg +0 -0
  555. data/merb/public/images/meth/G.gif +0 -0
  556. data/merb/public/images/meth/MARQ.gif +0 -0
  557. data/merb/public/images/meth/PS_bottom.gif +0 -0
  558. data/merb/public/images/meth/PS_bottom_formula.gif +0 -0
  559. data/merb/public/images/meth/PS_top.gif +0 -0
  560. data/merb/public/images/meth/PS_top_formula.gif +0 -0
  561. data/merb/public/images/meth/Q.gif +0 -0
  562. data/merb/public/images/meth/Rplot.png +0 -0
  563. data/merb/public/images/meth/S_bottom.gif +0 -0
  564. data/merb/public/images/meth/S_diff.gif +0 -0
  565. data/merb/public/images/meth/S_down.gif +0 -0
  566. data/merb/public/images/meth/S_top.gif +0 -0
  567. data/merb/public/images/meth/S_up.gif +0 -0
  568. data/merb/public/images/meth/alpha.gif +0 -0
  569. data/merb/public/images/meth/beta_0.gif +0 -0
  570. data/merb/public/images/meth/beta_1.gif +0 -0
  571. data/merb/public/images/meth/d.gif +0 -0
  572. data/merb/public/images/meth/d_formula.gif +0 -0
  573. data/merb/public/images/meth/d_noabs.gif +0 -0
  574. data/merb/public/images/meth/d_range.gif +0 -0
  575. data/merb/public/images/meth/g.gif +0 -0
  576. data/merb/public/images/meth/i.gif +0 -0
  577. data/merb/public/images/meth/m.gif +0 -0
  578. data/merb/public/images/meth/p.gif +0 -0
  579. data/merb/public/images/meth/penalty.gif +0 -0
  580. data/merb/public/images/meth/q.gif +0 -0
  581. data/merb/public/images/meth/w.gif +0 -0
  582. data/merb/public/images/meth/w_formula.gif +0 -0
  583. data/merb/public/images/meth/w_weight.gif +0 -0
  584. data/merb/public/images/meth/weight.gif +0 -0
  585. data/merb/public/images/meth/weight_function.gif +0 -0
  586. data/merb/public/images/top.png +0 -0
  587. data/merb/public/images/top2.png +0 -0
  588. data/merb/public/images/wait.gif +0 -0
  589. data/merb/public/javascripts/jquery-ui.core.js +519 -0
  590. data/merb/public/javascripts/jquery-ui.hitarea.js +168 -0
  591. data/merb/public/javascripts/jquery.js +19 -0
  592. data/merb/public/javascripts/jquery.scrollTo.js +11 -0
  593. data/merb/public/javascripts/jquery.tablescroll.js +124 -0
  594. data/merb/public/javascripts/jquery.tabs.js +642 -0
  595. data/merb/public/javascripts/marq.js +51 -0
  596. data/merb/public/javascripts/marq_pages.js +504 -0
  597. data/merb/public/javascripts/thickbox.js +320 -0
  598. data/merb/public/javascripts/wz_jsgraphics.js +1108 -0
  599. data/merb/public/merb.fcgi +22 -0
  600. data/merb/public/plugins/dialog/javascripts/jquery-ui.dialog.js +44 -0
  601. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  602. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  603. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  604. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  605. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  606. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  607. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  608. data/merb/public/plugins/dialog/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  609. data/merb/public/plugins/dialog/stylesheets/images/ui-icons_222222_256x240.png +0 -0
  610. data/merb/public/plugins/dialog/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
  611. data/merb/public/plugins/dialog/stylesheets/images/ui-icons_454545_256x240.png +0 -0
  612. data/merb/public/plugins/dialog/stylesheets/images/ui-icons_888888_256x240.png +0 -0
  613. data/merb/public/plugins/dialog/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
  614. data/merb/public/plugins/dialog/stylesheets/jquery-ui.dialog.css +404 -0
  615. data/merb/public/plugins/tablesorter/images/asc.gif +0 -0
  616. data/merb/public/plugins/tablesorter/images/bg.gif +0 -0
  617. data/merb/public/plugins/tablesorter/images/blue.zip +0 -0
  618. data/merb/public/plugins/tablesorter/images/desc.gif +0 -0
  619. data/merb/public/plugins/tablesorter/javascripts/jquery.tablesorter.js +2 -0
  620. data/merb/public/plugins/tablesorter/stylesheets/jquery.tablesorter.css +39 -0
  621. data/merb/public/robots.txt +5 -0
  622. data/merb/public/stylesheets/thickbox.css +163 -0
  623. data/merb/spec/requests/main_spec.rb +7 -0
  624. data/merb/spec/requests/results_spec.rb +7 -0
  625. data/merb/spec/spec.opts +0 -0
  626. data/merb/spec/spec_helper.rb +20 -0
  627. data/merb/tasks/merb.thor/app_script.rb +31 -0
  628. data/merb/tasks/merb.thor/common.rb +68 -0
  629. data/merb/tasks/merb.thor/gem_ext.rb +125 -0
  630. data/merb/tasks/merb.thor/main.thor +150 -0
  631. data/merb/tasks/merb.thor/ops.rb +93 -0
  632. data/merb/tasks/merb.thor/utils.rb +40 -0
  633. data/tasks/install.rake +21 -0
  634. data/webservice/MARQWS.rb +167 -0
  635. metadata +798 -0
@@ -0,0 +1,1362 @@
1
+
2
+ # # We're responsible for generating all the HTML files
3
+ # from the object tree defined in code_objects.rb. We
4
+ # generate:
5
+ #
6
+ # [files] an html file for each input file given. These
7
+ # input files appear as objects of class
8
+ # TopLevel
9
+ #
10
+ # [classes] an html file for each class or module encountered.
11
+ # These classes are not grouped by file: if a file
12
+ # contains four classes, we'll generate an html
13
+ # file for the file itself, and four html files
14
+ # for the individual classes.
15
+ #
16
+ # Method descriptions appear in whatever entity (file, class,
17
+ # or module) that contains them.
18
+ #
19
+ # We generate files in a structure below a specified subdirectory,
20
+ # normally +doc+.
21
+ #
22
+ # opdir
23
+ # |
24
+ # |___ files
25
+ # | |__ per file summaries
26
+ # |
27
+ # |___ classes
28
+ # |__ per class/module descriptions
29
+ #
30
+ # HTML is generated using the Template class.
31
+ #
32
+
33
+ require 'ftools'
34
+
35
+ require 'rdoc/options'
36
+ require 'rdoc/template'
37
+ require 'rdoc/markup/simple_markup'
38
+ require 'rdoc/markup/simple_markup/to_html'
39
+ require 'cgi'
40
+
41
+ module Generators
42
+
43
+ # Name of sub-direcories that hold file and class/module descriptions
44
+
45
+ FILE_DIR = "files"
46
+ CLASS_DIR = "classes"
47
+ CSS_NAME = "stylesheet.css"
48
+
49
+
50
+ ##
51
+ # Build a hash of all items that can be cross-referenced.
52
+ # This is used when we output required and included names:
53
+ # if the names appear in this hash, we can generate
54
+ # an html cross reference to the appropriate description.
55
+ # We also use this when parsing comment blocks: any decorated
56
+ # words matching an entry in this list are hyperlinked.
57
+
58
+ class AllReferences
59
+ @@refs = {}
60
+
61
+ def AllReferences::reset
62
+ @@refs = {}
63
+ end
64
+
65
+ def AllReferences.add(name, html_class)
66
+ @@refs[name] = html_class
67
+ end
68
+
69
+ def AllReferences.[](name)
70
+ @@refs[name]
71
+ end
72
+
73
+ def AllReferences.keys
74
+ @@refs.keys
75
+ end
76
+ end
77
+
78
+
79
+ ##
80
+ # Subclass of the SM::ToHtml class that supports looking
81
+ # up words in the AllReferences list. Those that are
82
+ # found (like AllReferences in this comment) will
83
+ # be hyperlinked
84
+
85
+ class HyperlinkHtml < SM::ToHtml
86
+ # We need to record the html path of our caller so we can generate
87
+ # correct relative paths for any hyperlinks that we find
88
+ def initialize(from_path, context)
89
+ super()
90
+ @from_path = from_path
91
+
92
+ @parent_name = context.parent_name
93
+ @parent_name += "::" if @parent_name
94
+ @context = context
95
+ end
96
+
97
+ # We're invoked when any text matches the CROSSREF pattern
98
+ # (defined in MarkUp). If we fine the corresponding reference,
99
+ # generate a hyperlink. If the name we're looking for contains
100
+ # no punctuation, we look for it up the module/class chain. For
101
+ # example, HyperlinkHtml is found, even without the Generators::
102
+ # prefix, because we look for it in module Generators first.
103
+
104
+ def handle_special_CROSSREF(special)
105
+ name = special.text
106
+ if name[0,1] == '#'
107
+ lookup = name[1..-1]
108
+ name = lookup unless Options.instance.show_hash
109
+ else
110
+ lookup = name
111
+ end
112
+
113
+ if /([A-Z].*)[.\#](.*)/ =~ lookup
114
+ container = $1
115
+ method = $2
116
+ ref = @context.find_symbol(container, method)
117
+ else
118
+ ref = @context.find_symbol(lookup)
119
+ end
120
+
121
+ if ref and ref.document_self
122
+ "<a href=\"index.html?a=#{ref.aref}&name=#{name}\">#{name}</a>"
123
+ else
124
+ name #it does not need to be a link
125
+ end
126
+ end
127
+
128
+
129
+ # Generate a hyperlink for url, labeled with text. Handle the
130
+ # special cases for img: and link: described under handle_special_HYPEDLINK
131
+ def gen_url(url, text)
132
+ if url =~ /([A-Za-z]+):(.*)/
133
+ type = $1
134
+ path = $2
135
+ else
136
+ type = "http"
137
+ path = url
138
+ url = "http://#{url}"
139
+ end
140
+
141
+ if type == "link"
142
+ url = path
143
+ end
144
+
145
+ if (type == "http" || type == "link") && url =~ /\.(gif|png|jpg|jpeg|bmp)$/
146
+ "<img src=\"#{url}\">"
147
+ elsif (type == "http" || type == "link")
148
+ "<a href=\"#{url}\" target=\"_blank\">#{text}</a>"
149
+ else
150
+ "<a href=\"#\" onclick=\"jsHref('#{url}');\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
151
+
152
+ end
153
+ end
154
+
155
+ # And we're invoked with a potential external hyperlink mailto:
156
+ # just gets inserted. http: links are checked to see if they
157
+ # reference an image. If so, that image gets inserted using an
158
+ # <img> tag. Otherwise a conventional <a href> is used. We also
159
+ # support a special type of hyperlink, link:, which is a reference
160
+ # to a local file whose path is relative to the --op directory.
161
+
162
+ def handle_special_HYPERLINK(special)
163
+ url = special.text
164
+ gen_url(url, url)
165
+ end
166
+
167
+ # HEre's a hypedlink where the label is different to the URL
168
+ # <label>[url]
169
+ #
170
+
171
+ def handle_special_TIDYLINK(special)
172
+ text = special.text
173
+ # unless text =~ /(\S+)\[(.*?)\]/
174
+ unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/
175
+ return text
176
+ end
177
+ label = $1
178
+ url = $2
179
+ gen_url(url, label)
180
+ end
181
+
182
+ end
183
+
184
+
185
+
186
+ #####################################################################
187
+ #
188
+ # Handle common markup tasks for the various Html classes
189
+ #
190
+
191
+ module MarkUp
192
+
193
+ # Convert a string in markup format into HTML. We keep a cached
194
+ # SimpleMarkup object lying around after the first time we're
195
+ # called per object.
196
+
197
+ def markup(str, remove_para=false)
198
+ return '' unless str
199
+ unless defined? @markup
200
+ @markup = SM::SimpleMarkup.new
201
+
202
+ # class names, variable names, file names, or instance variables
203
+ @markup.add_special(/(
204
+ \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth
205
+ | \b([A-Z]\w+(::\w+)*) # A::B..
206
+ | \#\w+[!?=]? # #meth_name
207
+ | \b\w+([_\/\.]+\w+)+[!?=]? # meth_name
208
+ )/x, :CROSSREF)
209
+
210
+ # external hyperlinks
211
+ @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
212
+
213
+ # and links of the form <text>[<url>]
214
+ @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
215
+ # @markup.add_special(/\b(\S+?\[\S+?\.\S+?\])/, :TIDYLINK)
216
+
217
+ end
218
+ unless defined? @html_formatter
219
+ @html_formatter = HyperlinkHtml.new(self.path, self)
220
+ end
221
+
222
+ # Convert leading comment markers to spaces, but only
223
+ # if all non-blank lines have them
224
+
225
+ if str =~ /^(?>\s*)[^\#]/
226
+ content = str
227
+ else
228
+ content = str.gsub(/^\s*(#+)/) { $1.tr('#',' ') }
229
+ end
230
+
231
+ res = @markup.convert(content, @html_formatter)
232
+ if remove_para
233
+ res.sub!(/^<p>/, '')
234
+ res.sub!(/<\/p>$/, '')
235
+ end
236
+ res
237
+ end
238
+
239
+
240
+ def style_url(path, css_name=nil)
241
+ css_name ||= CSS_NAME
242
+ end
243
+
244
+ # Build a webcvs URL with the given 'url' argument. URLs with a '%s' in them
245
+ # get the file's path sprintfed into them; otherwise they're just catenated
246
+ # together.
247
+
248
+ def cvs_url(url, full_path)
249
+ if /%s/ =~ url
250
+ return sprintf( url, full_path )
251
+ else
252
+ return url + full_path
253
+ end
254
+ end
255
+ end
256
+
257
+
258
+ #####################################################################
259
+ #
260
+ # A Context is built by the parser to represent a container: contexts
261
+ # hold classes, modules, methods, require lists and include lists.
262
+ # ClassModule and TopLevel are the context objects we process here
263
+ #
264
+ class ContextUser
265
+
266
+ include MarkUp
267
+
268
+ attr_reader :context
269
+
270
+ def initialize(context, options)
271
+ @context = context
272
+ @options = options
273
+
274
+ end
275
+
276
+ # convenience method to build a hyperlink # Where's the DRY in this?? Put this in the template where it belongs
277
+ def href(link, cls, name)
278
+ %{"<a href=\"#\" onclick=\"jsHref('#{link}');\" class=\"#{cls}\">#{name}</a>"}
279
+ end
280
+
281
+ # Create a list of HtmlMethod objects for each method
282
+ # in the corresponding context object. If the @options.show_all
283
+ # variable is set (corresponding to the <tt>--all</tt> option,
284
+ # we include all methods, otherwise just the public ones.
285
+
286
+ def collect_methods
287
+ list = @context.method_list
288
+ unless @options.show_all
289
+ list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
290
+ end
291
+ @methods = list.collect {|m| HtmlMethod.new(m, self, @options) }
292
+ end
293
+
294
+ # Build a summary list of all the methods in this context
295
+ def build_method_summary_list(path_prefix="")
296
+ collect_methods unless @methods
297
+ meths = @methods.sort
298
+ res = []
299
+ meths.each do |meth|
300
+ res << {
301
+ "name" => CGI.escapeHTML(meth.name),
302
+ "aref" => meth.aref,
303
+ "href" => meth.path
304
+ }
305
+ end
306
+ res
307
+ end
308
+
309
+
310
+ # Build a list of aliases for which we couldn't find a
311
+ # corresponding method
312
+ def build_alias_summary_list(section)
313
+ values = []
314
+ @context.aliases.each do |al|
315
+ next unless al.section == section
316
+ res = {
317
+ 'old_name' => al.old_name,
318
+ 'new_name' => al.new_name,
319
+ }
320
+ if al.comment && !al.comment.empty?
321
+ res['desc'] = markup(al.comment, true)
322
+ end
323
+ values << res
324
+ end
325
+ values
326
+ end
327
+
328
+ # Build a list of constants
329
+ def build_constants_summary_list(section)
330
+ values = []
331
+ @context.constants.each do |co|
332
+ next unless co.section == section
333
+ res = {
334
+ 'name' => co.name,
335
+ 'value' => CGI.escapeHTML(co.value)
336
+ }
337
+ res['desc'] = markup(co.comment, true) if co.comment && !co.comment.empty?
338
+ values << res
339
+ end
340
+ values
341
+ end
342
+
343
+ def build_requires_list(context)
344
+ potentially_referenced_list(context.requires) {|fn| [fn + ".rb"] }
345
+ end
346
+
347
+ def build_include_list(context)
348
+ potentially_referenced_list(context.includes)
349
+ end
350
+
351
+ # Build a list from an array of <i>Htmlxxx</i> items. Look up each
352
+ # in the AllReferences hash: if we find a corresponding entry,
353
+ # we generate a hyperlink to it, otherwise just output the name.
354
+ # However, some names potentially need massaging. For example,
355
+ # you may require a Ruby file without the .rb extension,
356
+ # but the file names we know about may have it. To deal with
357
+ # this, we pass in a block which performs the massaging,
358
+ # returning an array of alternative names to match
359
+
360
+ def potentially_referenced_list(array)
361
+ res = []
362
+ array.each do |i|
363
+ ref = AllReferences[i.name]
364
+ # if !ref
365
+ # container = @context.parent
366
+ # while !ref && container
367
+ # name = container.name + "::" + i.name
368
+ # ref = AllReferences[name]
369
+ # container = container.parent
370
+ # end
371
+ # end
372
+
373
+ ref = @context.find_symbol(i.name)
374
+ ref = ref.viewer if ref
375
+
376
+ if !ref && block_given?
377
+ possibles = yield(i.name)
378
+ while !ref and !possibles.empty?
379
+ ref = AllReferences[possibles.shift]
380
+ end
381
+ end
382
+ h_name = CGI.escapeHTML(i.name)
383
+ if ref and ref.document_self
384
+ path = ref.path
385
+ res << { "name" => h_name, "href" => path }
386
+ else
387
+ res << { "name" => h_name, "href" => "" }
388
+ end
389
+ end
390
+ res
391
+ end
392
+
393
+ # Build an array of arrays of method details. The outer array has up
394
+ # to six entries, public, private, and protected for both class
395
+ # methods, the other for instance methods. The inner arrays contain
396
+ # a hash for each method
397
+
398
+ def build_method_detail_list(section)
399
+ outer = []
400
+
401
+ methods = @methods.sort
402
+ for singleton in [true, false]
403
+ for vis in [ :public, :protected, :private ]
404
+ res = []
405
+ methods.each do |m|
406
+ if m.section == section and
407
+ m.document_self and
408
+ m.visibility == vis and
409
+ m.singleton == singleton
410
+ row = {}
411
+ if m.call_seq
412
+ row["callseq"] = m.call_seq.gsub(/->/, '&rarr;')
413
+ else
414
+ row["name"] = CGI.escapeHTML(m.name)
415
+ row["params"] = m.params
416
+ end
417
+ desc = m.description.strip
418
+ row["m_desc"] = desc unless desc.empty?
419
+ row["aref"] = m.aref
420
+ row["href"] = m.path
421
+ row["m_seq"] = m.seq
422
+ row["visibility"] = m.visibility.to_s
423
+
424
+ alias_names = []
425
+ m.aliases.each do |other|
426
+ if other.viewer # won't be if the alias is private
427
+ alias_names << {
428
+ 'name' => other.name,
429
+ 'href' => other.viewer.path,
430
+ 'aref' => other.viewer.aref
431
+ }
432
+ end
433
+ end
434
+ unless alias_names.empty?
435
+ row["aka"] = alias_names
436
+ end
437
+
438
+ #if @options.inline_source
439
+ code = m.source_code
440
+ row["sourcecode"] = code if code
441
+ #else
442
+ # code = m.src_url
443
+ #if code
444
+ # row["codeurl"] = code
445
+ # row["imgurl"] = m.img_url
446
+ #end
447
+ #end
448
+ res << row
449
+ end
450
+ end
451
+ if res.size > 0
452
+ outer << {
453
+ "type" => vis.to_s.capitalize,
454
+ "category" => singleton ? "Class" : "Instance",
455
+ "methods" => res
456
+ }
457
+ end
458
+ end
459
+ end
460
+ outer
461
+ end
462
+
463
+ # Build the structured list of classes and modules contained
464
+ # in this context.
465
+
466
+ def build_class_list(level, from, section, infile=nil)
467
+ res = ""
468
+ prefix = "&nbsp;&nbsp;::" * level;
469
+
470
+ from.modules.sort.each do |mod|
471
+ next unless mod.section == section
472
+ next if infile && !mod.defined_in?(infile)
473
+ if mod.document_self
474
+ res <<
475
+ prefix <<
476
+ "Module " <<
477
+ href(mod.viewer.path, "link", mod.full_name) <<
478
+ "<br />\n" <<
479
+ build_class_list(level + 1, mod, section, infile)
480
+ end
481
+ end
482
+
483
+ from.classes.sort.each do |cls|
484
+ next unless cls.section == section
485
+ next if infile && !cls.defined_in?(infile)
486
+ if cls.document_self
487
+ res <<
488
+ prefix <<
489
+ "Class " <<
490
+ href(cls.viewer.path, "link", cls.full_name) <<
491
+ "<br />\n" <<
492
+ build_class_list(level + 1, cls, section, infile)
493
+ end
494
+ end
495
+
496
+ res
497
+ end
498
+
499
+ def document_self
500
+ @context.document_self
501
+ end
502
+
503
+ def diagram_reference(diagram)
504
+ res = diagram.gsub(/((?:src|href)=")(.*?)"/) {
505
+ $1 + $2 + '"'
506
+ }
507
+ res
508
+ end
509
+
510
+
511
+ # Find a symbol in ourselves or our parent
512
+ def find_symbol(symbol, method=nil)
513
+ res = @context.find_symbol(symbol, method)
514
+ if res
515
+ res = res.viewer
516
+ end
517
+ res
518
+ end
519
+
520
+ # create table of contents if we contain sections
521
+
522
+ def add_table_of_sections
523
+ toc = []
524
+ @context.sections.each do |section|
525
+ if section.title
526
+ toc << {
527
+ 'secname' => section.title,
528
+ 'href' => section.sequence
529
+ }
530
+ end
531
+ end
532
+
533
+ @values['toc'] = toc unless toc.empty?
534
+ end
535
+
536
+
537
+ end
538
+
539
+ #####################################################################
540
+ #
541
+ # Wrap a ClassModule context
542
+
543
+ class HtmlClass < ContextUser
544
+
545
+ @@c_seq = "C00000000"
546
+
547
+ attr_reader :path
548
+
549
+ def initialize(context, html_file, prefix, options)
550
+ super(context, options)
551
+ @@c_seq = @@c_seq.succ
552
+ @c_seq = @@c_seq
553
+ @html_file = html_file
554
+ @is_module = context.is_module?
555
+ @values = {}
556
+
557
+ context.viewer = self
558
+
559
+ @path = http_url(context.full_name, prefix)
560
+
561
+ collect_methods
562
+
563
+ AllReferences.add(name, self)
564
+ end
565
+
566
+ # return the relative file name to store this class in,
567
+ # which is also its url
568
+ def http_url(full_name, prefix)
569
+ path = full_name.dup
570
+ if path['<<']
571
+ path.gsub!(/<<\s*(\w*)/) { "from-#$1" }
572
+ end
573
+ File.join(prefix, path.split("::")) + ".html"
574
+ end
575
+
576
+ def seq
577
+ @c_seq
578
+ end
579
+
580
+ def aref
581
+ @c_seq
582
+ end
583
+
584
+ def scope
585
+ a = @context.full_name.split("::")
586
+ if a.length > 1
587
+ a.pop
588
+ a.join("::")
589
+ else
590
+ ""
591
+ end
592
+ end
593
+
594
+ def name
595
+ @context.full_name.gsub("#{scope}::", '')
596
+ end
597
+
598
+ def full_name
599
+ @context.full_name
600
+ end
601
+
602
+ def parent_name
603
+ @context.parent.full_name
604
+ end
605
+
606
+ def write_on(f)
607
+ value_hash
608
+ template = TemplatePage.new(RDoc::Page::BODY,
609
+ RDoc::Page::CLASS_PAGE,
610
+ RDoc::Page::METHOD_LIST)
611
+ template.write_html_on(f, @values)
612
+ end
613
+
614
+ def value_hash
615
+ class_attribute_values
616
+ add_table_of_sections
617
+
618
+ @values["charset"] = @options.charset
619
+ @values["style_url"] = style_url(path, @options.css)
620
+
621
+ # Convert README to html
622
+ unless File.exist?('files/README.html')
623
+ File.open('files/README.html', 'w') do |file|
624
+ file << markup(File.read(File.expand_path(@options.main_page)))
625
+ end
626
+ end
627
+
628
+ d = markup(@context.comment)
629
+ @values["description"] = d unless d.empty?
630
+
631
+ ml = build_method_summary_list
632
+ @values["methods"] = ml unless ml.empty?
633
+
634
+ il = build_include_list(@context)
635
+ @values["includes"] = il unless il.empty?
636
+
637
+ @values["sections"] = @context.sections.map do |section|
638
+
639
+ secdata = {
640
+ "sectitle" => section.title,
641
+ "secsequence" => section.sequence,
642
+ "seccomment" => markup(section.comment)
643
+ }
644
+
645
+ al = build_alias_summary_list(section)
646
+ secdata["aliases"] = al unless al.empty?
647
+
648
+ co = build_constants_summary_list(section)
649
+ secdata["constants"] = co unless co.empty?
650
+
651
+ al = build_attribute_list(section)
652
+ secdata["attributes"] = al unless al.empty?
653
+
654
+ cl = build_class_list(0, @context, section)
655
+ secdata["classlist"] = cl unless cl.empty?
656
+
657
+ mdl = build_method_detail_list(section)
658
+ secdata["method_list"] = mdl unless mdl.empty?
659
+
660
+ secdata
661
+ end
662
+
663
+ @values
664
+ end
665
+
666
+ def build_attribute_list(section)
667
+ atts = @context.attributes.sort
668
+ res = []
669
+ atts.each do |att|
670
+ next unless att.section == section
671
+ if att.visibility == :public || att.visibility == :protected || @options.show_all
672
+ entry = {
673
+ "name" => CGI.escapeHTML(att.name),
674
+ "rw" => att.rw,
675
+ "a_desc" => markup(att.comment, true)
676
+ }
677
+ unless att.visibility == :public || att.visibility == :protected
678
+ entry["rw"] << "-"
679
+ end
680
+ res << entry
681
+ end
682
+ end
683
+ res
684
+ end
685
+
686
+ def class_attribute_values
687
+ h_name = CGI.escapeHTML(name)
688
+
689
+ @values["classmod"] = @is_module ? "Module" : "Class"
690
+ @values["title"] = "#{@values['classmod']}: #{h_name}"
691
+
692
+ c = @context
693
+ c = c.parent while c and !c.diagram
694
+ if c && c.diagram
695
+ @values["diagram"] = diagram_reference(c.diagram)
696
+ end
697
+
698
+ @values["full_name"] = h_name
699
+ @values["class_seq"] = seq
700
+ parent_class = @context.superclass
701
+
702
+ if parent_class
703
+ @values["parent"] = CGI.escapeHTML(parent_class)
704
+
705
+ if parent_name
706
+ lookup = parent_name + "::" + parent_class
707
+ else
708
+ lookup = parent_class
709
+ end
710
+
711
+ parent_url = AllReferences[lookup] || AllReferences[parent_class]
712
+
713
+ if parent_url and parent_url.document_self
714
+ @values["par_url"] = parent_url.path
715
+ end
716
+ end
717
+
718
+ files = []
719
+ @context.in_files.each do |f|
720
+ res = {}
721
+ full_path = CGI.escapeHTML(f.file_absolute_name)
722
+
723
+ res["full_path"] = full_path
724
+ res["full_path_url"] = f.viewer.path if f.document_self
725
+
726
+ if @options.webcvs
727
+ res["cvsurl"] = cvs_url( @options.webcvs, full_path )
728
+ end
729
+
730
+ files << res
731
+ end
732
+
733
+ @values['infiles'] = files
734
+ end
735
+
736
+ def <=>(other)
737
+ self.name <=> other.name
738
+ end
739
+
740
+ end
741
+
742
+ #####################################################################
743
+ #
744
+ # Handles the mapping of a file's information to HTML. In reality,
745
+ # a file corresponds to a +TopLevel+ object, containing modules,
746
+ # classes, and top-level methods. In theory it _could_ contain
747
+ # attributes and aliases, but we ignore these for now.
748
+
749
+ class HtmlFile < ContextUser
750
+
751
+ @@f_seq = "F00000000"
752
+
753
+ attr_reader :path
754
+ attr_reader :name
755
+
756
+ def initialize(context, options, file_dir)
757
+ super(context, options)
758
+ @@f_seq = @@f_seq.succ
759
+ @f_seq = @@f_seq
760
+ @values = {}
761
+
762
+ @path = http_url(file_dir)
763
+ @source_file_path = File.expand_path(@context.file_relative_name).gsub("\/doc\/", "/")
764
+ @name = @context.file_relative_name
765
+
766
+ collect_methods
767
+ AllReferences.add(name, self)
768
+ context.viewer = self
769
+ end
770
+
771
+ def http_url(file_dir)
772
+ File.join(file_dir, @context.file_relative_name.tr('.', '_')) + ".html"
773
+ end
774
+
775
+ def filename_to_label
776
+ @context.file_relative_name.gsub(/%|\/|\?|\#/) {|s| '%' + ("%x" % s[0]) }
777
+ end
778
+
779
+ def seq
780
+ @f_seq
781
+ end
782
+
783
+ def aref
784
+ @f_seq
785
+ end
786
+
787
+ def name
788
+ full_path = @context.file_absolute_name
789
+ short_name = File.basename(full_path)
790
+ end
791
+
792
+ def full_name
793
+ @context.file_absolute_name
794
+ end
795
+
796
+ def scope
797
+ @context.file_relative_name.gsub(/\/#{name}$/, '')
798
+ end
799
+
800
+ def parent_name
801
+ nil
802
+ end
803
+
804
+ def full_file_source
805
+ ret_str = ""
806
+ File.open(@source_file_path, 'r') do |f|
807
+ while(!f.eof?) do
808
+ ret_str += f.readline()
809
+ end
810
+ end
811
+ ret_str
812
+ rescue
813
+ "file not found -#{@source_file_path}-"
814
+ #@source_file_path
815
+ end
816
+
817
+ def value_hash
818
+ file_attribute_values
819
+ add_table_of_sections
820
+
821
+ @values["charset"] = @options.charset
822
+ @values["href"] = path
823
+ @values["style_url"] = style_url(path, @options.css)
824
+ @values["file_seq"] = seq
825
+
826
+ #pulling in the source for this file
827
+ #@values["source_code"] = @context.token_stream
828
+
829
+ @values["file_source_code"] = CGI.escapeHTML(full_file_source)
830
+
831
+ if @context.comment
832
+ d = markup(@context.comment)
833
+ @values["description"] = d if d.size > 0
834
+ end
835
+
836
+ ml = build_method_summary_list
837
+ @values["methods"] = ml unless ml.empty?
838
+
839
+ il = build_include_list(@context)
840
+ @values["includes"] = il unless il.empty?
841
+
842
+ rl = build_requires_list(@context)
843
+ @values["requires"] = rl unless rl.empty?
844
+
845
+
846
+ file_context = @context
847
+
848
+ @values["sections"] = @context.sections.map do |section|
849
+
850
+ secdata = {
851
+ "sectitle" => section.title,
852
+ "secsequence" => section.sequence,
853
+ "seccomment" => markup(section.comment)
854
+ }
855
+
856
+ cl = build_class_list(0, @context, section, file_context)
857
+ @values["classlist"] = cl unless cl.empty?
858
+
859
+ mdl = build_method_detail_list(section)
860
+ secdata["method_list"] = mdl unless mdl.empty?
861
+
862
+ al = build_alias_summary_list(section)
863
+ secdata["aliases"] = al unless al.empty?
864
+
865
+ co = build_constants_summary_list(section)
866
+ @values["constants"] = co unless co.empty?
867
+
868
+ secdata
869
+ end
870
+
871
+ @values
872
+ end
873
+
874
+ def write_on(f)
875
+ value_hash
876
+ template = TemplatePage.new(RDoc::Page::SRC_BODY,RDoc::Page::FILE_PAGE, RDoc::Page::METHOD_LIST)
877
+ template.write_html_on(f, @values)
878
+ end
879
+
880
+ def file_attribute_values
881
+ full_path = @context.file_absolute_name
882
+ short_name = File.basename(full_path)
883
+
884
+ @values["title"] = CGI.escapeHTML("File: #{short_name}")
885
+
886
+ if @context.diagram
887
+ @values["diagram"] = diagram_reference(@context.diagram)
888
+ end
889
+
890
+ @values["short_name"] = CGI.escapeHTML(short_name)
891
+ @values["full_path"] = CGI.escapeHTML(full_path)
892
+ @values["dtm_modified"] = @context.file_stat.mtime.to_s
893
+
894
+ if @options.webcvs
895
+ @values["cvsurl"] = cvs_url( @options.webcvs, @values["full_path"] )
896
+ end
897
+ end
898
+
899
+ def <=>(other)
900
+ self.name <=> other.name
901
+ end
902
+ end
903
+
904
+ #####################################################################
905
+
906
+ class HtmlMethod
907
+ include MarkUp
908
+
909
+ attr_reader :context
910
+ attr_reader :src_url
911
+ attr_reader :img_url
912
+ attr_reader :source_code
913
+
914
+ @@m_seq = "M000000"
915
+
916
+ @@all_methods = []
917
+
918
+ def HtmlMethod::reset
919
+ @@all_methods = []
920
+ end
921
+
922
+ def initialize(context, html_class, options)
923
+ @context = context
924
+ @html_class = html_class
925
+ @options = options
926
+ @@m_seq = @@m_seq.succ
927
+ @m_seq = @@m_seq
928
+ @@all_methods << self
929
+
930
+ context.viewer = self
931
+
932
+ if (ts = @context.token_stream)
933
+ @source_code = markup_code(ts)
934
+ #unless @options.inline_source
935
+ # @src_url = create_source_code_file(@source_code)
936
+ # @img_url = MERBGenerator.gen_url(path, 'source.png')
937
+ #end
938
+ end
939
+ AllReferences.add(name, self)
940
+ end
941
+
942
+ def seq
943
+ @m_seq
944
+ end
945
+
946
+ def aref
947
+ @m_seq
948
+ end
949
+
950
+ def scope
951
+ @html_class.full_name
952
+ end
953
+
954
+ # return a reference to outselves to be used as an href=
955
+ # the form depends on whether we're all in one file
956
+ # or in multiple files
957
+
958
+ def name
959
+ @context.name
960
+ end
961
+
962
+ def section
963
+ @context.section
964
+ end
965
+
966
+ def parent_name
967
+ if @context.parent.parent
968
+ @context.parent.parent.full_name
969
+ else
970
+ nil
971
+ end
972
+ end
973
+
974
+ def path
975
+ @html_class.path
976
+ end
977
+
978
+ def description
979
+ markup(@context.comment)
980
+ end
981
+
982
+ def visibility
983
+ @context.visibility
984
+ end
985
+
986
+ def singleton
987
+ @context.singleton
988
+ end
989
+
990
+ def call_seq
991
+ cs = @context.call_seq
992
+ if cs
993
+ cs.gsub(/\n/, "<br />\n")
994
+ else
995
+ nil
996
+ end
997
+ end
998
+
999
+ def params
1000
+ # params coming from a call-seq in 'C' will start with the
1001
+ # method name
1002
+ p = @context.params
1003
+ if p !~ /^\w/
1004
+ p = @context.params.gsub(/\s*\#.*/, '')
1005
+ p = p.tr("\n", " ").squeeze(" ")
1006
+ p = "(" + p + ")" unless p[0] == ?(
1007
+
1008
+ if (block = @context.block_params)
1009
+ # If this method has explicit block parameters, remove any
1010
+ # explicit &block
1011
+
1012
+ p.sub!(/,?\s*&\w+/, '')
1013
+
1014
+ block.gsub!(/\s*\#.*/, '')
1015
+ block = block.tr("\n", " ").squeeze(" ")
1016
+ if block[0] == ?(
1017
+ block.sub!(/^\(/, '').sub!(/\)/, '')
1018
+ end
1019
+ p << " {|#{block.strip}| ...}"
1020
+ end
1021
+ end
1022
+ CGI.escapeHTML(p)
1023
+ end
1024
+
1025
+ def create_source_code_file(code_body)
1026
+ meth_path = @html_class.path.sub(/\.html$/, '.src')
1027
+ File.makedirs(meth_path)
1028
+ file_path = File.join(meth_path, seq) + ".html"
1029
+
1030
+ template = TemplatePage.new(RDoc::Page::SRC_PAGE)
1031
+ File.open(file_path, "w") do |f|
1032
+ values = {
1033
+ 'title' => CGI.escapeHTML(name),
1034
+ 'code' => code_body,
1035
+ 'style_url' => style_url(file_path, @options.css),
1036
+ 'charset' => @options.charset
1037
+ }
1038
+ template.write_html_on(f, values)
1039
+ end
1040
+ file_path
1041
+ end
1042
+
1043
+ def HtmlMethod.all_methods
1044
+ @@all_methods
1045
+ end
1046
+
1047
+ def <=>(other)
1048
+ @context <=> other.context
1049
+ end
1050
+
1051
+ ##
1052
+ # Given a sequence of source tokens, mark up the source code
1053
+ # to make it look purty.
1054
+
1055
+
1056
+ def markup_code(tokens)
1057
+ src = ""
1058
+ tokens.each do |t|
1059
+ next unless t
1060
+ # p t.class
1061
+ # style = STYLE_MAP[t.class]
1062
+ style = case t
1063
+ when RubyToken::TkCONSTANT then "ruby-constant"
1064
+ when RubyToken::TkKW then "ruby-keyword kw"
1065
+ when RubyToken::TkIVAR then "ruby-ivar"
1066
+ when RubyToken::TkOp then "ruby-operator"
1067
+ when RubyToken::TkId then "ruby-identifier"
1068
+ when RubyToken::TkNode then "ruby-node"
1069
+ when RubyToken::TkCOMMENT then "ruby-comment cmt"
1070
+ when RubyToken::TkREGEXP then "ruby-regexp re"
1071
+ when RubyToken::TkSTRING then "ruby-value str"
1072
+ when RubyToken::TkVal then "ruby-value"
1073
+ else
1074
+ nil
1075
+ end
1076
+
1077
+ text = CGI.escapeHTML(t.text)
1078
+
1079
+ if style
1080
+ src << "<span class=\"#{style}\">#{text}</span>"
1081
+ else
1082
+ src << text
1083
+ end
1084
+ end
1085
+
1086
+ add_line_numbers(src)
1087
+ src
1088
+ end
1089
+
1090
+ # we rely on the fact that the first line of a source code
1091
+ # listing has
1092
+ # # File xxxxx, line dddd
1093
+
1094
+ def add_line_numbers(src)
1095
+ if src =~ /\A.*, line (\d+)/
1096
+ first = $1.to_i - 1
1097
+ last = first + src.count("\n")
1098
+ size = last.to_s.length
1099
+ real_fmt = "%#{size}d: "
1100
+ fmt = " " * (size+2)
1101
+ src.gsub!(/^/) do
1102
+ res = sprintf(fmt, first)
1103
+ first += 1
1104
+ fmt = real_fmt
1105
+ res
1106
+ end
1107
+ end
1108
+ end
1109
+
1110
+ def document_self
1111
+ @context.document_self
1112
+ end
1113
+
1114
+ def aliases
1115
+ @context.aliases
1116
+ end
1117
+
1118
+ def find_symbol(symbol, method=nil)
1119
+ res = @context.parent.find_symbol(symbol, method)
1120
+ if res
1121
+ res = res.viewer
1122
+ end
1123
+ res
1124
+ end
1125
+ end
1126
+
1127
+ #####################################################################
1128
+
1129
+ class MERBGenerator
1130
+
1131
+ include MarkUp
1132
+
1133
+ # Generators may need to return specific subclasses depending
1134
+ # on the options they are passed. Because of this
1135
+ # we create them using a factory
1136
+
1137
+ def MERBGenerator.for(options)
1138
+ AllReferences::reset
1139
+ HtmlMethod::reset
1140
+
1141
+ MERBGenerator.new(options)
1142
+
1143
+ end
1144
+
1145
+ class <<self
1146
+ protected :new
1147
+ end
1148
+
1149
+ # Set up a new HTML generator. Basically all we do here is load
1150
+ # up the correct output temlate
1151
+
1152
+ def initialize(options) #:not-new:
1153
+ @options = options
1154
+ load_html_template
1155
+ end
1156
+
1157
+
1158
+ ##
1159
+ # Build the initial indices and output objects
1160
+ # based on an array of TopLevel objects containing
1161
+ # the extracted information.
1162
+
1163
+ def generate(toplevels)
1164
+ @toplevels = toplevels
1165
+ @files = []
1166
+ @classes = []
1167
+
1168
+ write_style_sheet
1169
+ write_javascript
1170
+ gen_sub_directories()
1171
+ build_indices
1172
+ generate_html
1173
+ end
1174
+
1175
+ private
1176
+
1177
+ ##
1178
+ # Load up the AJAX HTML template specified in the options.
1179
+ # If the template name contains a slash, use it literally
1180
+ #
1181
+ def load_html_template
1182
+ template = @options.template
1183
+ unless template =~ %r{/|\\}
1184
+ template = File.join("rdoc/generators/template", @options.generator.key, template)
1185
+ end
1186
+ require template
1187
+ extend RDoc::Page
1188
+ rescue LoadError
1189
+ $stderr.puts "Could not find AJAX template '#{template}'"
1190
+ exit 99
1191
+ end
1192
+
1193
+ ##
1194
+ # Write out the style sheet used by the main frames
1195
+ #
1196
+
1197
+ def write_style_sheet
1198
+ template = TemplatePage.new(RDoc::Page::STYLE)
1199
+ File.open(CSS_NAME, "w") do |f|
1200
+ values = { "font" => "helvetica"} #this is not used anywhere but the template function demands a hash of values
1201
+ template.write_html_on(f, values)
1202
+ end
1203
+ end
1204
+
1205
+ def write_javascript
1206
+ #Argh... I couldn't figure out how to copy these from the template dir so they were copied into
1207
+ # the template file "ajax.rb" and processed similarlly to the style sheets. Not exactly a good thing to do with
1208
+ # external library code. Not very DRY.
1209
+
1210
+ File.open("api_grease.js", "w") do |f|
1211
+ f << RDoc::Page::API_GREASE_JS
1212
+ end
1213
+
1214
+ File.open("prototype.js", "w") do |f|
1215
+ f << RDoc::Page::PROTOTYPE_JS
1216
+ end
1217
+
1218
+ rescue LoadError
1219
+ $stderr.puts "Could not find AJAX template"
1220
+ exit 99
1221
+ end
1222
+
1223
+ ##
1224
+ # See the comments at the top for a description of the
1225
+ # directory structure
1226
+
1227
+ def gen_sub_directories
1228
+ File.makedirs(FILE_DIR, CLASS_DIR)
1229
+ rescue
1230
+ $stderr.puts $!.message
1231
+ exit 1
1232
+ end
1233
+
1234
+ ##
1235
+ # Generate:
1236
+ #
1237
+ # * a list of HtmlFile objects for each TopLevel object.
1238
+ # * a list of HtmlClass objects for each first level
1239
+ # class or module in the TopLevel objects
1240
+ # * a complete list of all hyperlinkable terms (file,
1241
+ # class, module, and method names)
1242
+
1243
+ def build_indices
1244
+
1245
+ @toplevels.each do |toplevel|
1246
+ @files << HtmlFile.new(toplevel, @options, FILE_DIR)
1247
+ end
1248
+
1249
+ RDoc::TopLevel.all_classes_and_modules.each do |cls|
1250
+ build_class_list(cls, @files[0], CLASS_DIR)
1251
+ end
1252
+ end
1253
+
1254
+ def build_class_list(from, html_file, class_dir)
1255
+ @classes << HtmlClass.new(from, html_file, class_dir, @options)
1256
+ from.each_classmodule do |mod|
1257
+ build_class_list(mod, html_file, class_dir)
1258
+ end
1259
+ end
1260
+
1261
+ ##
1262
+ # Generate all the HTML
1263
+ #
1264
+ def generate_html
1265
+ # the individual descriptions for files and classes
1266
+ gen_into(@files)
1267
+ gen_into(@classes)
1268
+ # and the index files
1269
+ gen_file_index
1270
+ gen_class_index
1271
+ gen_method_index
1272
+ gen_main_index
1273
+
1274
+ # this method is defined in the template file
1275
+ write_extra_pages if defined? write_extra_pages
1276
+ end
1277
+
1278
+ def gen_into(list)
1279
+ list.each do |item|
1280
+ if item.document_self
1281
+ op_file = item.path
1282
+ File.makedirs(File.dirname(op_file))
1283
+ File.open(op_file, "w") { |file| item.write_on(file) }
1284
+ end
1285
+ end
1286
+
1287
+ end
1288
+
1289
+ def gen_file_index
1290
+ gen_an_index(@files, 'Files',
1291
+ RDoc::Page::FILE_INDEX,
1292
+ "fr_file_index.html")
1293
+ end
1294
+
1295
+ def gen_class_index
1296
+ gen_an_index(@classes, 'Classes',
1297
+ RDoc::Page::CLASS_INDEX,
1298
+ "fr_class_index.html")
1299
+ end
1300
+
1301
+ def gen_method_index
1302
+ gen_an_index(HtmlMethod.all_methods, 'Methods',
1303
+ RDoc::Page::METHOD_INDEX,
1304
+ "fr_method_index.html")
1305
+ end
1306
+
1307
+
1308
+ def gen_an_index(collection, title, template, filename)
1309
+ template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
1310
+ res = []
1311
+ collection.sort.each do |f|
1312
+ if f.document_self
1313
+ res << { "href" => f.path, "name" => f.name, "scope" => f.scope, "seq_id" => f.seq }
1314
+ end
1315
+ end
1316
+
1317
+ values = {
1318
+ "entries" => res,
1319
+ 'list_title' => CGI.escapeHTML(title),
1320
+ 'index_url' => main_url,
1321
+ 'charset' => @options.charset,
1322
+ 'style_url' => style_url('', @options.css),
1323
+ }
1324
+
1325
+ File.open(filename, "w") do |f|
1326
+ template.write_html_on(f, values)
1327
+ end
1328
+ end
1329
+
1330
+ # The main index page is mostly a template frameset, but includes
1331
+ # the initial page. If the <tt>--main</tt> option was given,
1332
+ # we use this as our main page, otherwise we use the
1333
+ # first file specified on the command line.
1334
+
1335
+ def gen_main_index
1336
+ template = TemplatePage.new(RDoc::Page::INDEX)
1337
+ File.open("index.html", "w") do |f|
1338
+ tStr = ""
1339
+ #File.open(main_url, 'r') do |g|
1340
+ # tStr = markup(g)
1341
+ #end
1342
+ values = {
1343
+ "initial_page" => tStr,
1344
+ 'title' => CGI.escapeHTML(@options.title),
1345
+ 'charset' => @options.charset,
1346
+ 'content' => File.read('files/README.html')
1347
+ }
1348
+
1349
+ values['inline_source'] = true
1350
+ template.write_html_on(f, values)
1351
+ end
1352
+ end
1353
+
1354
+ # return the url of the main page
1355
+ def main_url
1356
+ "files/README.html"
1357
+ end
1358
+
1359
+
1360
+ end
1361
+
1362
+ end