rsence 2.0.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. data/INSTALL.rdoc +295 -0
  2. data/LICENSE +622 -0
  3. data/README.rdoc +24 -0
  4. data/VERSION +1 -0
  5. data/bin/build_client.rb +254 -0
  6. data/bin/help +6 -0
  7. data/bin/launch.rb +120 -0
  8. data/bin/rdoc.sh +2 -0
  9. data/bin/restart +6 -0
  10. data/bin/rsence +120 -0
  11. data/bin/run +6 -0
  12. data/bin/run.rb +6 -0
  13. data/bin/save +6 -0
  14. data/bin/start +6 -0
  15. data/bin/status +6 -0
  16. data/bin/stop +6 -0
  17. data/conf/config.ru +5 -0
  18. data/conf/default_conf.yaml +337 -0
  19. data/conf/default_strings.yaml +77 -0
  20. data/conf/local_conf.yaml +14 -0
  21. data/conf/unicorn.conf +78 -0
  22. data/js/comm/comm/autosync/autosync.js +18 -0
  23. data/js/comm/comm/autosync/js.inc +0 -0
  24. data/js/comm/comm/comm.js +195 -0
  25. data/js/comm/comm/js.inc +0 -0
  26. data/js/comm/comm/queue/js.inc +0 -0
  27. data/js/comm/comm/queue/queue.js +183 -0
  28. data/js/comm/comm/session/js.inc +0 -0
  29. data/js/comm/comm/session/session.js +51 -0
  30. data/js/comm/comm/sessionwatcher/js.inc +0 -0
  31. data/js/comm/comm/sessionwatcher/sessionwatcher.js +43 -0
  32. data/js/comm/comm/transporter/js.inc +0 -0
  33. data/js/comm/comm/transporter/transporter.js +257 -0
  34. data/js/comm/comm/urlresponder/js.inc +0 -0
  35. data/js/comm/comm/urlresponder/urlresponder.js +148 -0
  36. data/js/comm/comm/values/js.inc +0 -0
  37. data/js/comm/comm/values/values.js +432 -0
  38. data/js/comm/jsloader/js.inc +0 -0
  39. data/js/comm/jsloader/jsloader.js +114 -0
  40. data/js/comm/reloadapp/js.inc +0 -0
  41. data/js/comm/reloadapp/reloadapp.js +150 -0
  42. data/js/comm/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
  43. data/js/comm/reloadapp/themes/default/reloadapp_warning.png +0 -0
  44. data/js/comm/sha/js.inc +0 -0
  45. data/js/comm/sha/sha.js +432 -0
  46. data/js/comm/values/value/js.inc +0 -0
  47. data/js/comm/values/value/value.js +182 -0
  48. data/js/comm/values/valuematrix/js.inc +0 -0
  49. data/js/comm/values/valuematrix/valuematrix.js +138 -0
  50. data/js/controls/button/button.js +57 -0
  51. data/js/controls/button/js.inc +0 -0
  52. data/js/controls/button/themes/bright/button.css +89 -0
  53. data/js/controls/button/themes/bright/button.html +7 -0
  54. data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
  55. data/js/controls/button/themes/bright/button_parts1.png +0 -0
  56. data/js/controls/button/themes/default/button.css +89 -0
  57. data/js/controls/button/themes/default/button.html +7 -0
  58. data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
  59. data/js/controls/button/themes/default/button_parts1.png +0 -0
  60. data/js/controls/checkbox/checkbox.js +47 -0
  61. data/js/controls/checkbox/js.inc +0 -0
  62. data/js/controls/checkbox/themes/default/checkbox.css +69 -0
  63. data/js/controls/checkbox/themes/default/checkbox.html +5 -0
  64. data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
  65. data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
  66. data/js/controls/datetime/calendar/calendar.js +197 -0
  67. data/js/controls/datetime/calendar/js.inc +0 -0
  68. data/js/controls/datetime/calendar/themes/default/calendar.css +108 -0
  69. data/js/controls/datetime/calendar/themes/default/calendar.html +9 -0
  70. data/js/controls/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
  71. data/js/controls/datetime/calendar/themes/default/calendar_arrows.png +0 -0
  72. data/js/controls/datetime/datetimevalue/datetimevalue.js +246 -0
  73. data/js/controls/datetime/datetimevalue/js.inc +0 -0
  74. data/js/controls/datetime/timesheet/js.inc +0 -0
  75. data/js/controls/datetime/timesheet/themes/default/timesheet.css +30 -0
  76. data/js/controls/datetime/timesheet/themes/default/timesheet.html +2 -0
  77. data/js/controls/datetime/timesheet/timesheet.js +182 -0
  78. data/js/controls/datetime/timesheet_item/js.inc +0 -0
  79. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
  80. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
  81. data/js/controls/datetime/timesheet_item/timesheet_item.js +247 -0
  82. data/js/controls/datetime/timesheet_item_edit/js.inc +0 -0
  83. data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
  84. data/js/controls/dialogs/alert_sheet/alert_sheet.js +62 -0
  85. data/js/controls/dialogs/alert_sheet/js.inc +0 -0
  86. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +36 -0
  87. data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
  88. data/js/controls/dialogs/sheet/js.inc +0 -0
  89. data/js/controls/dialogs/sheet/sheet.js +83 -0
  90. data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
  91. data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
  92. data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
  93. data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
  94. data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
  95. data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
  96. data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
  97. data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
  98. data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
  99. data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
  100. data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
  101. data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
  102. data/js/controls/imageview/imageview.js +108 -0
  103. data/js/controls/imageview/js.inc +0 -0
  104. data/js/controls/imageview/themes/default/blank.gif +0 -0
  105. data/js/controls/lists/checkboxlist/checkboxlist.js +170 -0
  106. data/js/controls/lists/checkboxlist/js.inc +0 -0
  107. data/js/controls/lists/listitems/js.inc +0 -0
  108. data/js/controls/lists/listitems/listitems.js +65 -0
  109. data/js/controls/lists/radiobuttonlist/js.inc +0 -0
  110. data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +126 -0
  111. data/js/controls/passwordcontrol/js.inc +0 -0
  112. data/js/controls/passwordcontrol/passwordcontrol.js +22 -0
  113. data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
  114. data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
  115. data/js/controls/progress/progressbar/js.inc +0 -0
  116. data/js/controls/progress/progressbar/progressbar.js +36 -0
  117. data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
  118. data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
  119. data/js/controls/progress/progressindicator/js.inc +0 -0
  120. data/js/controls/progress/progressindicator/progressindicator.js +43 -0
  121. data/js/controls/radiobutton/js.inc +0 -0
  122. data/js/controls/radiobutton/radiobutton.js +41 -0
  123. data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
  124. data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
  125. data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
  126. data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
  127. data/js/controls/sliders/slider/js.inc +0 -0
  128. data/js/controls/sliders/slider/slider.js +356 -0
  129. data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
  130. data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
  131. data/js/controls/sliders/slider/themes/default/slider.css +108 -0
  132. data/js/controls/sliders/slider/themes/default/slider.html +5 -0
  133. data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
  134. data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
  135. data/js/controls/sliders/vslider/js.inc +0 -0
  136. data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
  137. data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
  138. data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
  139. data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
  140. data/js/controls/sliders/vslider/vslider.js +40 -0
  141. data/js/controls/stepper/js.inc +0 -0
  142. data/js/controls/stepper/stepper.js +212 -0
  143. data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
  144. data/js/controls/stepper/themes/default/stepper.css +14 -0
  145. data/js/controls/stepper/themes/default/stepper.html +2 -0
  146. data/js/controls/stepper/themes/default/stepper.png +0 -0
  147. data/js/controls/stringview/js.inc +0 -0
  148. data/js/controls/stringview/stringview.js +49 -0
  149. data/js/controls/stringview/themes/default/stringview.css +8 -0
  150. data/js/controls/stringview/themes/default/stringview.html +1 -0
  151. data/js/controls/tab/js.inc +0 -0
  152. data/js/controls/tab/tab.js +276 -0
  153. data/js/controls/tab/themes/bright/tab.css +76 -0
  154. data/js/controls/tab/themes/bright/tab.html +6 -0
  155. data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
  156. data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
  157. data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
  158. data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
  159. data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
  160. data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
  161. data/js/controls/tab/themes/default/tab.css +77 -0
  162. data/js/controls/tab/themes/default/tab.html +6 -0
  163. data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
  164. data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
  165. data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
  166. data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
  167. data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
  168. data/js/controls/tab/themes/default/tab_parts1.png +0 -0
  169. data/js/controls/textarea/js.inc +0 -0
  170. data/js/controls/textarea/textarea.js +23 -0
  171. data/js/controls/textarea/themes/default/textarea.css +21 -0
  172. data/js/controls/textarea/themes/default/textarea.html +18 -0
  173. data/js/controls/textcontrol/js.inc +0 -0
  174. data/js/controls/textcontrol/textcontrol.js +372 -0
  175. data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
  176. data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
  177. data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
  178. data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
  179. data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
  180. data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
  181. data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
  182. data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
  183. data/js/controls/uploader/js.inc +0 -0
  184. data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
  185. data/js/controls/uploader/themes/default/uploader.css +108 -0
  186. data/js/controls/uploader/themes/default/uploader.html +27 -0
  187. data/js/controls/uploader/uploader.js +153 -0
  188. data/js/controls/validatorview/js.inc +0 -0
  189. data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
  190. data/js/controls/validatorview/themes/default/validator.png +0 -0
  191. data/js/controls/validatorview/themes/default/validatorview.css +0 -0
  192. data/js/controls/validatorview/themes/default/validatorview.html +0 -0
  193. data/js/controls/validatorview/validatorview.js +55 -0
  194. data/js/controls/window/js.inc +0 -0
  195. data/js/controls/window/themes/default/window.css +219 -0
  196. data/js/controls/window/themes/default/window.html +17 -0
  197. data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
  198. data/js/controls/window/themes/default/window_bg_active.png +0 -0
  199. data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
  200. data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
  201. data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
  202. data/js/controls/window/themes/default/window_buttons.png +0 -0
  203. data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
  204. data/js/controls/window/themes/default/window_parts1.png +0 -0
  205. data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
  206. data/js/controls/window/themes/default/window_parts2.png +0 -0
  207. data/js/controls/window/window.js +284 -0
  208. data/js/core/class/class.js +317 -0
  209. data/js/core/class/js.inc +0 -0
  210. data/js/core/elem/elem.js +1376 -0
  211. data/js/core/elem/js.inc +0 -0
  212. data/js/core/event/event.js +1021 -0
  213. data/js/core/event/js.inc +0 -0
  214. data/js/core/iefix/ie_css_element.htc +5 -0
  215. data/js/core/iefix/ie_css_style.htc +5 -0
  216. data/js/core/iefix/iefix.js +359 -0
  217. data/js/core/iefix/js.inc +0 -0
  218. data/js/debugg/debugg.js +43 -0
  219. data/js/debugg/js.inc +0 -0
  220. data/js/foundation/application/application.js +209 -0
  221. data/js/foundation/application/js.inc +0 -0
  222. data/js/foundation/control/control.js +342 -0
  223. data/js/foundation/control/controldefaults/controldefaults.js +59 -0
  224. data/js/foundation/control/controldefaults/js.inc +0 -0
  225. data/js/foundation/control/dummyvalue/dummyvalue.js +50 -0
  226. data/js/foundation/control/dummyvalue/js.inc +0 -0
  227. data/js/foundation/control/dyncontrol/dyncontrol.js +494 -0
  228. data/js/foundation/control/dyncontrol/js.inc +0 -0
  229. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
  230. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
  231. data/js/foundation/control/eventresponder/eventresponder.js +713 -0
  232. data/js/foundation/control/eventresponder/js.inc +0 -0
  233. data/js/foundation/control/js.inc +0 -0
  234. data/js/foundation/control/valueresponder/js.inc +0 -0
  235. data/js/foundation/control/valueresponder/valueresponder.js +77 -0
  236. data/js/foundation/geom/point/js.inc +0 -0
  237. data/js/foundation/geom/point/point.js +202 -0
  238. data/js/foundation/geom/rect/js.inc +0 -0
  239. data/js/foundation/geom/rect/rect.js +610 -0
  240. data/js/foundation/json_renderer/js.inc +0 -0
  241. data/js/foundation/json_renderer/json_renderer.js +231 -0
  242. data/js/foundation/system/js.inc +0 -0
  243. data/js/foundation/system/system.js +369 -0
  244. data/js/foundation/thememanager/js.inc +0 -0
  245. data/js/foundation/thememanager/thememanager.js +387 -0
  246. data/js/foundation/view/js.inc +0 -0
  247. data/js/foundation/view/markupview/js.inc +0 -0
  248. data/js/foundation/view/markupview/markupview.js +113 -0
  249. data/js/foundation/view/morphanimation/js.inc +0 -0
  250. data/js/foundation/view/morphanimation/morphanimation.js +236 -0
  251. data/js/foundation/view/view.js +1804 -0
  252. data/js/foundation/view/viewdefaults/js.inc +0 -0
  253. data/js/foundation/view/viewdefaults/viewdefaults.js +25 -0
  254. data/js/views/centerview/centerview.js +45 -0
  255. data/js/views/centerview/js.inc +0 -0
  256. data/js/views/inlineview/inlineview.js +14 -0
  257. data/js/views/inlineview/js.inc +0 -0
  258. data/js/views/scrollview/js.inc +0 -0
  259. data/js/views/scrollview/scrollview.js +39 -0
  260. data/lib/conf/default.rb +220 -0
  261. data/lib/conf/wizard.rb +303 -0
  262. data/lib/daemon/daemon.rb +293 -0
  263. data/lib/http/broker.rb +102 -0
  264. data/lib/http/rackup.rb +88 -0
  265. data/lib/http/request.rb +69 -0
  266. data/lib/http/response.rb +63 -0
  267. data/lib/plugins/gui_plugin.rb +129 -0
  268. data/lib/plugins/guiparser.rb +114 -0
  269. data/lib/plugins/plugin.rb +652 -0
  270. data/lib/plugins/plugin_plugins.rb +47 -0
  271. data/lib/plugins/plugin_sqlite_db.rb +72 -0
  272. data/lib/plugins/plugin_util.rb +96 -0
  273. data/lib/plugins/pluginmanager.rb +517 -0
  274. data/lib/plugins/servlet.rb +69 -0
  275. data/lib/session/msg.rb +291 -0
  276. data/lib/session/sessionmanager.rb +491 -0
  277. data/lib/session/sessionstorage.rb +314 -0
  278. data/lib/transporter/transporter.rb +254 -0
  279. data/lib/util/gzstring.rb +5 -0
  280. data/lib/values/hvalue.rb +323 -0
  281. data/lib/values/valuemanager.rb +152 -0
  282. data/plugins/client_pkg/client_pkg.rb +186 -0
  283. data/plugins/client_pkg/info.yaml +25 -0
  284. data/plugins/client_pkg/lib/client_pkg_build.rb +569 -0
  285. data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
  286. data/plugins/client_pkg/lib/client_pkg_serve.rb +210 -0
  287. data/plugins/client_pkg/log/build_log +0 -0
  288. data/plugins/index_html/img/loading.gif +0 -0
  289. data/plugins/index_html/img/riassence.gif +0 -0
  290. data/plugins/index_html/index_html.rb +150 -0
  291. data/plugins/index_html/tmpl/index.html +22 -0
  292. data/plugins/index_html/tmpl/startup_index.html +29 -0
  293. data/plugins/legacy/disabled +0 -0
  294. data/plugins/legacy/disabled- +0 -0
  295. data/plugins/legacy/info.yaml +22 -0
  296. data/plugins/legacy/legacy.rb +15 -0
  297. data/plugins/main/js/riassence_ns.js +87 -0
  298. data/plugins/main/main.rb +234 -0
  299. data/plugins/main/values.yaml +8 -0
  300. data/plugins/ticketservices/lib/common.rb +300 -0
  301. data/plugins/ticketservices/lib/favicon.rb +38 -0
  302. data/plugins/ticketservices/lib/file.rb +58 -0
  303. data/plugins/ticketservices/lib/img.rb +50 -0
  304. data/plugins/ticketservices/lib/objblob.rb +66 -0
  305. data/plugins/ticketservices/lib/rsrc.rb +34 -0
  306. data/plugins/ticketservices/lib/upload.rb +206 -0
  307. data/plugins/ticketservices/ticketservices.rb +268 -0
  308. data/var/db/.git_include +0 -0
  309. data/var/log/.git_include +0 -0
  310. data/var/run/.git_include +0 -0
  311. metadata +390 -0
