rhoconnect 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. data/CHANGELOG +208 -0
  2. data/CREDITS +38 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +97 -0
  5. data/LICENSE +75 -0
  6. data/README.md +10 -0
  7. data/Rakefile +82 -0
  8. data/bench/bench +7 -0
  9. data/bench/bench_runner.rb +112 -0
  10. data/bench/benchapp/Gemfile +21 -0
  11. data/bench/benchapp/Gemfile.lock +76 -0
  12. data/bench/benchapp/Rakefile +22 -0
  13. data/bench/benchapp/application.rb +39 -0
  14. data/bench/benchapp/config.ru +36 -0
  15. data/bench/benchapp/settings/license.key +1 -0
  16. data/bench/benchapp/settings/settings.yml +20 -0
  17. data/bench/benchapp/sources/mock_adapter.rb +55 -0
  18. data/bench/benchapp/sources/queue_mock_adapter.rb +2 -0
  19. data/bench/benchapp/spec/sources/mock_adapter_spec.rb +25 -0
  20. data/bench/benchapp/spec/sources/queue_mock_adapter_spec.rb +25 -0
  21. data/bench/benchapp/spec/spec_helper.rb +42 -0
  22. data/bench/blobapp/Gemfile +31 -0
  23. data/bench/blobapp/Gemfile.lock +103 -0
  24. data/bench/blobapp/Rakefile +25 -0
  25. data/bench/blobapp/application.rb +44 -0
  26. data/bench/blobapp/config.ru +36 -0
  27. data/bench/blobapp/settings/license.key +1 -0
  28. data/bench/blobapp/settings/settings.yml +16 -0
  29. data/bench/blobapp/sources/blob_adapter.rb +71 -0
  30. data/bench/blobapp/spec/sources/blob_adapter_spec.rb +25 -0
  31. data/bench/blobapp/spec/spec_helper.rb +42 -0
  32. data/bench/lib/bench/cli.rb +16 -0
  33. data/bench/lib/bench/logging.rb +13 -0
  34. data/bench/lib/bench/mock_client.rb +41 -0
  35. data/bench/lib/bench/result.rb +50 -0
  36. data/bench/lib/bench/runner.rb +107 -0
  37. data/bench/lib/bench/session.rb +67 -0
  38. data/bench/lib/bench/statistics.rb +56 -0
  39. data/bench/lib/bench/test_data.rb +98 -0
  40. data/bench/lib/bench/timer.rb +10 -0
  41. data/bench/lib/bench/utils.rb +49 -0
  42. data/bench/lib/bench.rb +129 -0
  43. data/bench/lib/testdata/100-data.txt +148 -0
  44. data/bench/lib/testdata/5-data.txt +9 -0
  45. data/bench/lib/testdata/images/icon.ico +0 -0
  46. data/bench/lib/testdata/images/icon.png +0 -0
  47. data/bench/lib/testdata/images/loading-Landscape.png +0 -0
  48. data/bench/lib/testdata/images/loading-LandscapeLeft.png +0 -0
  49. data/bench/lib/testdata/images/loading-LandscapeRight.png +0 -0
  50. data/bench/lib/testdata/images/loading-Portrait.png +0 -0
  51. data/bench/lib/testdata/images/loading-PortraitUpsideDown.png +0 -0
  52. data/bench/lib/testdata/images/loading.png +0 -0
  53. data/bench/lib/testdata/images/loading@2x.png +0 -0
  54. data/bench/run_bench.sh +42 -0
  55. data/bench/run_blob_script.sh +3 -0
  56. data/bench/run_cud_script.sh +3 -0
  57. data/bench/run_query_md_script.sh +3 -0
  58. data/bench/run_query_only_script.sh +3 -0
  59. data/bench/run_query_script.sh +3 -0
  60. data/bench/scripts/blob_cud_script.rb +98 -0
  61. data/bench/scripts/cud_script.rb +92 -0
  62. data/bench/scripts/helpers.rb +101 -0
  63. data/bench/scripts/query_md_script.rb +45 -0
  64. data/bench/scripts/query_only_script.rb +51 -0
  65. data/bench/scripts/query_script.rb +45 -0
  66. data/bench/spec/bench_spec_helper.rb +33 -0
  67. data/bench/spec/logging_spec.rb +15 -0
  68. data/bench/spec/mock_adapter_spec.rb +61 -0
  69. data/bench/spec/mock_client_spec.rb +65 -0
  70. data/bench/spec/result_spec.rb +61 -0
  71. data/bench/spec/utils_spec.rb +36 -0
  72. data/bin/rhoconnect +34 -0
  73. data/bin/rhoconnect-setup +84 -0
  74. data/doc/async-jobs.txt +69 -0
  75. data/doc/authentication.txt +76 -0
  76. data/doc/benchmarks.txt +168 -0
  77. data/doc/blob-sync.txt +130 -0
  78. data/doc/bulk-sync.txt +102 -0
  79. data/doc/client.txt +432 -0
  80. data/doc/command-line.txt +210 -0
  81. data/doc/contributing.txt +60 -0
  82. data/doc/deploying.txt +82 -0
  83. data/doc/install.txt +28 -0
  84. data/doc/introduction.txt +20 -0
  85. data/doc/licensing.txt +18 -0
  86. data/doc/metadata.txt +458 -0
  87. data/doc/migration.txt +182 -0
  88. data/doc/public/css/print.css +29 -0
  89. data/doc/public/css/screen.css +257 -0
  90. data/doc/public/css/style.css +20 -0
  91. data/doc/push.txt +135 -0
  92. data/doc/release.txt +41 -0
  93. data/doc/rest-api.txt +367 -0
  94. data/doc/source-adapters.txt +325 -0
  95. data/doc/stats-middleware.txt +69 -0
  96. data/doc/testing.txt +222 -0
  97. data/doc/tutorial.txt +315 -0
  98. data/doc/web-console.txt +35 -0
  99. data/examples/simple/Rakefile +14 -0
  100. data/examples/simple/application.rb +27 -0
  101. data/examples/simple/config.ru +49 -0
  102. data/examples/simple/settings/license.key +1 -0
  103. data/examples/simple/settings/settings.yml +23 -0
  104. data/examples/simple/sources/sample_adapter.rb +5 -0
  105. data/examples/simple/sources/simple_adapter.rb +5 -0
  106. data/generators/rhoconnect.rb +119 -0
  107. data/generators/templates/application/Gemfile +21 -0
  108. data/generators/templates/application/Rakefile +22 -0
  109. data/generators/templates/application/application.rb +39 -0
  110. data/generators/templates/application/config.ru +36 -0
  111. data/generators/templates/application/settings/license.key +1 -0
  112. data/generators/templates/application/settings/settings.yml +14 -0
  113. data/generators/templates/application/spec/spec_helper.rb +42 -0
  114. data/generators/templates/source/source_adapter.rb +47 -0
  115. data/generators/templates/source/source_spec.rb +25 -0
  116. data/install.sh +408 -0
  117. data/installer/unix-like/rho_connect_install_checkers.rb +140 -0
  118. data/installer/unix-like/rho_connect_install_constants.rb +51 -0
  119. data/installer/unix-like/rho_connect_install_debian.rb +63 -0
  120. data/installer/unix-like/rho_connect_install_dnd.rb +58 -0
  121. data/installer/unix-like/rho_connect_install_get_params.rb +30 -0
  122. data/installer/unix-like/rho_connect_install_installers.rb +142 -0
  123. data/installer/unix-like/rho_connect_install_utilities.rb +85 -0
  124. data/installer/unix-like/rho_connect_install_yum.rb +63 -0
  125. data/installer/unix-like/rhoinstaller.rb +89 -0
  126. data/installer/utils/create_texts.rb +366 -0
  127. data/installer/utils/install_test.rb +140 -0
  128. data/installer/windows/EnvVarUpdate.nsh +328 -0
  129. data/installer/windows/ServiceLib.nsh +369 -0
  130. data/installer/windows/configUi.ini +44 -0
  131. data/installer/windows/icon.ico +0 -0
  132. data/installer/windows/rhosync.nsi +418 -0
  133. data/installer/windows/uninstall.bat +7 -0
  134. data/lib/rhoconnect/api/admin/get_api_token.rb +14 -0
  135. data/lib/rhoconnect/api/admin/get_license_info.rb +8 -0
  136. data/lib/rhoconnect/api/admin/login.rb +6 -0
  137. data/lib/rhoconnect/api/admin/reset.rb +10 -0
  138. data/lib/rhoconnect/api/admin/stats.rb +21 -0
  139. data/lib/rhoconnect/api/application/bulk_data.rb +7 -0
  140. data/lib/rhoconnect/api/application/clientcreate.rb +8 -0
  141. data/lib/rhoconnect/api/application/clientlogin.rb +6 -0
  142. data/lib/rhoconnect/api/application/clientregister.rb +6 -0
  143. data/lib/rhoconnect/api/application/clientreset.rb +6 -0
  144. data/lib/rhoconnect/api/application/query.rb +7 -0
  145. data/lib/rhoconnect/api/application/queue_updates.rb +6 -0
  146. data/lib/rhoconnect/api/application/search.rb +6 -0
  147. data/lib/rhoconnect/api/client/create_client.rb +3 -0
  148. data/lib/rhoconnect/api/client/delete_client.rb +5 -0
  149. data/lib/rhoconnect/api/client/get_client_params.rb +3 -0
  150. data/lib/rhoconnect/api/client/list_client_docs.rb +12 -0
  151. data/lib/rhoconnect/api/client/list_clients.rb +3 -0
  152. data/lib/rhoconnect/api/client/ping.rb +7 -0
  153. data/lib/rhoconnect/api/source/get_adapter.rb +3 -0
  154. data/lib/rhoconnect/api/source/get_db_doc.rb +7 -0
  155. data/lib/rhoconnect/api/source/get_source_params.rb +3 -0
  156. data/lib/rhoconnect/api/source/list_source_docs.rb +10 -0
  157. data/lib/rhoconnect/api/source/list_sources.rb +15 -0
  158. data/lib/rhoconnect/api/source/push_deletes.rb +8 -0
  159. data/lib/rhoconnect/api/source/push_objects.rb +8 -0
  160. data/lib/rhoconnect/api/source/save_adapter.rb +3 -0
  161. data/lib/rhoconnect/api/source/set_db_doc.rb +8 -0
  162. data/lib/rhoconnect/api/source/set_refresh_time.rb +8 -0
  163. data/lib/rhoconnect/api/source/upload_file.rb +4 -0
  164. data/lib/rhoconnect/api/user/create_user.rb +7 -0
  165. data/lib/rhoconnect/api/user/delete_user.rb +9 -0
  166. data/lib/rhoconnect/api/user/list_users.rb +3 -0
  167. data/lib/rhoconnect/api/user/update_user.rb +4 -0
  168. data/lib/rhoconnect/api_token.rb +19 -0
  169. data/lib/rhoconnect/app.rb +76 -0
  170. data/lib/rhoconnect/bulk_data/bulk_data.rb +88 -0
  171. data/lib/rhoconnect/bulk_data/syncdb.index.schema +4 -0
  172. data/lib/rhoconnect/bulk_data/syncdb.schema +41 -0
  173. data/lib/rhoconnect/bulk_data.rb +2 -0
  174. data/lib/rhoconnect/client.rb +96 -0
  175. data/lib/rhoconnect/client_sync.rb +412 -0
  176. data/lib/rhoconnect/console/app/helpers/auth_helper.rb +22 -0
  177. data/lib/rhoconnect/console/app/helpers/extensions.rb +19 -0
  178. data/lib/rhoconnect/console/app/helpers/helpers.rb +57 -0
  179. data/lib/rhoconnect/console/app/public/ThickBox.css +649 -0
  180. data/lib/rhoconnect/console/app/public/home.css +438 -0
  181. data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
  182. data/lib/rhoconnect/console/app/public/images/header_halo.jpg +0 -0
  183. data/lib/rhoconnect/console/app/public/images/land_separator.gif +0 -0
  184. data/lib/rhoconnect/console/app/public/images/landing_header.jpg +0 -0
  185. data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
  186. data/lib/rhoconnect/console/app/public/images/rhomobile_rhohub_logo.png +0 -0
  187. data/lib/rhoconnect/console/app/public/images/tabs_separator.png +0 -0
  188. data/lib/rhoconnect/console/app/public/jqplot/excanvas.min.js +35 -0
  189. data/lib/rhoconnect/console/app/public/jqplot/jqplot.barRenderer.min.js +34 -0
  190. data/lib/rhoconnect/console/app/public/jqplot/jqplot.canvasAxisLabelRenderer.js +187 -0
  191. data/lib/rhoconnect/console/app/public/jqplot/jqplot.canvasAxisTickRenderer.js +226 -0
  192. data/lib/rhoconnect/console/app/public/jqplot/jqplot.canvasTextRenderer.js +408 -0
  193. data/lib/rhoconnect/console/app/public/jqplot/jqplot.categoryAxisRenderer.min.js +34 -0
  194. data/lib/rhoconnect/console/app/public/jqplot/jqplot.cursor.js +952 -0
  195. data/lib/rhoconnect/console/app/public/jqplot/jqplot.dateAxisRenderer.js +313 -0
  196. data/lib/rhoconnect/console/app/public/jqplot/jqplot.dateAxisRenderer.min.js +34 -0
  197. data/lib/rhoconnect/console/app/public/jqplot/jqplot.pointLabels.min.js +34 -0
  198. data/lib/rhoconnect/console/app/public/jqplot/jquery-1.4.2.min.js +154 -0
  199. data/lib/rhoconnect/console/app/public/jqplot/jquery.jqplot.min.css +1 -0
  200. data/lib/rhoconnect/console/app/public/jqplot/jquery.jqplot.min.js +34 -0
  201. data/lib/rhoconnect/console/app/public/main.css +7 -0
  202. data/lib/rhoconnect/console/app/public/reset.css +76 -0
  203. data/lib/rhoconnect/console/app/public/style.css +2201 -0
  204. data/lib/rhoconnect/console/app/public/text.txt +0 -0
  205. data/lib/rhoconnect/console/app/routes/adapter.rb +28 -0
  206. data/lib/rhoconnect/console/app/routes/auth.rb +29 -0
  207. data/lib/rhoconnect/console/app/routes/client.rb +31 -0
  208. data/lib/rhoconnect/console/app/routes/docs.rb +145 -0
  209. data/lib/rhoconnect/console/app/routes/heroku.rb +19 -0
  210. data/lib/rhoconnect/console/app/routes/home.rb +63 -0
  211. data/lib/rhoconnect/console/app/routes/timing.rb +242 -0
  212. data/lib/rhoconnect/console/app/routes/user.rb +117 -0
  213. data/lib/rhoconnect/console/app/views/adapter.erb +16 -0
  214. data/lib/rhoconnect/console/app/views/client.erb +30 -0
  215. data/lib/rhoconnect/console/app/views/content.erb +14 -0
  216. data/lib/rhoconnect/console/app/views/doc.erb +8 -0
  217. data/lib/rhoconnect/console/app/views/docdata.erb +28 -0
  218. data/lib/rhoconnect/console/app/views/docs.erb +30 -0
  219. data/lib/rhoconnect/console/app/views/edituser.erb +13 -0
  220. data/lib/rhoconnect/console/app/views/headermenu.erb +40 -0
  221. data/lib/rhoconnect/console/app/views/home.erb +24 -0
  222. data/lib/rhoconnect/console/app/views/index.erb +58 -0
  223. data/lib/rhoconnect/console/app/views/jqplot.erb +52 -0
  224. data/lib/rhoconnect/console/app/views/layout.erb +165 -0
  225. data/lib/rhoconnect/console/app/views/login.erb +26 -0
  226. data/lib/rhoconnect/console/app/views/newuser.erb +17 -0
  227. data/lib/rhoconnect/console/app/views/ping.erb +28 -0
  228. data/lib/rhoconnect/console/app/views/result.erb +11 -0
  229. data/lib/rhoconnect/console/app/views/rightboxlinks.erb +15 -0
  230. data/lib/rhoconnect/console/app/views/select_doc.erb +17 -0
  231. data/lib/rhoconnect/console/app/views/upload_doc.erb +23 -0
  232. data/lib/rhoconnect/console/app/views/user.erb +29 -0
  233. data/lib/rhoconnect/console/app/views/users.erb +12 -0
  234. data/lib/rhoconnect/console/rhoconnect_api.rb +245 -0
  235. data/lib/rhoconnect/console/server.rb +32 -0
  236. data/lib/rhoconnect/console.rb +3 -0
  237. data/lib/rhoconnect/cors.rb +229 -0
  238. data/lib/rhoconnect/credential.rb +9 -0
  239. data/lib/rhoconnect/db_adapter.rb +46 -0
  240. data/lib/rhoconnect/document.rb +49 -0
  241. data/lib/rhoconnect/dynamic_adapter.rb +91 -0
  242. data/lib/rhoconnect/generator.rb +1 -0
  243. data/lib/rhoconnect/jobs/bulk_data_job.rb +203 -0
  244. data/lib/rhoconnect/jobs/ping_job.rb +46 -0
  245. data/lib/rhoconnect/jobs/source_job.rb +16 -0
  246. data/lib/rhoconnect/license.rb +86 -0
  247. data/lib/rhoconnect/lock_ops.rb +11 -0
  248. data/lib/rhoconnect/model.rb +414 -0
  249. data/lib/rhoconnect/ping/android.rb +56 -0
  250. data/lib/rhoconnect/ping/apple.rb +52 -0
  251. data/lib/rhoconnect/ping/blackberry.rb +56 -0
  252. data/lib/rhoconnect/ping.rb +3 -0
  253. data/lib/rhoconnect/read_state.rb +31 -0
  254. data/lib/rhoconnect/rho_indifferent_access.rb +88 -0
  255. data/lib/rhoconnect/server/views/index.erb +13 -0
  256. data/lib/rhoconnect/server.rb +286 -0
  257. data/lib/rhoconnect/source.rb +289 -0
  258. data/lib/rhoconnect/source_adapter.rb +123 -0
  259. data/lib/rhoconnect/source_sync.rb +302 -0
  260. data/lib/rhoconnect/stats/middleware.rb +20 -0
  261. data/lib/rhoconnect/stats/record.rb +108 -0
  262. data/lib/rhoconnect/store.rb +232 -0
  263. data/lib/rhoconnect/tasks.rb +350 -0
  264. data/lib/rhoconnect/test_methods.rb +220 -0
  265. data/lib/rhoconnect/user.rb +95 -0
  266. data/lib/rhoconnect/version.rb +3 -0
  267. data/lib/rhoconnect/x_domain_session_wrapper.rb +53 -0
  268. data/lib/rhoconnect.rb +285 -0
  269. data/rhoconnect.gemspec +67 -0
  270. data/spec/api/admin/api_token_spec.rb +14 -0
  271. data/spec/api/admin/get_api_token_spec.rb +36 -0
  272. data/spec/api/admin/get_license_info_spec.rb +38 -0
  273. data/spec/api/admin/reset_spec.rb +22 -0
  274. data/spec/api/admin/stats_spec.rb +66 -0
  275. data/spec/api/api_helper.rb +21 -0
  276. data/spec/api/application/rhoconnect_api_spec.rb +548 -0
  277. data/spec/api/client/create_client_spec.rb +13 -0
  278. data/spec/api/client/delete_client_spec.rb +13 -0
  279. data/spec/api/client/get_client_params_spec.rb +18 -0
  280. data/spec/api/client/list_client_docs_spec.rb +32 -0
  281. data/spec/api/client/list_clients_spec.rb +22 -0
  282. data/spec/api/client/ping_spec.rb +23 -0
  283. data/spec/api/rhosync_api_spec.rb.orig +606 -0
  284. data/spec/api/source/adapter_spec.rb +29 -0
  285. data/spec/api/source/get_db_doc_spec.rb +21 -0
  286. data/spec/api/source/get_source_params_spec.rb +32 -0
  287. data/spec/api/source/list_source_docs_spec.rb +25 -0
  288. data/spec/api/source/list_sources_spec.rb +26 -0
  289. data/spec/api/source/push_deletes_spec.rb +18 -0
  290. data/spec/api/source/push_objects_spec.rb +27 -0
  291. data/spec/api/source/set_db_doc_spec.rb +19 -0
  292. data/spec/api/source/set_refresh_time_spec.rb +43 -0
  293. data/spec/api/source/upload_file_spec.rb +26 -0
  294. data/spec/api/user/create_user_spec.rb +16 -0
  295. data/spec/api/user/delete_user_spec.rb +36 -0
  296. data/spec/api/user/list_users_spec.rb +30 -0
  297. data/spec/api/user/update_user_spec.rb +31 -0
  298. data/spec/api_token_spec.rb +14 -0
  299. data/spec/app_spec.rb +18 -0
  300. data/spec/apps/emptyapp/application.rb +27 -0
  301. data/spec/apps/emptyapp/settings/license.key +1 -0
  302. data/spec/apps/emptyapp/settings/settings.yml +14 -0
  303. data/spec/apps/rhotestapp/Rakefile +1 -0
  304. data/spec/apps/rhotestapp/application.rb +19 -0
  305. data/spec/apps/rhotestapp/config.ru +1 -0
  306. data/spec/apps/rhotestapp/settings/apple_fake_cert.pem +1 -0
  307. data/spec/apps/rhotestapp/settings/license.key +1 -0
  308. data/spec/apps/rhotestapp/settings/settings.yml +36 -0
  309. data/spec/apps/rhotestapp/sources/base_adapter.rb +9 -0
  310. data/spec/apps/rhotestapp/sources/fixed_schema_adapter.rb +28 -0
  311. data/spec/apps/rhotestapp/sources/sample_adapter.rb +71 -0
  312. data/spec/apps/rhotestapp/sources/simple_adapter.rb +41 -0
  313. data/spec/apps/rhotestapp/sources/sub_adapter.rb +7 -0
  314. data/spec/apps/rhotestapp/vendor/mygem-0.1.0/lib/mygem/mygem.rb +8 -0
  315. data/spec/apps/rhotestapp/vendor/mygem-0.1.0/lib/mygem.rb +1 -0
  316. data/spec/bulk_data/bulk_data_spec.rb +97 -0
  317. data/spec/client_spec.rb +124 -0
  318. data/spec/client_sync_spec.rb +774 -0
  319. data/spec/doc/base.html +72 -0
  320. data/spec/doc/doc_spec.rb +376 -0
  321. data/spec/doc/footer.html +4 -0
  322. data/spec/doc/header.html +30 -0
  323. data/spec/document_spec.rb +31 -0
  324. data/spec/dynamic_adapter_spec.rb +43 -0
  325. data/spec/factories/factories.rb +17 -0
  326. data/spec/generator/generator_spec.rb +58 -0
  327. data/spec/generator/generator_spec_helper.rb +9 -0
  328. data/spec/jobs/bulk_data_job_spec.rb +125 -0
  329. data/spec/jobs/ping_job_spec.rb +102 -0
  330. data/spec/jobs/source_job_spec.rb +29 -0
  331. data/spec/license_spec.rb +66 -0
  332. data/spec/model_spec.rb +273 -0
  333. data/spec/perf/bulk_data_perf_spec.rb +32 -0
  334. data/spec/perf/perf_spec_helper.rb +50 -0
  335. data/spec/perf/store_perf_spec.rb +27 -0
  336. data/spec/ping/android_spec.rb +91 -0
  337. data/spec/ping/apple_spec.rb +70 -0
  338. data/spec/ping/blackberry_spec.rb +62 -0
  339. data/spec/read_state_spec.rb +35 -0
  340. data/spec/rhosync_spec.rb +75 -0
  341. data/spec/server/cors_spec.rb +287 -0
  342. data/spec/server/server_spec.rb +470 -0
  343. data/spec/server/x_domain_session_wrapper_spec.rb +150 -0
  344. data/spec/source_adapter_spec.rb +125 -0
  345. data/spec/source_spec.rb +114 -0
  346. data/spec/source_sync_spec.rb +328 -0
  347. data/spec/spec.opts +4 -0
  348. data/spec/spec_helper.rb +231 -0
  349. data/spec/stats/middleware_spec.rb +53 -0
  350. data/spec/stats/record_spec.rb +92 -0
  351. data/spec/store_spec.rb +251 -0
  352. data/spec/support/shared_examples.rb +168 -0
  353. data/spec/sync_states_spec.rb +72 -0
  354. data/spec/test_methods_spec.rb +134 -0
  355. data/spec/testdata/1000-data.txt +1414 -0
  356. data/spec/testdata/compressed/compress-data.txt +1 -0
  357. data/spec/testdata/upload1.txt +1 -0
  358. data/spec/testdata/upload2.txt +1 -0
  359. data/spec/user_spec.rb +139 -0
  360. data/tasks/redis.rake +206 -0
  361. metadata +706 -0
