rottenegg 1.2.5.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (374) hide show
  1. data/.gitignore +7 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +14 -0
  4. data/README.rdoc +47 -0
  5. data/Rakefile +2 -0
  6. data/bin/rottenegg +4 -0
  7. data/bin/rottenegg_gen +55 -0
  8. data/lib/rotten_egg.rb +14 -0
  9. data/lib/rotten_egg/app_setting.rb +76 -0
  10. data/lib/rotten_egg/application.rb +299 -0
  11. data/lib/rotten_egg/message_logger.rb +36 -0
  12. data/lib/rotten_egg/scm.rb +229 -0
  13. data/lib/rotten_egg/server.rb +238 -0
  14. data/lib/rotten_egg/user.rb +30 -0
  15. data/lib/rotten_egg/util.rb +381 -0
  16. data/lib/rotten_egg/version.rb +4 -0
  17. data/public/javascripts/extjs4/bootstrap.js +58 -0
  18. data/public/javascripts/extjs4/ext-all.js +7 -0
  19. data/public/javascripts/extjs4/ext.js +7 -0
  20. data/public/javascripts/extjs4/resources/css/ext-all.css +1 -0
  21. data/public/javascripts/extjs4/resources/themes/images/default/boundlist/trigger-arrow.png +0 -0
  22. data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-corners.gif +0 -0
  23. data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-corners.gif +0 -0
  24. data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-sides.gif +0 -0
  25. data/public/javascripts/extjs4/resources/themes/images/default/btn-group/btn-group-default-framed-sides.gif +0 -0
  26. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-bg.gif +0 -0
  27. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-corners.gif +0 -0
  28. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-bg.gif +0 -0
  29. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-corners.gif +0 -0
  30. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-disabled-sides.gif +0 -0
  31. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-bg.gif +0 -0
  32. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-corners.gif +0 -0
  33. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-focus-sides.gif +0 -0
  34. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-bg.gif +0 -0
  35. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-corners.gif +0 -0
  36. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-over-sides.gif +0 -0
  37. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-bg.gif +0 -0
  38. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-corners.gif +0 -0
  39. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-pressed-sides.gif +0 -0
  40. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-large-sides.gif +0 -0
  41. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-bg.gif +0 -0
  42. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-corners.gif +0 -0
  43. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-bg.gif +0 -0
  44. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-corners.gif +0 -0
  45. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-disabled-sides.gif +0 -0
  46. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-bg.gif +0 -0
  47. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-corners.gif +0 -0
  48. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-focus-sides.gif +0 -0
  49. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-bg.gif +0 -0
  50. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-corners.gif +0 -0
  51. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-over-sides.gif +0 -0
  52. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-bg.gif +0 -0
  53. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-corners.gif +0 -0
  54. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-pressed-sides.gif +0 -0
  55. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-medium-sides.gif +0 -0
  56. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-bg.gif +0 -0
  57. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-corners.gif +0 -0
  58. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-bg.gif +0 -0
  59. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-corners.gif +0 -0
  60. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-disabled-sides.gif +0 -0
  61. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-bg.gif +0 -0
  62. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-corners.gif +0 -0
  63. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-focus-sides.gif +0 -0
  64. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-bg.gif +0 -0
  65. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-corners.gif +0 -0
  66. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-over-sides.gif +0 -0
  67. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-bg.gif +0 -0
  68. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-corners.gif +0 -0
  69. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-pressed-sides.gif +0 -0
  70. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-small-sides.gif +0 -0
  71. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-corners.gif +0 -0
  72. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-corners.gif +0 -0
  73. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-sides.gif +0 -0
  74. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-bg.gif +0 -0
  75. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-corners.gif +0 -0
  76. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-focus-sides.gif +0 -0
  77. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-bg.gif +0 -0
  78. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-corners.gif +0 -0
  79. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-over-sides.gif +0 -0
  80. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-bg.gif +0 -0
  81. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-corners.gif +0 -0
  82. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-sides.gif +0 -0
  83. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-large-sides.gif +0 -0
  84. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-corners.gif +0 -0
  85. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-corners.gif +0 -0
  86. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-sides.gif +0 -0
  87. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-bg.gif +0 -0
  88. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-corners.gif +0 -0
  89. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-sides.gif +0 -0
  90. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-bg.gif +0 -0
  91. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-corners.gif +0 -0
  92. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-over-sides.gif +0 -0
  93. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-bg.gif +0 -0
  94. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-corners.gif +0 -0
  95. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-sides.gif +0 -0
  96. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-medium-sides.gif +0 -0
  97. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-corners.gif +0 -0
  98. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-corners.gif +0 -0
  99. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-sides.gif +0 -0
  100. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-bg.gif +0 -0
  101. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-corners.gif +0 -0
  102. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-sides.gif +0 -0
  103. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-bg.gif +0 -0
  104. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-corners.gif +0 -0
  105. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-over-sides.gif +0 -0
  106. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-bg.gif +0 -0
  107. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-corners.gif +0 -0
  108. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-sides.gif +0 -0
  109. data/public/javascripts/extjs4/resources/themes/images/default/btn/btn-default-toolbar-small-sides.gif +0 -0
  110. data/public/javascripts/extjs4/resources/themes/images/default/button/arrow.gif +0 -0
  111. data/public/javascripts/extjs4/resources/themes/images/default/button/btn.gif +0 -0
  112. data/public/javascripts/extjs4/resources/themes/images/default/button/group-cs.gif +0 -0
  113. data/public/javascripts/extjs4/resources/themes/images/default/button/group-lr.gif +0 -0
  114. data/public/javascripts/extjs4/resources/themes/images/default/button/group-tb.gif +0 -0
  115. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-b-noline.gif +0 -0
  116. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-b.gif +0 -0
  117. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-bo.gif +0 -0
  118. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-light.gif +0 -0
  119. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-noline.gif +0 -0
  120. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow-o.gif +0 -0
  121. data/public/javascripts/extjs4/resources/themes/images/default/button/s-arrow.gif +0 -0
  122. data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-footer-bg.gif +0 -0
  123. data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-footer-bg.png +0 -0
  124. data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-header-bg.gif +0 -0
  125. data/public/javascripts/extjs4/resources/themes/images/default/datepicker/datepicker-header-bg.png +0 -0
  126. data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-add.gif +0 -0
  127. data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-no.gif +0 -0
  128. data/public/javascripts/extjs4/resources/themes/images/default/dd/drop-yes.gif +0 -0
  129. data/public/javascripts/extjs4/resources/themes/images/default/editor/tb-sprite.gif +0 -0
  130. data/public/javascripts/extjs4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-corners.gif +0 -0
  131. data/public/javascripts/extjs4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-sides.gif +0 -0
  132. data/public/javascripts/extjs4/resources/themes/images/default/form/checkbox.gif +0 -0
  133. data/public/javascripts/extjs4/resources/themes/images/default/form/clear-trigger.gif +0 -0
  134. data/public/javascripts/extjs4/resources/themes/images/default/form/date-trigger.gif +0 -0
  135. data/public/javascripts/extjs4/resources/themes/images/default/form/error-tip-corners.gif +0 -0
  136. data/public/javascripts/extjs4/resources/themes/images/default/form/exclamation.gif +0 -0
  137. data/public/javascripts/extjs4/resources/themes/images/default/form/radio.gif +0 -0
  138. data/public/javascripts/extjs4/resources/themes/images/default/form/search-trigger.gif +0 -0
  139. data/public/javascripts/extjs4/resources/themes/images/default/form/spinner-small.gif +0 -0
  140. data/public/javascripts/extjs4/resources/themes/images/default/form/spinner.gif +0 -0
  141. data/public/javascripts/extjs4/resources/themes/images/default/form/text-bg.gif +0 -0
  142. data/public/javascripts/extjs4/resources/themes/images/default/form/trigger-square.gif +0 -0
  143. data/public/javascripts/extjs4/resources/themes/images/default/form/trigger-tpl.gif +0 -0
  144. data/public/javascripts/extjs4/resources/themes/images/default/form/trigger.gif +0 -0
  145. data/public/javascripts/extjs4/resources/themes/images/default/grid/arrow-left-white.gif +0 -0
  146. data/public/javascripts/extjs4/resources/themes/images/default/grid/arrow-right-white.gif +0 -0
  147. data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-bg.gif +0 -0
  148. data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-bg.png +0 -0
  149. data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-selected-bg.gif +0 -0
  150. data/public/javascripts/extjs4/resources/themes/images/default/grid/cell-special-selected-bg.png +0 -0
  151. data/public/javascripts/extjs4/resources/themes/images/default/grid/checked.gif +0 -0
  152. data/public/javascripts/extjs4/resources/themes/images/default/grid/col-move-bottom.gif +0 -0
  153. data/public/javascripts/extjs4/resources/themes/images/default/grid/col-move-top.gif +0 -0
  154. data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-bg.gif +0 -0
  155. data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-bg.png +0 -0
  156. data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-over-bg.gif +0 -0
  157. data/public/javascripts/extjs4/resources/themes/images/default/grid/column-header-over-bg.png +0 -0
  158. data/public/javascripts/extjs4/resources/themes/images/default/grid/columns.gif +0 -0
  159. data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-left.gif +0 -0
  160. data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-left.png +0 -0
  161. data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-right.gif +0 -0
  162. data/public/javascripts/extjs4/resources/themes/images/default/grid/dd-insert-arrow-right.png +0 -0
  163. data/public/javascripts/extjs4/resources/themes/images/default/grid/dirty.gif +0 -0
  164. data/public/javascripts/extjs4/resources/themes/images/default/grid/done.gif +0 -0
  165. data/public/javascripts/extjs4/resources/themes/images/default/grid/drop-no.gif +0 -0
  166. data/public/javascripts/extjs4/resources/themes/images/default/grid/drop-yes.gif +0 -0
  167. data/public/javascripts/extjs4/resources/themes/images/default/grid/footer-bg.gif +0 -0
  168. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-blue-hd.gif +0 -0
  169. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-blue-split.gif +0 -0
  170. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-hrow.gif +0 -0
  171. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-loading.gif +0 -0
  172. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-split.gif +0 -0
  173. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid-vista-hd.gif +0 -0
  174. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hd-btn.gif +0 -0
  175. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hrow-over.gif +0 -0
  176. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-hrow.gif +0 -0
  177. data/public/javascripts/extjs4/resources/themes/images/default/grid/grid3-rowheader.gif +0 -0
  178. data/public/javascripts/extjs4/resources/themes/images/default/grid/group-by.gif +0 -0
  179. data/public/javascripts/extjs4/resources/themes/images/default/grid/group-collapse.gif +0 -0
  180. data/public/javascripts/extjs4/resources/themes/images/default/grid/group-expand-sprite.gif +0 -0
  181. data/public/javascripts/extjs4/resources/themes/images/default/grid/group-expand.gif +0 -0
  182. data/public/javascripts/extjs4/resources/themes/images/default/grid/hd-pop.gif +0 -0
  183. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-asc.gif +0 -0
  184. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-desc.gif +0 -0
  185. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-lock.gif +0 -0
  186. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-lock.png +0 -0
  187. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-unlock.gif +0 -0
  188. data/public/javascripts/extjs4/resources/themes/images/default/grid/hmenu-unlock.png +0 -0
  189. data/public/javascripts/extjs4/resources/themes/images/default/grid/invalid_line.gif +0 -0
  190. data/public/javascripts/extjs4/resources/themes/images/default/grid/loading.gif +0 -0
  191. data/public/javascripts/extjs4/resources/themes/images/default/grid/mso-hd.gif +0 -0
  192. data/public/javascripts/extjs4/resources/themes/images/default/grid/nowait.gif +0 -0
  193. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-first-disabled.gif +0 -0
  194. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-first.gif +0 -0
  195. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-last-disabled.gif +0 -0
  196. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-last.gif +0 -0
  197. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-next-disabled.gif +0 -0
  198. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-next.gif +0 -0
  199. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-prev-disabled.gif +0 -0
  200. data/public/javascripts/extjs4/resources/themes/images/default/grid/page-prev.gif +0 -0
  201. data/public/javascripts/extjs4/resources/themes/images/default/grid/pick-button.gif +0 -0
  202. data/public/javascripts/extjs4/resources/themes/images/default/grid/property-cell-bg.gif +0 -0
  203. data/public/javascripts/extjs4/resources/themes/images/default/grid/property-cell-selected-bg.gif +0 -0
  204. data/public/javascripts/extjs4/resources/themes/images/default/grid/refresh-disabled.gif +0 -0
  205. data/public/javascripts/extjs4/resources/themes/images/default/grid/refresh.gif +0 -0
  206. data/public/javascripts/extjs4/resources/themes/images/default/grid/row-check-sprite.gif +0 -0
  207. data/public/javascripts/extjs4/resources/themes/images/default/grid/row-expand-sprite.gif +0 -0
  208. data/public/javascripts/extjs4/resources/themes/images/default/grid/row-over.gif +0 -0
  209. data/public/javascripts/extjs4/resources/themes/images/default/grid/row-sel.gif +0 -0
  210. data/public/javascripts/extjs4/resources/themes/images/default/grid/sort-hd.gif +0 -0
  211. data/public/javascripts/extjs4/resources/themes/images/default/grid/sort_asc.gif +0 -0
  212. data/public/javascripts/extjs4/resources/themes/images/default/grid/sort_desc.gif +0 -0
  213. data/public/javascripts/extjs4/resources/themes/images/default/grid/unchecked.gif +0 -0
  214. data/public/javascripts/extjs4/resources/themes/images/default/grid/wait.gif +0 -0
  215. data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-bottom.gif +0 -0
  216. data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-left.gif +0 -0
  217. data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-right.gif +0 -0
  218. data/public/javascripts/extjs4/resources/themes/images/default/layout/mini-top.gif +0 -0
  219. data/public/javascripts/extjs4/resources/themes/images/default/menu/checked.gif +0 -0
  220. data/public/javascripts/extjs4/resources/themes/images/default/menu/group-checked.gif +0 -0
  221. data/public/javascripts/extjs4/resources/themes/images/default/menu/item-over.gif +0 -0
  222. data/public/javascripts/extjs4/resources/themes/images/default/menu/menu-parent.gif +0 -0
  223. data/public/javascripts/extjs4/resources/themes/images/default/menu/menu.gif +0 -0
  224. data/public/javascripts/extjs4/resources/themes/images/default/menu/unchecked.gif +0 -0
  225. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-bottom-bg.gif +0 -0
  226. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-bg.gif +0 -0
  227. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-corners.gif +0 -0
  228. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-sides.gif +0 -0
  229. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-bg.gif +0 -0
  230. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-corners.gif +0 -0
  231. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-sides.gif +0 -0
  232. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-bg.gif +0 -0
  233. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-corners.gif +0 -0
  234. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-sides.gif +0 -0
  235. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-bg.gif +0 -0
  236. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-corners.gif +0 -0
  237. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-sides.gif +0 -0
  238. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-bg.gif +0 -0
  239. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-corners.gif +0 -0
  240. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-sides.gif +0 -0
  241. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-bg.gif +0 -0
  242. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-corners.gif +0 -0
  243. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-left-sides.gif +0 -0
  244. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-bg.gif +0 -0
  245. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-corners.gif +0 -0
  246. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-right-sides.gif +0 -0
  247. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-bg.gif +0 -0
  248. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-corners.gif +0 -0
  249. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-framed-top-sides.gif +0 -0
  250. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-left-bg.gif +0 -0
  251. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-right-bg.gif +0 -0
  252. data/public/javascripts/extjs4/resources/themes/images/default/panel-header/panel-header-default-top-bg.gif +0 -0
  253. data/public/javascripts/extjs4/resources/themes/images/default/panel/panel-default-framed-corners.gif +0 -0
  254. data/public/javascripts/extjs4/resources/themes/images/default/panel/panel-default-framed-sides.gif +0 -0
  255. data/public/javascripts/extjs4/resources/themes/images/default/progress/progress-default-bg.gif +0 -0
  256. data/public/javascripts/extjs4/resources/themes/images/default/shared/blue-loading.gif +0 -0
  257. data/public/javascripts/extjs4/resources/themes/images/default/shared/calendar.gif +0 -0
  258. data/public/javascripts/extjs4/resources/themes/images/default/shared/glass-bg.gif +0 -0
  259. data/public/javascripts/extjs4/resources/themes/images/default/shared/hd-sprite.gif +0 -0
  260. data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-error.gif +0 -0
  261. data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-info.gif +0 -0
  262. data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-question.gif +0 -0
  263. data/public/javascripts/extjs4/resources/themes/images/default/shared/icon-warning.gif +0 -0
  264. data/public/javascripts/extjs4/resources/themes/images/default/shared/large-loading.gif +0 -0
  265. data/public/javascripts/extjs4/resources/themes/images/default/shared/left-btn.gif +0 -0
  266. data/public/javascripts/extjs4/resources/themes/images/default/shared/loading-balls.gif +0 -0
  267. data/public/javascripts/extjs4/resources/themes/images/default/shared/right-btn.gif +0 -0
  268. data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow-c.png +0 -0
  269. data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow-lr.png +0 -0
  270. data/public/javascripts/extjs4/resources/themes/images/default/shared/shadow.png +0 -0
  271. data/public/javascripts/extjs4/resources/themes/images/default/shared/warning.gif +0 -0
  272. data/public/javascripts/extjs4/resources/themes/images/default/sizer/e-handle-dark.gif +0 -0
  273. data/public/javascripts/extjs4/resources/themes/images/default/sizer/e-handle.gif +0 -0
  274. data/public/javascripts/extjs4/resources/themes/images/default/sizer/ne-handle-dark.gif +0 -0
  275. data/public/javascripts/extjs4/resources/themes/images/default/sizer/ne-handle.gif +0 -0
  276. data/public/javascripts/extjs4/resources/themes/images/default/sizer/nw-handle-dark.gif +0 -0
  277. data/public/javascripts/extjs4/resources/themes/images/default/sizer/nw-handle.gif +0 -0
  278. data/public/javascripts/extjs4/resources/themes/images/default/sizer/s-handle-dark.gif +0 -0
  279. data/public/javascripts/extjs4/resources/themes/images/default/sizer/s-handle.gif +0 -0
  280. data/public/javascripts/extjs4/resources/themes/images/default/sizer/se-handle-dark.gif +0 -0
  281. data/public/javascripts/extjs4/resources/themes/images/default/sizer/se-handle.gif +0 -0
  282. data/public/javascripts/extjs4/resources/themes/images/default/sizer/square.gif +0 -0
  283. data/public/javascripts/extjs4/resources/themes/images/default/sizer/sw-handle-dark.gif +0 -0
  284. data/public/javascripts/extjs4/resources/themes/images/default/sizer/sw-handle.gif +0 -0
  285. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-bg.gif +0 -0
  286. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-bg.png +0 -0
  287. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-thumb.gif +0 -0
  288. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-thumb.png +0 -0
  289. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-bg.gif +0 -0
  290. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-bg.png +0 -0
  291. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-thumb.gif +0 -0
  292. data/public/javascripts/extjs4/resources/themes/images/default/slider/slider-v-thumb.png +0 -0
  293. data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/scroll-left.gif +0 -0
  294. data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/scroll-right.gif +0 -0
  295. data/public/javascripts/extjs4/resources/themes/images/default/tab-bar/tab-bar-default-bg.gif +0 -0
  296. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-bg.gif +0 -0
  297. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-corners.gif +0 -0
  298. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-active-sides.gif +0 -0
  299. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-bg.gif +0 -0
  300. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-corners.gif +0 -0
  301. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-bg.gif +0 -0
  302. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-corners.gif +0 -0
  303. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-disabled-sides.gif +0 -0
  304. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-bg.gif +0 -0
  305. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-corners.gif +0 -0
  306. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-over-sides.gif +0 -0
  307. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-bottom-sides.gif +0 -0
  308. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-close.gif +0 -0
  309. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-bg.gif +0 -0
  310. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-corners.gif +0 -0
  311. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-active-sides.gif +0 -0
  312. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-bg.gif +0 -0
  313. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-corners.gif +0 -0
  314. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-bg.gif +0 -0
  315. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-corners.gif +0 -0
  316. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-disabled-sides.gif +0 -0
  317. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-bg.gif +0 -0
  318. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-corners.gif +0 -0
  319. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-over-sides.gif +0 -0
  320. data/public/javascripts/extjs4/resources/themes/images/default/tab/tab-default-top-sides.gif +0 -0
  321. data/public/javascripts/extjs4/resources/themes/images/default/tip/tip-corners.gif +0 -0
  322. data/public/javascripts/extjs4/resources/themes/images/default/tip/tip-sides.gif +0 -0
  323. data/public/javascripts/extjs4/resources/themes/images/default/toolbar/more.gif +0 -0
  324. data/public/javascripts/extjs4/resources/themes/images/default/toolbar/scroll-left.gif +0 -0
  325. data/public/javascripts/extjs4/resources/themes/images/default/toolbar/scroll-right.gif +0 -0
  326. data/public/javascripts/extjs4/resources/themes/images/default/toolbar/toolbar-default-bg.gif +0 -0
  327. data/public/javascripts/extjs4/resources/themes/images/default/tools/tool-sprite-tpl.gif +0 -0
  328. data/public/javascripts/extjs4/resources/themes/images/default/tools/tool-sprites.gif +0 -0
  329. data/public/javascripts/extjs4/resources/themes/images/default/tools/tools-sprites-trans.gif +0 -0
  330. data/public/javascripts/extjs4/resources/themes/images/default/tree/arrows.gif +0 -0
  331. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-above.gif +0 -0
  332. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-add.gif +0 -0
  333. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-append.gif +0 -0
  334. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-below.gif +0 -0
  335. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-between.gif +0 -0
  336. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-no.gif +0 -0
  337. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-over.gif +0 -0
  338. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-under.gif +0 -0
  339. data/public/javascripts/extjs4/resources/themes/images/default/tree/drop-yes.gif +0 -0
  340. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-minus-nl.gif +0 -0
  341. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-minus.gif +0 -0
  342. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-plus-nl.gif +0 -0
  343. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end-plus.gif +0 -0
  344. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-end.gif +0 -0
  345. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-line.gif +0 -0
  346. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-minus-nl.gif +0 -0
  347. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-minus.gif +0 -0
  348. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-plus-nl.gif +0 -0
  349. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow-plus.gif +0 -0
  350. data/public/javascripts/extjs4/resources/themes/images/default/tree/elbow.gif +0 -0
  351. data/public/javascripts/extjs4/resources/themes/images/default/tree/folder-open.gif +0 -0
  352. data/public/javascripts/extjs4/resources/themes/images/default/tree/folder.gif +0 -0
  353. data/public/javascripts/extjs4/resources/themes/images/default/tree/leaf.gif +0 -0
  354. data/public/javascripts/extjs4/resources/themes/images/default/tree/loading.gif +0 -0
  355. data/public/javascripts/extjs4/resources/themes/images/default/tree/s.gif +0 -0
  356. data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-bottom.gif +0 -0
  357. data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-left.gif +0 -0
  358. data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-right.gif +0 -0
  359. data/public/javascripts/extjs4/resources/themes/images/default/util/splitter/mini-top.gif +0 -0
  360. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-bottom-corners.gif +0 -0
  361. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-bottom-sides.gif +0 -0
  362. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-left-corners.gif +0 -0
  363. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-left-sides.gif +0 -0
  364. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-right-corners.gif +0 -0
  365. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-right-sides.gif +0 -0
  366. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-top-corners.gif +0 -0
  367. data/public/javascripts/extjs4/resources/themes/images/default/window-header/window-header-default-top-sides.gif +0 -0
  368. data/public/javascripts/extjs4/resources/themes/images/default/window/window-default-corners.gif +0 -0
  369. data/public/javascripts/extjs4/resources/themes/images/default/window/window-default-sides.gif +0 -0
  370. data/rotten_egg.gemspec +36 -0
  371. data/views/index.haml +490 -0
  372. data/views/layout.haml +8 -0
  373. data/views/session/login.haml +108 -0
  374. metadata +537 -0
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+ module RottenEgg
3
+ class User
4
+ @@users = {}
5
+ attr_accessor :id
6
+ attr_reader :name
7
+
8
+ def initialize(name="rotten")
9
+ @name = name
10
+ @id = 14720
11
+ end
12
+
13
+ def self.authenticate(username, password)
14
+ if username == Application.auth_user["user"] && password == Application.auth_user["password"]
15
+ usr = User.new(username)
16
+ @@users[usr.id] = usr
17
+ else
18
+ nil
19
+ end
20
+ end
21
+
22
+ def self.auth?(username, password)
23
+ username == Application.auth_user["user"] && password == Application.auth_user["password"]
24
+ end
25
+
26
+ def self.find(id)
27
+ @@users[id]
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,381 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rbconfig'
4
+ require 'thread'
5
+ require 'net/ftp'
6
+ #require 'net/sftp'
7
+ require 'fileutils'
8
+
9
+ module RottenEgg
10
+
11
+ module Util
12
+
13
+ MS_ECHO_PATH = "echo %PATH%".freeze
14
+ NX_ECHO_PATH = "echo $PATH".freeze
15
+ MS_BIN_TYPE = ["", ".exe", ".cmd"].freeze
16
+ NX_BIN_TYPE = [].freeze
17
+ MS_PATH_DELIMITER = ";".freeze
18
+ NX_PATH_DELIMITER = ":".freeze
19
+
20
+ class FtpTool #:nodoc: internal use only
21
+
22
+ attr_accessor :verbose
23
+ attr_reader :server, :port, :user, :password
24
+
25
+ def initialize(server, port, user, password, options={})
26
+ @server = server
27
+ @port = port
28
+ @user = user
29
+ @password = password
30
+ @connection = nil
31
+ @verbose = options[:verbose] || false
32
+ @passive = options[:passive] || false
33
+ @msg_logger = options[:msg_logger]
34
+ @lock = Mutex.new
35
+ end
36
+
37
+ def pull_files(local_path, file_list)
38
+ @lock.synchronize do
39
+ return {} unless connect!
40
+ file_list = [file_list.to_s] unless file_list.is_a? Array
41
+ file_list.uniq!
42
+ result = file_list.inject({}) do |hash, f|
43
+ status = if file_exist?(f)
44
+ local_dir = File.join(local_path, File.dirname(f))
45
+ FileUtils.mkdir_p local_dir unless File.exist?(local_dir)
46
+ local_file = File.join(local_dir, File.basename(f))
47
+ origin_local_file = local_file + ".origin"
48
+
49
+ if File.exist? local_file
50
+ FileUtils.mv local_file, origin_local_file
51
+
52
+ # still exist! FileUtils # rename_cannot_overwrite_file?
53
+ FileUtils.rm local_file if File.exist? local_file
54
+ end
55
+ pull_result = pull_file f, File.join(local_dir, File.basename(f))
56
+ if pull_result
57
+ FileUtils.rm origin_local_file if File.exist?(origin_local_file)
58
+ :success
59
+ else
60
+ FileUtils.mv origin_local_file, local_file
61
+ :failure
62
+ end
63
+ else
64
+ :not_exist # file not exist !
65
+ end # - file_exist? f
66
+ hash[f] = status
67
+ hash
68
+ end # - file_list inject
69
+ close!
70
+ result
71
+ end
72
+ end
73
+
74
+ # download version file
75
+ def download_version_file(local_path, file)
76
+ result = pull_files local_path, file
77
+ if result.empty?
78
+ log "ftp connect failure"
79
+ :ftp_connect_failure
80
+ else
81
+ case result[file]
82
+ when :success
83
+ :success
84
+ when :failure
85
+ log 'download remove version file failed'
86
+ :failure
87
+ when :not_exist
88
+ :initial
89
+ end
90
+ end
91
+ end
92
+
93
+ #
94
+ # Pull a supplied list of files from the remote ftp path into the local path
95
+ #
96
+ def apply_changes(local_path, file_lists)
97
+ @lock.synchronize do
98
+ return false if file_lists.empty? or !connect!
99
+ result = true
100
+ file_lists.each do |item|
101
+ file = item[:filename]
102
+ action = item[:action]
103
+ item_index = file_lists.index(item)
104
+ file_dir = File.dirname(file)
105
+ case action
106
+ when "A", "M"
107
+ pull_status = push_file "#{local_path}#{file}", file_dir, file
108
+ if pull_status
109
+ status = :success
110
+ else
111
+ status = :failed
112
+ result = pull_status
113
+ end
114
+ file_lists[item_index].update(:status => status)
115
+ when "D"
116
+ file_dir = "/" if file_dir == "." or file_dir == ""
117
+ if file_exist?(file)
118
+ if delete_file(file)
119
+ delete_dir(file_dir) if dir_empty?(file_dir) #remove remote dir
120
+ end
121
+ file_lists[item_index].update(:status => :success)
122
+ else # no remote file set true
123
+ file_lists[item_index].update(:status => :success)
124
+ end
125
+ end
126
+ end
127
+ close!
128
+ result
129
+ end
130
+ end
131
+
132
+ # upload version file
133
+ def update_version_file(local_file, remote_file=File.basename(local_file))
134
+ @lock.synchronize do
135
+ return false unless connect!
136
+ file_dir = File.dirname(remote_file)
137
+ result = push_file "#{local_file}", file_dir, remote_file
138
+ close!
139
+ result
140
+ end
141
+ end
142
+
143
+ private
144
+ # open connection
145
+ def connect!
146
+ begin
147
+ Timeout.timeout(15) do
148
+ log "Connection to #{@server}..."
149
+ @connection ||= Net::FTP.new()
150
+ @connection.passive = @passive
151
+ @connection.connect(@server, @port)
152
+ @connection.login(@user, @password)
153
+ log "Opened connection to #{@server}"
154
+ return true
155
+ end
156
+ rescue Timeout::Error
157
+ log "Open connection to #{@server}:#{@port} time out"
158
+ return false
159
+ rescue Net::FTPConnectionError
160
+ @connection = nil
161
+ log "Connect to #{@server} connection error"
162
+ return false
163
+ rescue Errno::ECONNREFUSED
164
+ log "Connect to #{@server} refused"
165
+ return false
166
+ rescue Net::FTPPermError
167
+ log "Connect to #{@server} permission denied"
168
+ return false
169
+ rescue
170
+ log "Connect to #{@server} error"
171
+ return false
172
+ end
173
+ end
174
+
175
+ # close connection
176
+ def close!
177
+ begin
178
+ @connection.close
179
+ @connection = nil
180
+ log "Closed Connection to #{@server}"
181
+ rescue
182
+
183
+ end
184
+ end
185
+
186
+ # check remote directory exist?
187
+ def dir_exist?(dir)
188
+ return false if server_down?
189
+
190
+ status = begin
191
+ @connection.chdir(dir)
192
+ true
193
+ rescue
194
+ log "Remote directory #{dir} not exist"
195
+ false
196
+ end
197
+ @connection.chdir('/') if status
198
+ status
199
+ end
200
+
201
+ # check remote dir empty?
202
+ def dir_empty?(dir)
203
+ return false if server_down?
204
+
205
+ if dir_exist?(dir)
206
+ files = @connection.nlst(dir)
207
+ files.any?
208
+ else
209
+ true
210
+ end
211
+ end
212
+
213
+ # create directory
214
+ def create_dir(dir)
215
+ return false if server_down?
216
+
217
+ begin
218
+ @connection.mkdir(dir)
219
+ true
220
+ rescue
221
+ log "Create remote directory #{dir}"
222
+ false
223
+ end
224
+ end
225
+
226
+ # create directory
227
+ def delete_dir(dir)
228
+ return false if server_down?
229
+
230
+ begin
231
+ @connection.rmdir(dir)
232
+ true
233
+ rescue
234
+ log "Remote remote directory #{dir} error"
235
+ false
236
+ end
237
+ end
238
+
239
+ # create directories
240
+ def create_dirs(path, base = '/')
241
+ return false if server_down?
242
+
243
+ base = '' if base == '/'
244
+ parent = base
245
+ path_list = path.split("/")
246
+ path_list.each do |item|
247
+ parent = "#{parent}/#{item}"
248
+ unless dir_exist?(parent)
249
+ return false unless create_dir(parent)
250
+ end
251
+ end
252
+ true
253
+ end
254
+
255
+ # download single file
256
+ def pull_file(remote_file, local_file)
257
+ return false if server_down?
258
+
259
+ begin
260
+ log "Pulling #{remote_file} to #{local_file}..."
261
+ @connection.get remote_file, local_file
262
+ log "Pulled #{remote_file} to #{local_file}..."
263
+ true
264
+ rescue
265
+ log "Pull #{remote_file} error reading..."
266
+ false
267
+ end
268
+ end
269
+
270
+ # upload single file
271
+ def push_file(local_file, remote_dir = "/", remote_file=File.basename(local_file))
272
+ return false if server_down?
273
+
274
+ unless File.exist?(local_file)
275
+ log "local file #{local_file} not exist"
276
+ return true# local file not exist then return true not false
277
+ end
278
+
279
+ remote_dir = "/" if remote_dir == "." or remote_dir == ""
280
+ unless dir_exist?(remote_dir)
281
+ return false unless create_dirs(remote_dir)
282
+ end
283
+
284
+ begin
285
+ @connection.chdir(remote_dir) unless remote_dir == "/"
286
+ log "Pushing #{local_file} to remote..."
287
+ @connection.put local_file, File.basename(remote_file)
288
+ @connection.chdir("/")
289
+ log "Pushed #{local_file} to remote"
290
+ true
291
+ rescue
292
+ @connection.chdir("/")
293
+ log "Push #{local_file} to remote error"
294
+ false
295
+ end
296
+ end
297
+
298
+ # delete single file
299
+ def delete_file(remote_file)
300
+ return false if server_down?
301
+
302
+ begin
303
+ @connection.delete remote_file
304
+ log "Remote file #{local_file} successfully deleted"
305
+ true
306
+ rescue
307
+ log "Delete remote file: #{remote_file} error"
308
+ false
309
+ end
310
+ end
311
+
312
+ # check remote file exist?
313
+ def file_exist?(file_path)
314
+ return false if server_down?
315
+
316
+ path, file_name = File.dirname(file_path), File.basename(file_path)
317
+ if dir_exist?(path)
318
+ files = @connection.nlst(path)
319
+ if files.include?(file_name)
320
+ true
321
+ else
322
+ log "Remote file #{file_path} not exist"
323
+ false
324
+ end
325
+ else
326
+ log "Remote file #{file_path} not exist"
327
+ false
328
+ end
329
+ end
330
+
331
+ def server_down?
332
+ begin
333
+ @connection.chdir("/")
334
+ false
335
+ rescue
336
+ log "<。)#)))≦ ~~~~~ Remote ftp server is down!"
337
+ true
338
+ end
339
+ end
340
+
341
+ # log message
342
+ def log(msg)
343
+ @msg_logger.add(msg) if @msg_logger
344
+ puts msg if @verbose
345
+ end
346
+ end
347
+
348
+ module_function
349
+
350
+ def mswin?
351
+ Config::CONFIG['target_os'] =~ /mswin32|mingw32/ ? true : false
352
+ end
353
+
354
+ def format_path(path)
355
+ path = path.chomp.gsub("\\", "/") if mswin?
356
+ path = "#{path}/" if path[-1].chr != "/"
357
+ path
358
+ end
359
+
360
+ def check_scm(scm)
361
+ #send "check_#{scm}".to_sym
362
+ # not by scm --version
363
+ if mswin?
364
+ paths = `#{MS_ECHO_PATH}`.split(MS_PATH_DELIMITER)
365
+ bin_path = MS_BIN_TYPE.inject([]) do |ary, type|
366
+ ary << paths.reject { |path| !File.exist?("#{path.chomp.gsub("\\", "/")}/#{scm}#{type}") }
367
+ end.collect { |path| path.any? ? path.first : nil }.compact.first.to_s
368
+
369
+ raise "Please install #{scm}." if bin_path.empty?
370
+ {:bin_path => bin_path}
371
+ else
372
+ bin_path = `which #{scm}`.chomp
373
+ raise "Please install #{scm}." if bin_path.empty?
374
+ {:bin_path => bin_path}
375
+ end
376
+ end # - check_scm
377
+
378
+
379
+ end # - Util
380
+
381
+ end # - RottenEgg
@@ -0,0 +1,4 @@
1
+ # encoding: utf-8
2
+ module RottenEgg
3
+ VERSION = "1.2.5.beta"
4
+ end
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Load the library located at the same path with this file
3
+ *
4
+ * Will automatically load ext-all-debug.js if any of these conditions is true:
5
+ * - Current hostname is localhost
6
+ * - Current hostname is an IP v4 address
7
+ * - Current protocol is "file:"
8
+ *
9
+ * Will load ext-all.js (minified) otherwise
10
+ */
11
+ (function() {
12
+
13
+ var scripts = document.getElementsByTagName('script'),
14
+ localhostTests = [
15
+ /^localhost$/,
16
+ /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d{1,5})?\b/ // IP v4
17
+ ],
18
+ host = window.location.hostname,
19
+ isDevelopment = null,
20
+ queryString = window.location.search,
21
+ test, path, i, ln, scriptSrc, match;
22
+
23
+ for (i = 0, ln = scripts.length; i < ln; i++) {
24
+ scriptSrc = scripts[i].src;
25
+
26
+ match = scriptSrc.match(/bootstrap\.js$/);
27
+
28
+ if (match) {
29
+ path = scriptSrc.substring(0, scriptSrc.length - match[0].length);
30
+ break;
31
+ }
32
+ }
33
+
34
+ if (queryString.match('(\\?|&)debug') !== null) {
35
+ isDevelopment = true;
36
+ }
37
+ else if (queryString.match('(\\?|&)nodebug') !== null) {
38
+ isDevelopment = false;
39
+ }
40
+
41
+ if (isDevelopment === null) {
42
+ for (i = 0, ln = localhostTests.length; i < ln; i++) {
43
+ test = localhostTests[i];
44
+
45
+ if (host.search(test) !== -1) {
46
+ isDevelopment = true;
47
+ break;
48
+ }
49
+ }
50
+ }
51
+
52
+ if (isDevelopment === null && window.location.protocol === 'file:') {
53
+ isDevelopment = true;
54
+ }
55
+
56
+ document.write('<script type="text/javascript" src="' + path + 'ext-all' + ((isDevelopment) ? '-debug' : '') + '.js"></script>');
57
+
58
+ })();