data/README.rdoc ADDED
@@ -0,0 +1,24 @@
1
+
2
+ = RSence 2.0.pre 2010-??-??
3
+
4
+ http://rsence.org/
5
+
6
+ === Introduction
7
+
8
+ RSence is primarily a flexible and high-performance RIA framework aimed on building responsive, scalable and over-all as high-performance GUI Applications as possible with the chosen technologies. RSence uses the server for backend tasks and the client to provide responsive user interfaces. The server is a highly optimized Ruby framework for writing applications as plugin bundles containing all resources needed per plugin. The client is a highly optimized Javascript framework with an API similar to many object-oriented desktop frameworks. RSence is not primarily targeted for creating html web sites, there are plenty of other tools for that purpose.
9
+
10
+ === Installation (pre-release):
11
+
12
+ gem install rsence --pre
13
+
14
+ For more detailed installation and usage instructions, read the INSTALL.rdoc document.
15
+
16
+ === Licensing:
17
+ * Free: *GPL*
18
+ * Alternative licensing queries available via http://riassence.com/ and sales@riassence.com
19
+
20
+ === Community support:
21
+ * Web: http://rsence.org/
22
+ * IRC: #rsence on the IRCNet and FreeNode networks
23
+
24
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.0.0.pre
@@ -0,0 +1,254 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ ## Riassence Framework
4
+ # Copyright 2010 Riassence Inc.
5
+ # http://riassence.com/
6
+ #
7
+ # You should have received a copy of the GNU General Public License along
8
+ # with this software package. If not, contact licensing@riassence.com
9
+ ##
10
+ #++
11
+
12
+ if ARGV.include?('--help') or ARGV.include?('-h')
13
+ puts %{
14
+
15
+ Riassence Framework Client Builder
16
+ This script builds the client into the DESTINATION_PATH that defaults to ./client
17
+
18
+ Usage:
19
+ #{__FILE__} [DESTINATION_PATH] [params]
20
+
21
+ Params:
22
+ -d Debug/Development mode
23
+ --config <PATH> Optional config override file
24
+ --auto Checks if the source has changed every 3 seconds
25
+ --help This message
26
+ -h This message
27
+
28
+ Examples:
29
+ #{__FILE__} /web/sites/my_site/rsence/client -d
30
+
31
+ Further information:
32
+ http://riassence.org/
33
+
34
+ }
35
+ exit
36
+ end
37
+
38
+ require 'profile' if ARGV.include?('--profile')
39
+
40
+ ## Auto-construct paths using this file as the waypoint
41
+ SERVER_PATH = ARGV.include?('--root-path')?(ARGV[ARGV.index('--root-path')+1]):File.split(File.expand_path(File.dirname(__FILE__)))[0]
42
+
43
+ ## Include server & lib in the search path
44
+ $LOAD_PATH << SERVER_PATH
45
+ $LOAD_PATH << File.join( SERVER_PATH, 'lib' )
46
+
47
+ require 'rubygems'
48
+ require 'yaml'
49
+ require 'json'
50
+
51
+ config = YAML.load( File.read( File.join( SERVER_PATH, 'conf', 'default_conf.yaml' ) ) )
52
+
53
+ ## Create default local configuratation override file, if it does not exist:
54
+ local_config_file_paths = [
55
+ File.join(SERVER_PATH,'conf','local_conf.yaml'),
56
+ File.join( File.split( SERVER_PATH )[0], 'conf', 'local_conf.yaml' ),
57
+ File.join( Dir.pwd, 'conf', 'local_conf.yaml' ),
58
+ File.join(SERVER_PATH,'conf','client-build-config.rb'),
59
+ File.join( File.split( SERVER_PATH )[0], 'conf', 'client-build-config.rb' ),
60
+ File.join( Dir.pwd, 'conf', 'client-build-config.rb' ),
61
+ ]
62
+ if ARGV.include?('--config')
63
+ argv_conf_file = ARGV[ARGV.index('--config')+1]
64
+ if not argv_conf_file.begin_with? '/'
65
+ argv_conf_file = File.join( Dir.pwd, conf_file )
66
+ end
67
+ local_config_file_paths.push( argv_conf_file )
68
+ end
69
+
70
+ def array_merge( target, source )
71
+ source.each do |item|
72
+ unless target.include?(item)
73
+ if item.class == Array
74
+ sub_arr = []
75
+ array_merge( sub_arr, item )
76
+ target.push( sub_arr )
77
+ elsif item.class == Hash
78
+ sub_hash = {}
79
+ hash_merge( sub_hash, item )
80
+ target.push( sub_hash )
81
+ else
82
+ target.push( item )
83
+ end
84
+ end
85
+ end
86
+ end
87
+ def hash_merge( target, source )
88
+ source.each do |key,item|
89
+ if not target.has_key?key or target[key] != item
90
+ if item.class == Array
91
+ target[key] = [] unless target.has_key?(key)
92
+ array_merge( target[key], item )
93
+ # if key == :plugin_paths
94
+ # puts target[key].inspect
95
+ # end
96
+ elsif item.class == Hash
97
+ target[key] = {} unless target.has_key?key
98
+ hash_merge( target[key], item )
99
+ else
100
+ target[key] = item
101
+ end
102
+ end
103
+ end
104
+ end
105
+
106
+ local_config_file_path_found = false
107
+ local_config_file_paths.each do |local_config_file_path|
108
+ if File.exists? local_config_file_path and File.file? local_config_file_path
109
+ if local_config_file_path.end_with? '.yaml'
110
+ local_conf = YAML.load( File.read( local_config_file_path ) )
111
+ hash_merge( config, local_conf )
112
+ local_config_file_path_found = true
113
+ else
114
+ warn "Only Yaml configuration files are allowed at this time."
115
+ end
116
+ end
117
+ end
118
+
119
+
120
+ require 'plugins/client_pkg/lib/client_pkg_build'
121
+
122
+ class JSBuilder < ClientPkgBuild
123
+ def initialize( conf, logger )
124
+ super
125
+ @conf = conf
126
+ @debug = ARGV.include?('-d')
127
+ @quiet = false
128
+ end
129
+ def flush
130
+ @jscompress.free_indexes
131
+ end
132
+ def ensure_client_dir
133
+ dst_dir = @conf[:dst_dir]
134
+ Dir.mkdir( dst_dir ) unless File.exist?( dst_dir )
135
+ js_dir = File.join( dst_dir, 'js' )
136
+ Dir.mkdir( js_dir ) unless File.exist?( js_dir )
137
+ themes_dir = File.join( dst_dir, 'themes' )
138
+ Dir.mkdir( themes_dir ) unless File.exist?( themes_dir )
139
+ @themes.each_key do |theme_name|
140
+ theme_dir = File.join( themes_dir, theme_name )
141
+ Dir.mkdir( theme_dir ) unless File.exist?( theme_dir )
142
+ ['gfx','css','html'].each do |theme_part|
143
+ theme_part_dir = File.join( theme_dir, theme_part )
144
+ Dir.mkdir( theme_part_dir ) unless File.exist?( theme_part_dir )
145
+ end
146
+ end
147
+ end
148
+ def store_client_files
149
+ dst_dir = @conf[:dst_dir]
150
+ js_dir = File.join( dst_dir, 'js' )
151
+ @js.each_key do |js_name|
152
+ js_path = File.join( js_dir, "#{js_name}.js" )
153
+ js_file = File.open( js_path, 'wb' )
154
+ js_file.write( @js[js_name] )
155
+ js_file.close
156
+ end
157
+ @gz.each_key do |gz_name|
158
+ gz_path = File.join( js_dir, "#{gz_name}.gz" )
159
+ gz_file = File.open( gz_path, 'wb' )
160
+ gz_file.write( @gz[gz_name] )
161
+ gz_file.close
162
+ end
163
+ themes_dir = File.join( dst_dir, 'themes' )
164
+ @themes.each_key do |theme_name|
165
+ theme_dir = File.join( themes_dir, theme_name )
166
+ gfx_dir = File.join( theme_dir, 'gfx' )
167
+ @themes[theme_name][:gfx].each do | img_name, file_data |
168
+ img_path = File.join( gfx_dir, img_name )
169
+ img_file = File.open( img_path, 'wb' )
170
+ img_file.write( file_data )
171
+ img_file.close
172
+ end
173
+ css_dir = File.join( theme_dir, 'css' )
174
+ @themes[theme_name][:css].each do | css_name, file_data |
175
+ css_path = File.join( css_dir, "#{css_name}.css" )
176
+ css_file = File.open( css_path, 'wb' )
177
+ css_file.write( file_data )
178
+ css_file.close
179
+ css_path += '.gz'
180
+ css_file = File.open( css_path, 'wb' )
181
+ css_file.write( gzip_string( file_data ) )
182
+ css_file.close
183
+ end
184
+ html_dir = File.join( theme_dir, 'html' )
185
+ @themes[theme_name][:html].each do | html_name, file_data |
186
+ html_path = File.join( html_dir, "#{html_name}.html" )
187
+ html_file = File.open( html_path, 'wb' )
188
+ html_file.write( file_data )
189
+ html_file.close
190
+ html_path += '.gz'
191
+ html_file = File.open( html_path, 'wb' )
192
+ html_file.write( gzip_string( file_data ) )
193
+ html_file.close
194
+ end
195
+ end
196
+ built_path = File.join( js_dir, 'built' )
197
+ built_file = File.open( built_path, 'w' )
198
+ built_file.write( Time.now.to_i.to_s )
199
+ built_file.close
200
+ end
201
+ def run
202
+ ensure_client_dir
203
+ super
204
+ store_client_files
205
+ end
206
+ end
207
+ class Logger
208
+ def log( str )
209
+ puts str
210
+ end
211
+ end
212
+
213
+ conf = config[:client_pkg]
214
+ dst_dir = File.join( SERVER_PATH, 'client' )
215
+ if ARGV.length > 0
216
+ unless ['-d','-auto','--auto','-say','--config','--root-path'].include?( ARGV[0] )
217
+ dst_dir = ARGV[0]
218
+ unless dst_dir.start_with?('/')
219
+ dst_dir = File.join( SERVER_PATH, dst_dir )
220
+ end
221
+ end
222
+ end
223
+ puts "Client build destination directory: #{dst_dir}"
224
+ conf[:dst_dir] = dst_dir
225
+
226
+ conf[:compound_packages].each do | pkg_name, js_order |
227
+ pkg_files = []
228
+ js_order.each do |js_pkg|
229
+ unless conf[:packages].has_key?(js_pkg)
230
+ pkg_files.push( js_pkg )
231
+ next
232
+ end
233
+ conf[:packages][js_pkg].each do |js_file|
234
+ pkg_files.push( js_file )
235
+ end
236
+ end
237
+ conf[:packages][ pkg_name ] = pkg_files
238
+ end
239
+
240
+ js_builder = JSBuilder.new( conf, Logger.new )
241
+ js_builder.run
242
+ if ARGV.include? '-auto' or ARGV.include? '--auto'
243
+ last_change = Time.now.to_i
244
+ while true
245
+ if js_builder.bundle_changes( last_change )
246
+ last_change = Time.now.to_i
247
+ js_builder.run
248
+ # client_cache.set_cache( @client_build.js, @client_build.gz, @client_build.themes )
249
+ `say "Autobuild complete!"` if ARGV.include?('-say')
250
+ end
251
+ sleep 3
252
+ end
253
+ end
254
+ js_builder.flush
data/bin/help ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ BINPATH = File.expand_path(File.dirname(__FILE__))
4
+
5
+ system("#{File.join(BINPATH,'launch.rb')} help")
6
+
data/bin/launch.rb ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ ## Riassence Framework
4
+ # Copyright 2008 Riassence Inc.
5
+ # http://riassence.com/
6
+ #
7
+ # You should have received a copy of the GNU General Public License along
8
+ # with this software package. If not, contact licensing@riassence.com
9
+ ##
10
+ #++
11
+
12
+ if RUBY_VERSION.to_f >= 1.9
13
+ Encoding.default_external = Encoding::ASCII_8BIT
14
+ end
15
+
16
+ is_win = ['i386-mingw32','x86-mingw32'].include? RUBY_PLATFORM
17
+
18
+ if is_win
19
+ commands = %w[help run]
20
+ else
21
+ commands = %w[help start stop restart status run]
22
+ end
23
+
24
+ if ARGV.include?('--help') or ARGV.include?('-h') or
25
+ ARGV.include?('help') or not (
26
+ commands.include?(ARGV[0])
27
+ )
28
+
29
+ if is_win
30
+ extra_cmd_help = ''
31
+ extra_cmd_examples = %{
32
+ #{__FILE__} run --log-fg
33
+ #{__FILE__} run -d
34
+ #{__FILE__} run --latency 150
35
+ #{__FILE__} run --server mongrel --port 8080 --addr 127.0.0.1
36
+ }
37
+ else
38
+ extra_cmd_help = %{\
39
+ status Tells if Riassence Framework Server is running or not
40
+ start Starts Riassence Framework Server
41
+ stop Stops Riassence Framework Server
42
+ restart Restarts Riassence Framework Server
43
+ save Saves Riassence Framework Server session data
44
+ }
45
+ extra_cmd_examples = %{\
46
+ #{__FILE__} status
47
+ #{__FILE__} start
48
+ #{__FILE__} stop
49
+ #{__FILE__} save
50
+ #{__FILE__} restart
51
+ #{__FILE__} restart -d --reset-sessions
52
+ #{__FILE__} restart --latency 150
53
+ #{__FILE__} restart --server mongrel --port 8080 --addr 127.0.0.1
54
+ }
55
+ end
56
+
57
+ puts %{
58
+
59
+ Riassence Framework is RIA client and server. This help message contains
60
+ hints about how to control the server startup/shutdown.
61
+
62
+ Usage:
63
+ #{__FILE__} command [params]
64
+
65
+ Command is one of:
66
+ run Run in foreground (exit with ctrl-c)
67
+ #{extra_cmd_help} help This message
68
+
69
+ Params:
70
+ --log-fg Don't write log into file (writes to foreground)
71
+ -d Debug/Development mode
72
+ --trace-js Write content of msg.reply calls to stdout
73
+ --trace-delegate Traces plugin method delegation to stdout
74
+ --root-path <PATH> Define the PATH to rsence server
75
+ Defaults to 'bin'
76
+ --port PORT Define the http PORT to use, defaults to '8001'
77
+ --latency MS Simulate network latency, value in milliseconds
78
+ --addr <ADDRESS> Define the IPv4 ADDRESS to bind to.
79
+ Defaults to '0.0.0.0' (any)
80
+ --server <SERVER> Choose http SERVER, valid choices:
81
+ - webrick
82
+ - mongrel
83
+ - ebb
84
+ - thin
85
+ Defaults to thin
86
+ --reset-sessions Deletes all old sessions on startup
87
+ --config <PATH> Optional config override file
88
+ --run-config-wizard Runs configuration wizard
89
+ Runs by default, if no local
90
+ configuration files were found.
91
+ --no-rescan Doesn't rescan the plugins even when in debug mode.
92
+ --profile Turns on profiling
93
+ - Runs everything considerable slower!
94
+ - Shown a table displaying the results on stop.
95
+ --help This message
96
+ -h This message
97
+
98
+ Examples:
99
+ #{__FILE__} run
100
+ #{extra_cmd_examples}
101
+ Further information:
102
+ http://riassence.org/
103
+
104
+ }
105
+ exit
106
+ end
107
+
108
+ require 'profile' if ARGV.include?('--profile')
109
+
110
+ ## Auto-construct paths using this file as the waypoint
111
+ SERVER_PATH = ARGV.include?('--root-path')?(ARGV[ARGV.index('--root-path')+1]):File.split(File.expand_path(File.dirname(__FILE__)))[0]
112
+
113
+ ## Include server & lib in the search path
114
+ $LOAD_PATH << SERVER_PATH
115
+ $LOAD_PATH << File.join( SERVER_PATH, 'lib' )
116
+
117
+ ## Riassence Daemon controls
118
+ require 'daemon/daemon'
119
+ RSence::HTTPDaemon.daemonize
120
+
data/bin/rdoc.sh ADDED
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ rdoc --op doc/rdoc -U -w 2 -x ".js .css .html" -S --threads=4 -N -F -I gif -c utf-8 -m "bin/launch.rb" -t "Riassence Framework Server" -i bin lib
data/bin/restart ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ BINPATH = File.expand_path(File.dirname(__FILE__))
4
+
5
+ system("#{File.join(BINPATH,'launch.rb')} restart #{ARGV.join(' ')}")
6
+
data/bin/rsence ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ ## Riassence Framework
4
+ # Copyright 2008 Riassence Inc.
5
+ # http://riassence.com/
6
+ #
7
+ # You should have received a copy of the GNU General Public License along
8
+ # with this software package. If not, contact licensing@riassence.com
9
+ ##
10
+ #++
11
+
12
+ if RUBY_VERSION.to_f >= 1.9
13
+ Encoding.default_external = Encoding::ASCII_8BIT
14
+ end
15
+
16
+ is_win = ['i386-mingw32','x86-mingw32'].include? RUBY_PLATFORM
17
+
18
+ if is_win
19
+ commands = %w[help run]
20
+ else
21
+ commands = %w[help start stop restart status run]
22
+ end
23
+
24
+ if ARGV.include?('--help') or ARGV.include?('-h') or
25
+ ARGV.include?('help') or not (
26
+ commands.include?(ARGV[0])
27
+ )
28
+
29
+ if is_win
30
+ extra_cmd_help = ''
31
+ extra_cmd_examples = %{
32
+ #{__FILE__} run --log-fg
33
+ #{__FILE__} run -d
34
+ #{__FILE__} run --latency 150
35
+ #{__FILE__} run --server mongrel --port 8080 --addr 127.0.0.1
36
+ }
37
+ else
38
+ extra_cmd_help = %{\
39
+ status Tells if Riassence Framework Server is running or not
40
+ start Starts Riassence Framework Server
41
+ stop Stops Riassence Framework Server
42
+ restart Restarts Riassence Framework Server
43
+ save Saves Riassence Framework Server session data
44
+ }
45
+ extra_cmd_examples = %{\
46
+ #{__FILE__} status
47
+ #{__FILE__} start
48
+ #{__FILE__} stop
49
+ #{__FILE__} save
50
+ #{__FILE__} restart
51
+ #{__FILE__} restart -d --reset-sessions
52
+ #{__FILE__} restart --latency 150
53
+ #{__FILE__} restart --server mongrel --port 8080 --addr 127.0.0.1
54
+ }
55
+ end
56
+
57
+ puts %{
58
+
59
+ Riassence Framework is RIA client and server. This help message contains
60
+ hints about how to control the server startup/shutdown.
61
+
62
+ Usage:
63
+ #{__FILE__} command [params]
64
+
65
+ Command is one of:
66
+ run Run in foreground (exit with ctrl-c)
67
+ #{extra_cmd_help} help This message
68
+
69
+ Params:
70
+ --log-fg Don't write log into file (writes to foreground)
71
+ -d Debug/Development mode
72
+ --trace-js Write content of msg.reply calls to stdout
73
+ --trace-delegate Traces plugin method delegation to stdout
74
+ --root-path <PATH> Define the PATH to rsence server
75
+ Defaults to 'bin'
76
+ --port PORT Define the http PORT to use, defaults to '8001'
77
+ --latency MS Simulate network latency, value in milliseconds
78
+ --addr <ADDRESS> Define the IPv4 ADDRESS to bind to.
79
+ Defaults to '0.0.0.0' (any)
80
+ --server <SERVER> Choose http SERVER, valid choices:
81
+ - webrick
82
+ - mongrel
83
+ - ebb
84
+ - thin
85
+ Defaults to thin
86
+ --reset-sessions Deletes all old sessions on startup
87
+ --config <PATH> Optional config override file
88
+ --run-config-wizard Runs configuration wizard
89
+ Runs by default, if no local
90
+ configuration files were found.
91
+ --no-rescan Doesn't rescan the plugins even when in debug mode.
92
+ --profile Turns on profiling
93
+ - Runs everything considerable slower!
94
+ - Shown a table displaying the results on stop.
95
+ --help This message
96
+ -h This message
97
+
98
+ Examples:
99
+ #{__FILE__} run
100
+ #{extra_cmd_examples}
101
+ Further information:
102
+ http://riassence.org/
103
+
104
+ }
105
+ exit
106
+ end
107
+
108
+ require 'profile' if ARGV.include?('--profile')
109
+
110
+ ## Auto-construct paths using this file as the waypoint
111
+ SERVER_PATH = ARGV.include?('--root-path')?(ARGV[ARGV.index('--root-path')+1]):File.split(File.expand_path(File.dirname(__FILE__)))[0]
112
+
113
+ ## Include server & lib in the search path
114
+ $LOAD_PATH << SERVER_PATH
115
+ $LOAD_PATH << File.join( SERVER_PATH, 'lib' )
116
+
117
+ ## Riassence Daemon controls
118
+ require 'daemon/daemon'
119
+ RSence::HTTPDaemon.daemonize
120
+