data/doc/migration.txt ADDED
@@ -0,0 +1,182 @@
1
+ Migrating RhoSync application to RhoConnect
2
+ ===
3
+
4
+ The best way of migrating your Rhosync app to Rhoconnect is to re-generate the application skeleton
5
+ using Rhoconnect, then integrate all of your implementation specifics into it.
6
+ However, if you prefer to migrate your Rhosync app manually, perform the steps in this document:
7
+
8
+ ## Install the Bundler
9
+ Install the `bundler` gem:
10
+
11
+ :::term
12
+ $ [sudo] gem install bundler
13
+
14
+ ## Create the Gemfile
15
+ Create a new `Gemfile` file in your application directory with the following content:
16
+
17
+ :::ruby
18
+ source 'http://rubygems.org'
19
+
20
+ gem 'rhoconnect', '3.0.0'
21
+
22
+ group :development do
23
+ # By default to run application thin web server is used
24
+ gem 'thin', '1.2.11', :platforms => :ruby
25
+
26
+ # For jruby trinidad JRuby web server is used
27
+ gem 'trinidad', :platforms => :jruby
28
+ # Alternative for jruby
29
+ # gem 'jetty-rackup', :platforms => :jruby
30
+ end
31
+
32
+ group :test do
33
+ gem 'rack-test', '>= 0.5.3', :require => "rack/test"
34
+ gem 'rspec', '~> 2.6.0'
35
+ gem 'rcov', '>= 0.9.8'
36
+ end
37
+
38
+ ## Edit the Rakefile
39
+
40
+ Adjust the existing `Rakefile` by changing `rhosync` to `rhoconnect`.
41
+
42
+ Change this:
43
+
44
+ :::ruby
45
+ begin
46
+ require 'vendor/rhosync/lib/rhosync/tasks'
47
+ require 'vendor/rhosync/lib/rhosync'
48
+ rescue LoadError
49
+ require 'rhosync/tasks'
50
+ require 'rhosync'
51
+ end
52
+
53
+ to this:
54
+
55
+ :::ruby
56
+ begin
57
+ require 'vendor/rhoconnect/lib/rhoconnect/tasks'
58
+ require 'vendor/rhoconnect/lib/rhoconnect'
59
+ rescue LoadError
60
+ require 'rhoconnect/tasks'
61
+ require 'rhoconnect'
62
+ end
63
+
64
+ ## Edit config.ru
65
+
66
+ Adjust `config.ru` file by performing the following steps:
67
+
68
+ 1) Change the section shown below to replace `rhosync` with `rhoconnect`.
69
+
70
+ Change this:
71
+
72
+ :::ruby
73
+ begin
74
+ require 'vendor/rhosync/lib/rhosync/tasks'
75
+ require 'vendor/rhosync/lib/rhosync'
76
+ rescue LoadError
77
+ require 'rhosync/tasks'
78
+ require 'rhosync'
79
+ end
80
+
81
+ to this:
82
+
83
+ :::ruby
84
+ begin
85
+ require 'vendor/rhoconnect/lib/rhoconnect/tasks'
86
+ require 'vendor/rhoconnect/lib/rhoconnect'
87
+ rescue LoadError
88
+ require 'rhoconnect/tasks'
89
+ require 'rhoconnect'
90
+ end
91
+
92
+ 2) Change all `Rhosync` references to `Rhoconnect`.
93
+
94
+ For example, change this:
95
+
96
+ :::ruby
97
+ Rhosync::Server.disable :run
98
+
99
+ to this:
100
+
101
+ :::ruby
102
+ Rhoconnect::Server.disable :run
103
+
104
+ ## Edit application.rb
105
+
106
+ Adjust `application.rb` file with the following steps:
107
+
108
+ 1) Change the name of the base class from:
109
+
110
+ :::ruby
111
+ class Application < Rhosync::Base
112
+
113
+ to:
114
+
115
+ :::ruby
116
+ class Application < Rhoconnect::Base
117
+
118
+ ## Edit spec/spec_helper.rb
119
+
120
+ Edit your `spec/spec_helper.rb` file to contain the following:
121
+
122
+ :::ruby
123
+ require 'rubygems'
124
+
125
+ # Set environment to test
126
+ ENV['RHO_ENV'] = 'test'
127
+ ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..'))
128
+ Bundler.require(:default, ENV['RHO_ENV'].to_sym)
129
+
130
+ # Try to load vendor-ed rhoconnect, otherwise load the gem
131
+ begin
132
+ require 'vendor/rhoconnect/lib/rhoconnect'
133
+ rescue LoadError
134
+ require 'rhoconnect'
135
+ end
136
+
137
+ # Load our rhoconnect application
138
+ require './application'
139
+ include Rhoconnect
140
+
141
+ require 'rhoconnect/test_methods'
142
+
143
+ module RSpec
144
+ module Core
145
+ module SharedExampleGroup
146
+ private
147
+ def ensure_shared_example_group_name_not_taken(name)
148
+ end
149
+ end
150
+ end
151
+ end
152
+
153
+ shared_examples_for "SpecHelper" do
154
+ include Rhoconnect::TestMethods
155
+
156
+ before(:each) do
157
+ Store.db.flushdb
158
+ Application.initializer(ROOT_PATH)
159
+ end
160
+ end
161
+
162
+ ## Edit spec files
163
+ all of your spec files should be modified from:
164
+
165
+ :::ruby
166
+ describe "<SampleSpec>" do
167
+ it_should_behave_like "SpecHelper"
168
+ ...
169
+ end
170
+
171
+ to:
172
+
173
+ :::ruby
174
+ describe "<SampleSpec>" do
175
+ it_should_behave_like "SpecHelper" do
176
+ ...
177
+ end
178
+ end
179
+
180
+ ## Edit implementation files
181
+ Modify all of your application implementation files by changing the `Rhosync` references
182
+ to `Rhoconnect`.
@@ -0,0 +1,29 @@
1
+ /* -----------------------------------------------------------------------
2
+
3
+
4
+ Blueprint CSS Framework 0.9
5
+ http://blueprintcss.org
6
+
7
+ * Copyright (c) 2007-Present. See LICENSE for more info.
8
+ * See README for instructions on how to use Blueprint.
9
+ * For credits and origins, see AUTHORS.
10
+ * This is a compressed file. See the sources in the 'src' directory.
11
+
12
+ ----------------------------------------------------------------------- */
13
+
14
+ /* print.css */
15
+ body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;}
16
+ .container {background:none;}
17
+ hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
18
+ hr.space {background:#fff;color:#fff;visibility:hidden;}
19
+ h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
20
+ code {font:.9em "Courier New", Monaco, Courier, monospace;}
21
+ a img {border:none;}
22
+ p img.top {margin-top:0;}
23
+ blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
24
+ .small {font-size:.9em;}
25
+ .large {font-size:1.1em;}
26
+ .quiet {color:#999;}
27
+ .hide {display:none;}
28
+ a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
29
+ a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
@@ -0,0 +1,257 @@
1
+ /* -----------------------------------------------------------------------
2
+
3
+
4
+ Blueprint CSS Framework 0.9
5
+ http://blueprintcss.org
6
+
7
+ * Copyright (c) 2007-Present. See LICENSE for more info.
8
+ * See README for instructions on how to use Blueprint.
9
+ * For credits and origins, see AUTHORS.
10
+ * This is a compressed file. See the sources in the 'src' directory.
11
+
12
+ ----------------------------------------------------------------------- */
13
+
14
+ /* reset.css */
15
+ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
16
+ body {line-height:1.5;}
17
+ table {border-collapse:separate;border-spacing:0;}
18
+ caption, th, td {text-align:left;font-weight:normal;}
19
+ table, td, th {vertical-align:middle;}
20
+ blockquote:before, blockquote:after, q:before, q:after {content:"";}
21
+ blockquote, q {quotes:"" "";}
22
+ a img {border:none;}
23
+
24
+ /* typography.css */
25
+ html {font-size:100.01%;}
26
+ body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
27
+ h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
28
+ h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
29
+ h2 {font-size:2em;margin-bottom:0.75em;}
30
+ h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
31
+ h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
32
+ h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
33
+ h6 {font-size:1em;font-weight:bold;}
34
+ h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
35
+ p {margin:0 0 1.5em;}
36
+ p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
37
+ p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
38
+ a:focus, a:hover {color:#000;}
39
+ a {color:#009;text-decoration:underline;}
40
+ blockquote {margin:1.5em;color:#666;font-style:italic;}
41
+ strong {font-weight:bold;}
42
+ em, dfn {font-style:italic;}
43
+ dfn {font-weight:bold;}
44
+ sup, sub {line-height:0;}
45
+ abbr, acronym {border-bottom:1px dotted #666;}
46
+ address {margin:0 0 1.5em;font-style:italic;}
47
+ del {color:#666;}
48
+ pre {margin:1.5em 0;white-space:pre;}
49
+ pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
50
+ li ul, li ol {margin:0;}
51
+ ul, ol {margin:0 1.5em 1.5em 0;padding-left:3.333em;}
52
+ ul {list-style-type:disc;}
53
+ ol {list-style-type:decimal;}
54
+ dl {margin:0 0 1.5em 0;}
55
+ dl dt {font-weight:bold;}
56
+ dd {margin-left:1.5em;}
57
+ table {table-layout: fixed; margin-bottom:1.4em;width:100%;}
58
+ th {font-weight:bold;}
59
+ thead th {background:#c3d9ff;}
60
+ th, td, caption {padding:1px 4px 1px 2px;}
61
+ tr.even td {background:#e5ecf9;}
62
+ tfoot {font-style:italic;}
63
+ caption {background:#eee;}
64
+ .small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
65
+ .large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
66
+ .hide {display:none;}
67
+ .quiet {color:#666;}
68
+ .loud {color:#000;}
69
+ .highlight {background:#ff0;}
70
+ .added {background:#060;color:#fff;}
71
+ .removed {background:#900;color:#fff;}
72
+ .first {margin-left:0;padding-left:0;}
73
+ .last {margin-right:0;padding-right:0;}
74
+ .top {margin-top:0;padding-top:0;}
75
+ .bottom {margin-bottom:0;padding-bottom:0;}
76
+
77
+ /* forms.css */
78
+ label {font-weight:bold;}
79
+ fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
80
+ legend {font-weight:bold;font-size:1.2em;}
81
+ input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;}
82
+ input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;}
83
+ input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;}
84
+ input.text, input.title {width:300px;padding:5px;}
85
+ input.title {font-size:1.5em;}
86
+ textarea {width:390px;height:250px;padding:5px;}
87
+ input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;}
88
+ form.inline {line-height:3;}
89
+ form.inline p {margin-bottom:0;}
90
+ .error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
91
+ .error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
92
+ .notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
93
+ .success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
94
+ .error a {color:#8a1f11;}
95
+ .notice a {color:#514721;}
96
+ .success a {color:#264409;}
97
+
98
+ /* grid.css */
99
+ .container {width:950px;margin:0 auto;}
100
+ .showgrid {background:url(src/grid.png);}
101
+ .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
102
+ .last, div.last {margin-right:0;}
103
+ .span-1 {width:30px;}
104
+ .span-2 {width:70px;}
105
+ .span-3 {width:110px;}
106
+ .span-4 {width:150px;}
107
+ .span-5 {width:190px;}
108
+ .span-6 {width:230px;}
109
+ .span-7 {width:270px;}
110
+ .span-8 {width:310px;}
111
+ .span-9 {width:350px;}
112
+ .span-10 {width:390px;}
113
+ .span-11 {width:430px;}
114
+ .span-12 {width:470px;}
115
+ .span-13 {width:510px;}
116
+ .span-14 {width:550px;}
117
+ .span-15 {width:590px;}
118
+ .span-16 {width:630px;}
119
+ .span-17 {width:670px;}
120
+ .span-18 {width:710px;}
121
+ .span-19 {width:750px;}
122
+ .span-20 {width:790px;}
123
+ .span-21 {width:830px;}
124
+ .span-22 {width:870px;}
125
+ .span-23 {width:910px;}
126
+ .span-24, div.span-24 {width:950px;margin-right:0;}
127
+ input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;}
128
+ input.span-1, textarea.span-1 {width:18px!important;}
129
+ input.span-2, textarea.span-2 {width:58px!important;}
130
+ input.span-3, textarea.span-3 {width:98px!important;}
131
+ input.span-4, textarea.span-4 {width:138px!important;}
132
+ input.span-5, textarea.span-5 {width:178px!important;}
133
+ input.span-6, textarea.span-6 {width:218px!important;}
134
+ input.span-7, textarea.span-7 {width:258px!important;}
135
+ input.span-8, textarea.span-8 {width:298px!important;}
136
+ input.span-9, textarea.span-9 {width:338px!important;}
137
+ input.span-10, textarea.span-10 {width:378px!important;}
138
+ input.span-11, textarea.span-11 {width:418px!important;}
139
+ input.span-12, textarea.span-12 {width:458px!important;}
140
+ input.span-13, textarea.span-13 {width:498px!important;}
141
+ input.span-14, textarea.span-14 {width:538px!important;}
142
+ input.span-15, textarea.span-15 {width:578px!important;}
143
+ input.span-16, textarea.span-16 {width:618px!important;}
144
+ input.span-17, textarea.span-17 {width:658px!important;}
145
+ input.span-18, textarea.span-18 {width:698px!important;}
146
+ input.span-19, textarea.span-19 {width:738px!important;}
147
+ input.span-20, textarea.span-20 {width:778px!important;}
148
+ input.span-21, textarea.span-21 {width:818px!important;}
149
+ input.span-22, textarea.span-22 {width:858px!important;}
150
+ input.span-23, textarea.span-23 {width:898px!important;}
151
+ input.span-24, textarea.span-24 {width:938px!important;}
152
+ .append-1 {padding-right:40px;}
153
+ .append-2 {padding-right:80px;}
154
+ .append-3 {padding-right:120px;}
155
+ .append-4 {padding-right:160px;}
156
+ .append-5 {padding-right:200px;}
157
+ .append-6 {padding-right:240px;}
158
+ .append-7 {padding-right:280px;}
159
+ .append-8 {padding-right:320px;}
160
+ .append-9 {padding-right:360px;}
161
+ .append-10 {padding-right:400px;}
162
+ .append-11 {padding-right:440px;}
163
+ .append-12 {padding-right:480px;}
164
+ .append-13 {padding-right:520px;}
165
+ .append-14 {padding-right:560px;}
166
+ .append-15 {padding-right:600px;}
167
+ .append-16 {padding-right:640px;}
168
+ .append-17 {padding-right:680px;}
169
+ .append-18 {padding-right:720px;}
170
+ .append-19 {padding-right:760px;}
171
+ .append-20 {padding-right:800px;}
172
+ .append-21 {padding-right:840px;}
173
+ .append-22 {padding-right:880px;}
174
+ .append-23 {padding-right:920px;}
175
+ .prepend-1 {padding-left:40px;}
176
+ .prepend-2 {padding-left:80px;}
177
+ .prepend-3 {padding-left:120px;}
178
+ .prepend-4 {padding-left:160px;}
179
+ .prepend-5 {padding-left:200px;}
180
+ .prepend-6 {padding-left:240px;}
181
+ .prepend-7 {padding-left:280px;}
182
+ .prepend-8 {padding-left:320px;}
183
+ .prepend-9 {padding-left:360px;}
184
+ .prepend-10 {padding-left:400px;}
185
+ .prepend-11 {padding-left:440px;}
186
+ .prepend-12 {padding-left:480px;}
187
+ .prepend-13 {padding-left:520px;}
188
+ .prepend-14 {padding-left:560px;}
189
+ .prepend-15 {padding-left:600px;}
190
+ .prepend-16 {padding-left:640px;}
191
+ .prepend-17 {padding-left:680px;}
192
+ .prepend-18 {padding-left:720px;}
193
+ .prepend-19 {padding-left:760px;}
194
+ .prepend-20 {padding-left:800px;}
195
+ .prepend-21 {padding-left:840px;}
196
+ .prepend-22 {padding-left:880px;}
197
+ .prepend-23 {padding-left:920px;}
198
+ div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
199
+ div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
200
+ .pull-1 {margin-left:-40px;}
201
+ .pull-2 {margin-left:-80px;}
202
+ .pull-3 {margin-left:-120px;}
203
+ .pull-4 {margin-left:-160px;}
204
+ .pull-5 {margin-left:-200px;}
205
+ .pull-6 {margin-left:-240px;}
206
+ .pull-7 {margin-left:-280px;}
207
+ .pull-8 {margin-left:-320px;}
208
+ .pull-9 {margin-left:-360px;}
209
+ .pull-10 {margin-left:-400px;}
210
+ .pull-11 {margin-left:-440px;}
211
+ .pull-12 {margin-left:-480px;}
212
+ .pull-13 {margin-left:-520px;}
213
+ .pull-14 {margin-left:-560px;}
214
+ .pull-15 {margin-left:-600px;}
215
+ .pull-16 {margin-left:-640px;}
216
+ .pull-17 {margin-left:-680px;}
217
+ .pull-18 {margin-left:-720px;}
218
+ .pull-19 {margin-left:-760px;}
219
+ .pull-20 {margin-left:-800px;}
220
+ .pull-21 {margin-left:-840px;}
221
+ .pull-22 {margin-left:-880px;}
222
+ .pull-23 {margin-left:-920px;}
223
+ .pull-24 {margin-left:-960px;}
224
+ .pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
225
+ .push-1 {margin:0 -40px 1.5em 40px;}
226
+ .push-2 {margin:0 -80px 1.5em 80px;}
227
+ .push-3 {margin:0 -120px 1.5em 120px;}
228
+ .push-4 {margin:0 -160px 1.5em 160px;}
229
+ .push-5 {margin:0 -200px 1.5em 200px;}
230
+ .push-6 {margin:0 -240px 1.5em 240px;}
231
+ .push-7 {margin:0 -280px 1.5em 280px;}
232
+ .push-8 {margin:0 -320px 1.5em 320px;}
233
+ .push-9 {margin:0 -360px 1.5em 360px;}
234
+ .push-10 {margin:0 -400px 1.5em 400px;}
235
+ .push-11 {margin:0 -440px 1.5em 440px;}
236
+ .push-12 {margin:0 -480px 1.5em 480px;}
237
+ .push-13 {margin:0 -520px 1.5em 520px;}
238
+ .push-14 {margin:0 -560px 1.5em 560px;}
239
+ .push-15 {margin:0 -600px 1.5em 600px;}
240
+ .push-16 {margin:0 -640px 1.5em 640px;}
241
+ .push-17 {margin:0 -680px 1.5em 680px;}
242
+ .push-18 {margin:0 -720px 1.5em 720px;}
243
+ .push-19 {margin:0 -760px 1.5em 760px;}
244
+ .push-20 {margin:0 -800px 1.5em 800px;}
245
+ .push-21 {margin:0 -840px 1.5em 840px;}
246
+ .push-22 {margin:0 -880px 1.5em 880px;}
247
+ .push-23 {margin:0 -920px 1.5em 920px;}
248
+ .push-24 {margin:0 -960px 1.5em 960px;}
249
+ .push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
250
+ .prepend-top {margin-top:1.5em;}
251
+ .append-bottom {margin-bottom:1.5em;}
252
+ .box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
253
+ hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
254
+ hr.space {background:#fff;color:#fff;visibility:hidden;}
255
+ .clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
256
+ .clearfix, .container {display:block;}
257
+ .clear {clear:both;}
@@ -0,0 +1,20 @@
1
+ h2 { background: #ddd; text-align: center; padding: 4px; }
2
+
3
+ .content { font-size: 1.2em; }
4
+ .content h3 { background: #ffd; font-size: 1.5em; padding: 6px 2px; }
5
+
6
+ #wrapper { text-align: left; width: 640px; } /* toc width */
7
+
8
+ /* font styling */
9
+ #wrapper h1 { font-size: 18px; margin-bottom: 0.8em; text-align: left; }
10
+ #wrapper a { color: #222; }
11
+ #wrapper a:hover { color: #555; }
12
+ #wrapper p { font-size: 18px; margin: 1.5em 0; }
13
+ /*#wrapper p a { background: url(dot.gif) repeat-x bottom left; }*/
14
+
15
+ /* start table of contents styling */
16
+ ul#toc { list-style: none; width: 640px; padding-left: 0;}
17
+ /*#toc li { background: url(dot.gif) repeat-x 0 0.85em; }*/
18
+ #toc li a { font-size: 14px; background: #FFF; padding: 0 0 0 10px; }
19
+ #toc li span { font-size: 14px; background: #FFF; padding: 0 0 0 4px; }
20
+ #toc li br { clear: both; }
data/doc/push.txt ADDED
@@ -0,0 +1,135 @@
1
+ Device Push
2
+ ===
3
+
4
+ RhoConnect has a simple ruby API for sending push notifications to a user's devices. This API can be called directly, queued as a resque job, or called remotely via the [RhoConnect REST API](/rhoconnect/rest-api). The push message can trigger the following actions in the rhodes application: alert with a message, sync one or more sources, vibrate, display a badge, play a sound file.
5
+
6
+ We will now show you how to use the RhoConnect application to deliver push messages on each platform and how you can handle the push notification in your Rhodes application.
7
+
8
+ ## iOS
9
+ To setup your RhoConnect application for iOS push, you will need to update `settings/settings.yml` to include the following:
10
+
11
+ :::yaml
12
+ :development:
13
+ :redis: localhost:6379
14
+ :iphonecertfile: settings/apple_push_cert.pem
15
+ :iphonepassphrase: #=> empty or put password for your certificate
16
+ :iphoneserver: gateway.sandbox.push.apple.com
17
+ :iphoneport: 2195
18
+ :syncserver: http://localhost:9292/application/
19
+ :licensefile: settings/license.key
20
+
21
+ This is for running your application in development mode, for production you will need all of the iphone settings, and change the `:iphoneserver:` to:
22
+
23
+ :::yaml
24
+ :iphoneserver: gateway.push.apple.com
25
+
26
+ ## Blackberry
27
+ To setup your RhoConnect application for BlackBerry push, you will need to update `settings/settings.yml` to include the following:
28
+
29
+ :::yaml
30
+ :development:
31
+ :redis: localhost:6379
32
+ :mdsserver: 192.168.1.110
33
+ :mdsserverport: 8080
34
+ :syncserver: http://localhost:9292/application/
35
+ :licensefile: settings/license.key
36
+
37
+ Replace `:mdsserver:` and `:mdsserverport:` with the hostname/IP and port of your machine (default port is 8080).
38
+
39
+ ## Android
40
+ To setup your RhoConnect application for Android push, you will need to update `settings/settings.yml` to include the following:
41
+
42
+ :::yaml
43
+ :development:
44
+ :redis: localhost:6379
45
+ :syncserver: http://localhost:9292/application/
46
+ :licensefile: settings/license.key
47
+ :authtoken: authtoken
48
+
49
+ Replace `:authtoken:` value with actual authentication token. This token MUST be related to the role-based google account registered for your application. See [the rhodes push instructions](/rhodes/device-caps#push-notifications) for more details. To retrieve this token, use sample script [c2dm.rb](http://github.com/rhomobile/rhodes/blob/master/bin/c2dm.rb). Uncomment last two lines and put your google account specific data, then run it. It will print token to stdout.
50
+
51
+ For those who interested in what this token means, here is the description: <a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html"/>.
52
+
53
+ Now start up your RhoConnect application and setup [push notifications](/rhodes/device-caps#push-notifications) in your Rhodes application.
54
+
55
+ ## Testing Push in the Web Console
56
+ The [RhoConnect Web Console](/rhoconnect/web-console) includes a utility for testing push to make sure everything is wired up correctly.
57
+
58
+ First, make sure you've logged in and performed a sync on the device/simulator you are going to test.
59
+
60
+ Next, once you've logged into the web console, navigate to the user's page you used to login in the Rhodes application. For example, if you logged in as user 't', the url would be:
61
+
62
+ http://localhost:9292/console/user?user_id=t
63
+
64
+ You should see a registered device for this user, for example: "c92e36874bc74f39a8fbd7c1a86f9e0e". Click on the link for this device and you will see the device attributes:
65
+
66
+ device_type: APPLE
67
+ device_pin: 10fd92abfa8ee48155d9af6e7329086322b323fd0d18fdbd19e92d03c0fef7c8
68
+ device_port: 100
69
+ user_id: t
70
+ app_id: application
71
+
72
+ **NOTE: If you don't see all of these attributes, then something is incorrect in your Rhodes application settings. Please verify you followed the [Rhodes application push setup](/rhodes/device-caps#push-notifications).**
73
+
74
+ Now that the device is registered, go back to the user page and click 'Ping User'.
75
+
76
+ Here you can specify an alert message, sources array to sync, badge value (iOS only), sound file to play, and duration to vibrate.
77
+
78
+ Enter in some values or try the defaults, you should see a push message on the device when you click "Ping!".
79
+
80
+ By default, the sources list will be a comma-separated list of your RhoConnect application's sources. This sources list will be sent in the push message to trigger a sync. You can specify one or more sources, or 'all' to trigger a sync of all sources.
81
+
82
+ ## Push API
83
+ The RhoConnect push API consists of executing a ping call. There are three ways to execute a ping call: use RhoConnect API to remotely call the ping, perform the ping job directly in a blocking ruby call, enqueue a resque job to ping asynchronously.
84
+
85
+ ### RhoConnect API Ping Method
86
+ You can trigger a push remotely using the [RhoConnect API Ping method](/rhoconnect/rest-api). This is useful if you want to fully control the push process from a remote server (instead of your source adapter).
87
+
88
+ ### Direct Push
89
+ To perform a ping directly, you can call the following:
90
+
91
+ :::ruby
92
+ PingJob.perform(
93
+ 'user_id' => current_user.login,
94
+ 'sources' => ['Product','Customer'],
95
+ 'message' => 'hello world',
96
+ 'vibrate' => 2000,
97
+ 'sound' => 'hello.mp3'
98
+ )
99
+
100
+ ### Asynchronous Push
101
+ To queue a ping that is executed asynchronously in a job, you can call the following:
102
+
103
+ :::ruby
104
+ Resque.enqueue(
105
+ PingJob,
106
+ 'user_id' => current_user.login,
107
+ 'sources' => ['Product','Customer'],
108
+ 'message' => 'hello world',
109
+ 'vibrate' => 2000,
110
+ 'sound' => 'hello.mp3'
111
+ )
112
+
113
+ **Note: For this job to execute, you will need to have a resque worker running. See running [async jobs](/rhoconnect/async-jobs) for more information.**
114
+
115
+ ### Example
116
+ Let's say we want to execute a ping for the `current_user` at the end of our source adapter query:
117
+
118
+ :::ruby
119
+ def query(params=nil)
120
+ parsed = JSON.parse(RestClient.get("#{@base}.json").body)
121
+
122
+ @result = {}
123
+ parsed.each do |item|
124
+ @result[item["product"]["id"].to_s] = item["product"]
125
+ end if parsed
126
+ PingJob.perform(
127
+ 'user_id' => current_user.login,
128
+ 'sources' => ['Product'],
129
+ 'message' => "There are new products!",
130
+ 'vibrate' => 2000
131
+ )
132
+ end
133
+
134
+ ### Push Notifications in Rhodes
135
+ Now that you can send push messages in your RhoConnect application, you can now handle the [push notification](/rhodes/device-caps#push-notifications) in your Rhodes application.
data/doc/release.txt ADDED
@@ -0,0 +1,41 @@
1
+ RhoConnect Release Process
2
+ ===
3
+ The RhoConnect release process addresses following requirements:
4
+
5
+ * Introduce new features in timely fashion
6
+ * Be very responsive to the bugs and requests from forum and customer requests
7
+ * Provide the highest-quality possible
8
+ * Provide up-to-date documentation and trackable CHANGELOG of the project history
9
+
10
+ ### Release cycle
11
+ * Each release will be focused on a single feature (or a few small ones)
12
+ * Each release will include bug fixes requested by customers
13
+ * Each release will be done in 1-2 weeks time
14
+
15
+ ### Versioning
16
+ Versioning will be done according to [http://semver.org/ Semantic Versioning] and input from pm/sales.
17
+
18
+ ### Pivotal tracker story workflow
19
+
20
+ * Research is done, design/api is done and reviewed
21
+ * Feature is split into smaller tasks and added to pivotal (recommended length of an individual task is 4-8 hours)
22
+ * Test code / implementation code cycle is done
23
+ * Docs are written including relevant code samples or sample applications
24
+ * Code review is done
25
+ * CHANGELOG is updated with message under ## <version> header
26
+ * Send announcement to dev@rhomobile.com about new feature with links to docs, samples, and tests
27
+
28
+ ### Conditions to accept pivotal story
29
+ * Bug/feature is implemented or fixed and reviewed
30
+ * Tests are written and reviewed
31
+ * Docs are updated as needed
32
+ * CHANGELOG is updated with message under ## <version> header
33
+
34
+ ### Release steps
35
+ * To make a release one or more features or bugs should be accepted in pivotal
36
+ * Make sure each feature & bugfix has an entry in CHANGELOG under ## <version> header
37
+ * To accept feature or bug in pivotal see instructions above
38
+ * Tag applied to git and gem is created
39
+ * When all test tickets are accepted gem is released to rubygems.org
40
+ * Pivotal milestone is marked completed
41
+ * The same procedure follows for minor release