rhoconnect 3.2.1 → 3.3.1.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. data/CHANGELOG.md +24 -5
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +20 -20
  4. data/bench/benchapp/Gemfile +17 -20
  5. data/bench/benchapp/config.ru +2 -2
  6. data/bench/benchapp/settings/settings.yml +3 -3
  7. data/bench/blobapp/Gemfile +16 -13
  8. data/bench/blobapp/config.ru +2 -2
  9. data/bench/blobapp/settings/settings.yml +5 -3
  10. data/bench/lib/bench.rb +35 -32
  11. data/bench/lib/bench/session.rb +9 -1
  12. data/bench/scripts/blob_cud_script.rb +13 -17
  13. data/bench/scripts/cud_script.rb +11 -12
  14. data/bench/scripts/helpers.rb +5 -7
  15. data/bench/scripts/query_md_script.rb +18 -12
  16. data/bench/scripts/query_only_script.rb +19 -11
  17. data/bench/scripts/query_script.rb +17 -13
  18. data/bench/scripts/test_query_script.rb +46 -17
  19. data/bench/scripts/test_source_script.rb +7 -7
  20. data/commands/commands/dtach_commands/dtach_install.rb +44 -16
  21. data/commands/commands/rhoconnect/spec.rb +13 -9
  22. data/commands/commands/rhoconnect/version.rb +6 -0
  23. data/commands/execute.rb +10 -6
  24. data/doc/deploying.txt +75 -13
  25. data/doc/install.txt +3 -3
  26. data/doc/push-client-setup.txt +1 -1
  27. data/doc/rest-api.txt +4 -23
  28. data/doc/rhoconnect-redis-stack.txt +26 -7
  29. data/doc/settings.txt +9 -3
  30. data/examples/simple/Gemfile +3 -1
  31. data/examples/simple/application.rb +5 -0
  32. data/examples/simple/config.ru +3 -2
  33. data/examples/simple/my_server.rb +14 -0
  34. data/examples/simple/settings/settings.yml +1 -0
  35. data/generators/templates/application/Gemfile +4 -4
  36. data/generators/templates/application/application.rb +4 -0
  37. data/generators/templates/application/settings/settings.yml +4 -1
  38. data/installer/unix-like/create_texts.rb +39 -1
  39. data/installer/unix-like/rho_connect_install_constants.rb +1 -1
  40. data/installer/utils/package_upload/repos.rake +7 -5
  41. data/lib/rhoconnect.rb +3 -2
  42. data/lib/rhoconnect/api/app/ans_login.rb +3 -0
  43. data/lib/rhoconnect/api/app/bulk_data.rb +6 -0
  44. data/lib/rhoconnect/api/{source → app}/fast_delete.rb +1 -1
  45. data/lib/rhoconnect/api/{source → app}/fast_insert.rb +2 -2
  46. data/lib/rhoconnect/api/{source → app}/fast_update.rb +2 -2
  47. data/lib/rhoconnect/api/app/login.rb +5 -0
  48. data/lib/rhoconnect/api/{source → app}/push_deletes.rb +1 -1
  49. data/lib/rhoconnect/api/{source → app}/push_objects.rb +1 -1
  50. data/lib/rhoconnect/api/app/query.rb +4 -0
  51. data/lib/rhoconnect/api/app/queue_updates.rb +94 -0
  52. data/lib/rhoconnect/api/app/search.rb +4 -0
  53. data/lib/rhoconnect/api/client/client_get_db_doc.rb +5 -0
  54. data/lib/rhoconnect/api/client/client_set_db_doc.rb +8 -0
  55. data/lib/rhoconnect/api/client/create.rb +7 -0
  56. data/lib/rhoconnect/api/client/get_client_params.rb +2 -1
  57. data/lib/rhoconnect/api/client/list_client_docs.rb +2 -1
  58. data/lib/rhoconnect/api/client/register.rb +12 -0
  59. data/lib/rhoconnect/api/client/reset.rb +5 -0
  60. data/lib/rhoconnect/api/{source → readstate}/set_refresh_time.rb +2 -1
  61. data/lib/rhoconnect/api/source/get_source_params.rb +3 -2
  62. data/lib/rhoconnect/api/source/list_sources.rb +2 -1
  63. data/lib/rhoconnect/api/source/update_source_params.rb +3 -3
  64. data/lib/rhoconnect/api/store/get_db_doc.rb +4 -0
  65. data/lib/rhoconnect/api/store/set_db_doc.rb +7 -0
  66. data/lib/rhoconnect/api/system/get_adapter.rb +4 -0
  67. data/lib/rhoconnect/api/{admin → system}/get_license_info.rb +2 -1
  68. data/lib/rhoconnect/api/system/login.rb +15 -0
  69. data/lib/rhoconnect/api/{admin → system}/reset.rb +3 -2
  70. data/lib/rhoconnect/api/system/save_adapter.rb +4 -0
  71. data/lib/rhoconnect/api/{admin → system}/stats.rb +2 -1
  72. data/lib/rhoconnect/api/user/create_user.rb +2 -2
  73. data/lib/rhoconnect/api/user/delete_client.rb +6 -0
  74. data/lib/rhoconnect/api/user/delete_user.rb +2 -1
  75. data/lib/rhoconnect/api/user/list_clients.rb +4 -0
  76. data/lib/rhoconnect/api/user/list_source_docs.rb +11 -0
  77. data/lib/rhoconnect/api/user/list_users.rb +1 -1
  78. data/lib/rhoconnect/api/user/ping.rb +7 -0
  79. data/lib/rhoconnect/api/user/show_user.rb +3 -0
  80. data/lib/rhoconnect/api/user/update_user.rb +3 -2
  81. data/lib/rhoconnect/api/user/user_get_db_doc.rb +5 -0
  82. data/lib/rhoconnect/api/user/user_set_db_doc.rb +10 -0
  83. data/lib/rhoconnect/app.rb +12 -2
  84. data/lib/rhoconnect/async.rb +6 -10
  85. data/lib/rhoconnect/bulk_data/bulk_data.rb +4 -4
  86. data/lib/rhoconnect/client.rb +10 -9
  87. data/lib/rhoconnect/client_sync.rb +24 -19
  88. data/lib/rhoconnect/document.rb +18 -4
  89. data/lib/rhoconnect/graph_helper.rb +4 -2
  90. data/lib/rhoconnect/jobs/bulk_data_job.rb +1 -1
  91. data/lib/rhoconnect/jobs/ping_job.rb +39 -29
  92. data/lib/rhoconnect/middleware/admin_user.rb +23 -0
  93. data/lib/rhoconnect/middleware/body_content_type_parser.rb +35 -0
  94. data/lib/rhoconnect/{cors.rb → middleware/cors.rb} +1 -0
  95. data/lib/rhoconnect/middleware/current_app.rb +16 -0
  96. data/lib/rhoconnect/middleware/current_request.rb +16 -0
  97. data/lib/rhoconnect/middleware/current_user.rb +17 -0
  98. data/lib/rhoconnect/middleware/helpers.rb +105 -0
  99. data/lib/rhoconnect/middleware/login_required.rb +22 -0
  100. data/lib/rhoconnect/{stats/middleware.rb → middleware/stats.rb} +5 -3
  101. data/lib/rhoconnect/middleware/x_domain_session_wrapper.rb +58 -0
  102. data/lib/rhoconnect/ping.rb +1 -0
  103. data/lib/rhoconnect/ping/apple.rb +18 -16
  104. data/lib/rhoconnect/ping/blackberry.rb +9 -9
  105. data/lib/rhoconnect/ping/rhoconnect_push.rb +45 -0
  106. data/lib/rhoconnect/server.rb +98 -91
  107. data/lib/rhoconnect/source.rb +5 -1
  108. data/lib/rhoconnect/source_sync.rb +4 -3
  109. data/lib/rhoconnect/stats/record.rb +15 -15
  110. data/lib/rhoconnect/store.rb +253 -75
  111. data/lib/rhoconnect/tasks.rb +3 -3
  112. data/lib/rhoconnect/version.rb +1 -1
  113. data/lib/rhoconnect/web-console/controllers/admins.js +1 -14
  114. data/lib/rhoconnect/web-console/models/adapter.js +18 -8
  115. data/lib/rhoconnect/web-console/models/client.js +15 -9
  116. data/lib/rhoconnect/web-console/models/doc.js +7 -11
  117. data/lib/rhoconnect/web-console/models/session.js +5 -2
  118. data/lib/rhoconnect/web-console/models/source.js +55 -36
  119. data/lib/rhoconnect/web-console/models/user.js +20 -11
  120. data/lib/rhoconnect/web-console/public/backbone.js +8 -2
  121. data/lib/rhoconnect/web-console/templates/index.erb +11 -5
  122. data/lib/rhoconnect/web-console/views/doc.js +6 -8
  123. data/lib/rhoconnect/web-console/views/edit_user.js +6 -3
  124. data/lib/rhoconnect/web-console/views/home.js +98 -25
  125. data/lib/rhoconnect/web-console/views/index.js +1 -1
  126. data/lib/rhoconnect/web-console/views/new_ping.js +6 -3
  127. data/lib/rhoconnect/web-console/views/server_doc.js +12 -4
  128. data/lib/rhoconnect/web-console/views/show_device.js +6 -3
  129. data/rhoconnect.gemspec +1 -2
  130. data/spec/api/{source → app}/fast_delete_spec.rb +4 -4
  131. data/spec/api/{source → app}/fast_insert_spec.rb +4 -4
  132. data/spec/api/{source → app}/fast_update_spec.rb +22 -6
  133. data/spec/api/{source → app}/push_deletes_spec.rb +2 -2
  134. data/spec/api/app/push_objects_spec.rb +45 -0
  135. data/spec/api/client/client_get_db_doc_spec.rb +31 -0
  136. data/spec/api/client/client_set_db_doc_spec.rb +14 -0
  137. data/spec/api/client/get_client_params_spec.rb +3 -2
  138. data/spec/api/client/list_client_docs_spec.rb +2 -2
  139. data/spec/api/{source → readstate}/set_refresh_time_spec.rb +15 -9
  140. data/spec/api/source/get_source_params_spec.rb +3 -2
  141. data/spec/api/source/list_sources_spec.rb +3 -9
  142. data/spec/api/source/update_source_params_spec.rb +4 -4
  143. data/spec/api/store/get_db_doc_spec.rb +32 -0
  144. data/spec/api/store/set_db_doc_spec.rb +43 -0
  145. data/spec/api/system/adapter_spec.rb +33 -0
  146. data/spec/api/{admin → system}/get_license_info_spec.rb +2 -5
  147. data/spec/api/{admin/get_api_token_spec.rb → system/login_spec.rb} +4 -11
  148. data/spec/api/{admin → system}/reset_spec.rb +2 -2
  149. data/spec/api/{admin → system}/stats_spec.rb +19 -13
  150. data/spec/api/user/create_user_spec.rb +15 -8
  151. data/spec/api/{client → user}/delete_client_spec.rb +3 -4
  152. data/spec/api/user/delete_user_spec.rb +33 -4
  153. data/spec/api/user/list_clients_spec.rb +30 -0
  154. data/spec/api/user/list_source_docs_spec.rb +35 -0
  155. data/spec/api/user/list_users_spec.rb +5 -6
  156. data/spec/api/{client → user}/ping_spec.rb +4 -6
  157. data/spec/api/user/show_user_spec.rb +14 -0
  158. data/spec/api/user/update_user_spec.rb +28 -10
  159. data/spec/api/user/user_get_db_doc_spec.rb +16 -0
  160. data/spec/api/user/user_set_db_doc_spec.rb +41 -0
  161. data/spec/apps/rhotestapp/application.rb +4 -0
  162. data/spec/apps/rhotestapp/settings/settings.yml +3 -1
  163. data/spec/bulk_data/bulk_data_spec.rb +13 -0
  164. data/spec/client_sync_spec.rb +41 -59
  165. data/spec/document_spec.rb +23 -0
  166. data/spec/javascripts/doc_view_spec.js +1 -1
  167. data/spec/javascripts/home_view_spec.js +10 -5
  168. data/spec/javascripts/index_view_spec.js +1 -1
  169. data/spec/jobs/ping_job_spec.rb +26 -0
  170. data/spec/perf/store_perf_spec.rb +1 -1
  171. data/spec/ping/android_spec.rb +0 -7
  172. data/spec/ping/apple_spec.rb +7 -0
  173. data/spec/ping/blackberry_spec.rb +10 -0
  174. data/spec/ping/rhoconnect_push_spec.rb +58 -0
  175. data/spec/server/cors_spec.rb +1 -1
  176. data/spec/server/server_spec.rb +152 -104
  177. data/spec/{stats/middleware_spec.rb → server/stats_spec.rb} +4 -5
  178. data/spec/server/x_domain_session_wrapper_spec.rb +3 -3
  179. data/spec/source_spec.rb +2 -2
  180. data/spec/source_sync_spec.rb +2 -0
  181. data/spec/spec_helper.rb +17 -3
  182. data/spec/stats/record_spec.rb +18 -19
  183. data/spec/store_spec.rb +51 -26
  184. data/spec/support/shared_examples.rb +4 -0
  185. data/spec/sync_states_spec.rb +2 -2
  186. metadata +104 -88
  187. data/bench/benchapp/Gemfile.lock +0 -87
  188. data/bench/blobapp/Gemfile.lock +0 -107
  189. data/bench/lib/testdata/5-data.txt +0 -8
  190. data/doc/release.txt +0 -41
  191. data/lib/rhoconnect/api/admin/get_api_token.rb +0 -14
  192. data/lib/rhoconnect/api/admin/login.rb +0 -6
  193. data/lib/rhoconnect/api/application/bulk_data.rb +0 -7
  194. data/lib/rhoconnect/api/application/clientcreate.rb +0 -8
  195. data/lib/rhoconnect/api/application/clientlogin.rb +0 -6
  196. data/lib/rhoconnect/api/application/clientregister.rb +0 -13
  197. data/lib/rhoconnect/api/application/clientreset.rb +0 -6
  198. data/lib/rhoconnect/api/application/query.rb +0 -7
  199. data/lib/rhoconnect/api/application/queue_updates.rb +0 -20
  200. data/lib/rhoconnect/api/application/search.rb +0 -6
  201. data/lib/rhoconnect/api/client/create_client.rb +0 -3
  202. data/lib/rhoconnect/api/client/delete_client.rb +0 -5
  203. data/lib/rhoconnect/api/client/list_clients.rb +0 -3
  204. data/lib/rhoconnect/api/client/ping.rb +0 -7
  205. data/lib/rhoconnect/api/source/get_adapter.rb +0 -3
  206. data/lib/rhoconnect/api/source/get_db_doc.rb +0 -7
  207. data/lib/rhoconnect/api/source/list_source_docs.rb +0 -10
  208. data/lib/rhoconnect/api/source/save_adapter.rb +0 -3
  209. data/lib/rhoconnect/api/source/set_db_doc.rb +0 -10
  210. data/lib/rhoconnect/api/source/upload_file.rb +0 -4
  211. data/lib/rhoconnect/body_content_type_parser.rb +0 -32
  212. data/lib/rhoconnect/x_domain_session_wrapper.rb +0 -53
  213. data/spec/api/admin/api_token_spec.rb +0 -13
  214. data/spec/api/client/create_client_spec.rb +0 -13
  215. data/spec/api/client/list_clients_spec.rb +0 -22
  216. data/spec/api/source/adapter_spec.rb +0 -29
  217. data/spec/api/source/get_db_doc_spec.rb +0 -21
  218. data/spec/api/source/list_source_docs_spec.rb +0 -25
  219. data/spec/api/source/push_objects_spec.rb +0 -27
  220. data/spec/api/source/set_db_doc_spec.rb +0 -32
  221. data/spec/api/source/upload_file_spec.rb +0 -26
@@ -1,8 +1,27 @@
1
- ## 3.2.1 (2012-06-21)
2
- * #30760809 - moved appserver url to redis
3
-
4
- ## 3.2.0 (2012-05-30)
5
- * #27555029 - support REDISTOGO_URL in addition to REDIS env vars as redis connection strings for Heroku
1
+ ## 3.3.1.beta2 (2012-07-09
2
+ * #29806209 - Store re-design - implement persistent hashing
3
+ * #32389009 - Store re-design - optimize sync by computing diffs only for the requested number of objects (as specified by page_size)
4
+ * #26876157 - push: auth route added `/ans/login`
5
+ * #26892609 - push: queue support
6
+ * #31863031 - push: handle token post `device_push_type` attribute
7
+ * #32483159 - update web console to use RC v1 routes
8
+
9
+ ## 3.3.1.beta1 (2012-06-29)
10
+ * #29796429 - use list to preserve bulk data sources order
11
+ * #29743645 - do not execute ping when platform is not configured
12
+ * #27198669 - REST API routes
13
+ * #27422451 - Create middleware to extract API token, current user, etc.
14
+ * #27198831 - Move API_TOKEN from params into the header
15
+ * #27198869 - Move CLIENT_ID from params into the header
16
+ * #30760809 - Bug move appserver to redis from memory and config settings
17
+ * #30732533 - dtach-install command fails
18
+ * Added `version` command to print current version
19
+ * #31161737 - PingJob handles missing user ids or users with no clients
20
+ * #31245585 - blob_attribs in bulk database missing overwrite flag
21
+
22
+ ## 3.2.1 (2012-06-22)
23
+ * #30760809 - Bug move appserver to redis from memory and config settings
24
+ * #27555029 - support REDISTOGO_URL in addition to REDIS env vars as redis connection strings
6
25
 
7
26
  ## 3.2.0.final (2012-05-15)
8
27
  * Release candidate
data/Gemfile CHANGED
@@ -37,7 +37,7 @@ group :development do
37
37
  end
38
38
 
39
39
  group :test do
40
- gem 'rspec', '~> 2.9.0'
40
+ gem 'rspec', '~> 2.10.0'
41
41
  gem "rcov", '~> 1.0.0', :require => false, :platforms => :ruby_18
42
42
  gem 'simplecov', :require => false, :platforms => [:ruby_19,:jruby]
43
43
  gem 'rack-test', '>= 0.5.3', :require => 'rack/test'
@@ -46,5 +46,5 @@ group :test do
46
46
  end
47
47
 
48
48
  group :build do
49
- gem 'fpm', '>= 0.4.6'
49
+ gem 'fpm', '>= 0.4.9'
50
50
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (3.2.1)
4
+ rhoconnect (3.3.1.beta2)
5
5
  bundler (~> 1.0)
6
6
  json (~> 1.6.0)
7
7
  rake (~> 0.9.2)
@@ -11,7 +11,7 @@ PATH
11
11
  rubyzip (~> 0.9.4)
12
12
  sinatra (~> 1.3)
13
13
  templater (~> 1.0.0)
14
- thor (~> 0.14.6)
14
+ thor (~> 0.15.0)
15
15
  uuidtools (>= 2.1.1)
16
16
 
17
17
  GEM
@@ -31,7 +31,7 @@ GEM
31
31
  builder (3.0.0)
32
32
  cabin (0.4.4)
33
33
  json
34
- childprocess (0.3.2)
34
+ childprocess (0.3.3)
35
35
  ffi (~> 1.0.6)
36
36
  clamp (0.3.1)
37
37
  coffee-script (2.2.0)
@@ -41,16 +41,16 @@ GEM
41
41
  crack (0.3.1)
42
42
  daemons (1.1.8)
43
43
  diff-lcs (1.1.3)
44
- eventmachine (1.0.0.rc.1)
45
- excon (0.13.4)
44
+ eventmachine (1.0.0.rc.4)
45
+ excon (0.14.3)
46
46
  execjs (1.4.0)
47
47
  multi_json (~> 1.0)
48
48
  extlib (0.9.15)
49
49
  ffaker (1.14.0)
50
50
  ffi (1.0.11)
51
- fog (1.3.1)
51
+ fog (1.4.0)
52
52
  builder
53
- excon (~> 0.13.0)
53
+ excon (~> 0.14.0)
54
54
  formatador (~> 0.2.0)
55
55
  mime-types
56
56
  multi_json (~> 1.0)
@@ -87,7 +87,7 @@ GEM
87
87
  net-scp (1.0.4)
88
88
  net-ssh (>= 1.99.1)
89
89
  net-ssh (2.5.2)
90
- nokogiri (1.5.4)
90
+ nokogiri (1.5.5)
91
91
  rack (1.4.1)
92
92
  rack-fiber_pool (0.9.2)
93
93
  rack-protection (1.2.0)
@@ -107,14 +107,14 @@ GEM
107
107
  vegas (~> 0.1.2)
108
108
  rest-client (1.6.7)
109
109
  mime-types (>= 1.16)
110
- rspec (2.9.0)
111
- rspec-core (~> 2.9.0)
112
- rspec-expectations (~> 2.9.0)
113
- rspec-mocks (~> 2.9.0)
114
- rspec-core (2.9.0)
115
- rspec-expectations (2.9.0)
110
+ rspec (2.10.0)
111
+ rspec-core (~> 2.10.0)
112
+ rspec-expectations (~> 2.10.0)
113
+ rspec-mocks (~> 2.10.0)
114
+ rspec-core (2.10.0)
115
+ rspec-expectations (2.10.0)
116
116
  diff-lcs (~> 1.1.3)
117
- rspec-mocks (2.9.0)
117
+ rspec-mocks (2.10.1)
118
118
  ruby-hmac (0.4.0)
119
119
  rubyzip (0.9.9)
120
120
  selenium-webdriver (2.24.0)
@@ -130,7 +130,7 @@ GEM
130
130
  rack (~> 1.3, >= 1.3.6)
131
131
  rack-protection (~> 1.2)
132
132
  tilt (~> 1.3, >= 1.3.3)
133
- sprockets (2.4.3)
133
+ sprockets (2.4.4)
134
134
  hike (~> 1.2)
135
135
  multi_json (~> 1.0)
136
136
  rack (~> 1.0)
@@ -140,11 +140,11 @@ GEM
140
140
  diff-lcs (>= 1.1.2)
141
141
  extlib (>= 0.9.5)
142
142
  highline (>= 1.4.0)
143
- thin (1.3.1)
143
+ thin (1.4.1)
144
144
  daemons (>= 1.0.9)
145
145
  eventmachine (>= 0.12.6)
146
146
  rack (>= 1.0.0)
147
- thor (0.14.6)
147
+ thor (0.15.4)
148
148
  tilt (1.3.3)
149
149
  uuidtools (2.1.2)
150
150
  vegas (0.1.11)
@@ -166,7 +166,7 @@ DEPENDENCIES
166
166
  eventmachine (~> 1.0.0.beta)
167
167
  ffaker (~> 1.14.0)
168
168
  fog (>= 1.1.0)
169
- fpm (>= 0.4.6)
169
+ fpm (>= 0.4.9)
170
170
  jasmine
171
171
  jasmine-headless-webkit
172
172
  jdbc-sqlite3 (>= 3.7.2)
@@ -175,7 +175,7 @@ DEPENDENCIES
175
175
  rack-test (>= 0.5.3)
176
176
  rcov (~> 1.0.0)
177
177
  rhoconnect!
178
- rspec (~> 2.9.0)
178
+ rspec (~> 2.10.0)
179
179
  simplecov
180
180
  sqlite3 (>= 1.3.3)
181
181
  thin
@@ -1,35 +1,32 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rhoconnect', '~> 3.1.0'
3
+ gem 'rhoconnect', :path => '../../'
4
4
 
5
5
  # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
6
6
  gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
7
+ gem 'win32-process', :platforms => [:mswin, :mingw]
8
+
9
+ # use thin and eventmachine everywhere except JRuby
10
+ platforms :ruby, :ruby_19, :mingw, :mingw_19 do
11
+ gem "eventmachine", "~> 1.0.0.beta"
12
+ # using thin by default
13
+ gem 'thin'
14
+ end
15
+
16
+ # for async framework
17
+ # for Async, Eventful execution
18
+ platforms :ruby_19, :mingw_19 do
19
+ gem 'rack-fiber_pool'
20
+ gem 'async-rack'
21
+ end
7
22
 
8
23
  platforms :jruby do
9
24
  gem 'jdbc-sqlite3', ">= 3.7.2"
10
25
  gem 'dbi', ">= 0.4.5"
11
26
  gem 'dbd-jdbc', ">= 0.1.4"
12
27
  gem 'jruby-openssl', ">= 0.7.4"
28
+ gem 'trinidad'
13
29
  gem 'warbler'
14
30
  end
15
31
 
16
32
  gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
17
-
18
- # For jruby trinidad JRuby web server is used
19
- gem 'trinidad', :platforms => :jruby
20
-
21
- group :development do
22
- # By default to run application thin web server is used
23
- gem 'thin', :platforms => [:ruby, :mswin, :mingw]
24
- end
25
-
26
- group :test do
27
- gem 'rack-test', '>= 0.5.3', :require => "rack/test"
28
- gem 'rspec', '~> 2.6.0'
29
- end
30
-
31
- # for Async, Eventful execution
32
- platforms :ruby_19 do
33
- gem 'rack-fiber_pool'
34
- gem 'async-rack'
35
- end
@@ -6,10 +6,10 @@ Bundler.require
6
6
  # Try to load vendor-ed rhoconnect, otherwise load the gem
7
7
  begin
8
8
  require 'vendor/rhoconnect/lib/rhoconnect/server'
9
- require 'vendor/rhoconnect/lib/rhoconnect/console/server'
9
+ require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
10
10
  rescue LoadError
11
11
  require 'rhoconnect/server'
12
- require 'rhoconnect/console/server'
12
+ require 'rhoconnect/web-console/server'
13
13
  end
14
14
 
15
15
  # By default, turn on the resque web console
@@ -7,16 +7,16 @@
7
7
  :poll_interval: 300
8
8
 
9
9
  :test:
10
- :syncserver: http://localhost:9292/api/application/
10
+ :syncserver: http://localhost:9292/application/
11
11
  :licensefile: settings/license.key
12
12
  :redis: localhost:6379
13
13
  :log_disabled: true
14
14
  :development:
15
- :syncserver: http://localhost:9292/api/application/
15
+ :syncserver: http://localhost:9292/application/
16
16
  :licensefile: settings/license.key
17
17
  :redis: localhost:6379
18
18
  :log_disabled: true
19
19
  :production:
20
- :syncserver: http://localhost:9292/api/application/
20
+ :syncserver: http://localhost:9292/application/
21
21
  :licensefile: settings/license.key
22
22
  :redis: localhost:6379
@@ -4,26 +4,29 @@ gem 'rhoconnect', :path => '../../'
4
4
 
5
5
  # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
6
6
  gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
7
+ gem 'win32-process', :platforms => [:mswin, :mingw]
8
+
9
+ # use thin and eventmachine everywhere except JRuby
10
+ platforms :ruby, :ruby_19, :mingw, :mingw_19 do
11
+ gem "eventmachine", "~> 1.0.0.beta"
12
+ # using thin by default
13
+ gem 'thin'
14
+ end
15
+
16
+ # for async framework
17
+ # for Async, Eventful execution
18
+ platforms :ruby_19, :mingw_19 do
19
+ gem 'rack-fiber_pool'
20
+ gem 'async-rack'
21
+ end
7
22
 
8
23
  platforms :jruby do
9
24
  gem 'jdbc-sqlite3', ">= 3.7.2"
10
25
  gem 'dbi', ">= 0.4.5"
11
26
  gem 'dbd-jdbc', ">= 0.1.4"
12
27
  gem 'jruby-openssl', ">= 0.7.4"
28
+ gem 'trinidad'
13
29
  gem 'warbler'
14
30
  end
15
31
 
16
32
  gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
17
-
18
- # For jruby trinidad JRuby web server is used
19
- gem 'trinidad', :platforms => :jruby
20
-
21
- group :development do
22
- # By default to run application thin web server is used
23
- gem 'thin', :platforms => [:ruby, :mswin, :mingw]
24
- end
25
-
26
- group :test do
27
- gem 'rack-test', '>= 0.5.3', :require => "rack/test"
28
- gem 'rspec', '~> 2.6.0'
29
- end
@@ -6,10 +6,10 @@ Bundler.require
6
6
  # Try to load vendor-ed rhoconnect, otherwise load the gem
7
7
  begin
8
8
  require 'vendor/rhoconnect/lib/rhoconnect/server'
9
- require 'vendor/rhoconnect/lib/rhoconnect/console/server'
9
+ require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
10
10
  rescue LoadError
11
11
  require 'rhoconnect/server'
12
- require 'rhoconnect/console/server'
12
+ require 'rhoconnect/web-console/server'
13
13
  end
14
14
 
15
15
  # By default, turn on the resque web console
@@ -1,16 +1,18 @@
1
+ #Sources
1
2
  :sources:
2
3
  BlobAdapter:
3
4
  :poll_interval: 300
4
5
 
5
6
  :test:
6
7
  :redis: localhost:6379
7
- :syncserver: http://localhost:9292/api/application/
8
+ :syncserver: http://localhost:9292/application/
8
9
  :licensefile: settings/license.key
9
10
  :development:
10
11
  :redis: localhost:6379
11
- :syncserver: http://localhost:9292/api/application/
12
+ :syncserver: http://localhost:9292/application/
12
13
  :licensefile: settings/license.key
14
+ :log_disabled: true
13
15
  :production:
14
16
  :redis: localhost:6379
15
- :syncserver: http://localhost:9292/api/application/
17
+ :syncserver: http://localhost:9292/application/
16
18
  :licensefile: settings/license.key
@@ -56,71 +56,74 @@ module Bench
56
56
 
57
57
  def get_server_license_info
58
58
  token = get_token
59
- params = {:api_token => token}
60
- @body = RestClient.post("#{@host}/api/admin/get_license_info",
61
- params.to_json, :content_type => :json)
59
+ @body = RestClient.get(
60
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/system/license",
61
+ {'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
62
62
  JSON.parse(@body.to_s)
63
63
  end
64
64
 
65
65
  def get_server_state(doc)
66
66
  token = get_token
67
- params = {:api_token => token, :doc => doc}
68
- @body = RestClient.post("#{@host}/api/source/get_db_doc",
69
- params.to_json, :content_type => :json)
67
+ @body = RestClient.get(
68
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
69
+ {'X-RhoConnect-API-TOKEN' => token})
70
70
  JSON.parse(@body.to_s)
71
71
  end
72
72
 
73
73
  def get_server_value(doc)
74
74
  token = get_token
75
- params = {:api_token => token, :doc => doc, :data_type => 'string'}
76
- @body = RestClient.post("#{@host}/api/source/get_db_doc",
77
- params.to_json, :content_type => :json)
75
+ @body = RestClient.get(
76
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
77
+ {'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
78
78
  end
79
79
 
80
80
  def reset_app
81
- RestClient.post("#{@host}/api/admin/reset",{:api_token => get_token}.to_json, :content_type => :json)
81
+ RestClient.post(
82
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/system/reset",
83
+ {},
84
+ {:content_type => :json, 'X-RhoConnect-API-TOKEN' => get_token})
82
85
  end
83
86
 
84
87
  def create_user(user_name, password)
85
88
  token = get_token
86
- RestClient.post("#{@host}/api/user/create_user",
87
- {:api_token => token, :app_name => @app_name,
88
- :attributes => {:login => user_name, :password => password}}.to_json,
89
- :content_type => :json)
89
+ RestClient.post(
90
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/users",
91
+ {:app_name => @app_name, :attributes => {:login => user_name, :password => password}}.to_json,
92
+ {:content_type => :json, 'X-RhoConnect-API-TOKEN' => token})
90
93
  end
91
94
 
92
95
  def set_server_state(doc,data,append=false)
93
96
  token = get_token
94
- params = {:api_token => token, :doc => doc, :data => data, :append => append}
95
- if data.is_a? String
96
- params[:data_type] = 'string'
97
- end
98
- RestClient.post("#{@host}/api/source/set_db_doc",
99
- params.to_json, :content_type => :json)
97
+ params = {:data => data, :append => append}
98
+ params[:data_type] = 'string' if data.is_a? String
99
+ RestClient.post(
100
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/store/#{doc}",
101
+ params.to_json,
102
+ {'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
100
103
  end
101
104
 
102
105
  def reset_refresh_time(source_name,poll_interval=nil)
103
106
  token = get_token
104
- RestClient.post("#{@host}/api/source/set_refresh_time",
105
- {:api_token => token, :source_name => source_name,
106
- :user_name => @user_name,
107
- :poll_interval => poll_interval}.to_json,
108
- :content_type => :json)
107
+ RestClient.put(
108
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/readstate/users/#{@user_name}/sources/#{source_name}",
109
+ {:poll_interval => poll_interval}.to_json,
110
+ {'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
109
111
  end
110
112
 
111
113
  def set_simulate_time(source_name,simulate_time=0)
112
114
  token = get_token
113
- RestClient.post("#{@host}/api/source/update_source_params",
114
- {:api_token => token, :source_name => source_name,
115
- :user_name => @user_name,
116
- :data => {:simulate_time => simulate_time}}.to_json,
117
- :content_type => :json)
115
+ RestClient.put(
116
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/sources/#{source_name}",
117
+ {:data => {:simulate_time => simulate_time}}.to_json,
118
+ {'X-RhoConnect-API-TOKEN' => token, :content_type => :json})
118
119
  end
119
120
 
120
121
  def get_token
121
122
  unless @token
122
- @token = RestClient.post("#{@host}/api/admin/login",
123
- {:login => @admin_login, :password => @admin_password}.to_json, :content_type => :json)
123
+ @token = RestClient.post(
124
+ "#{@host}/rc/#{Rhoconnect::API_VERSION}/system/login",
125
+ {:login => @admin_login, :password => @admin_password}.to_json,
126
+ :content_type => :json)
124
127
  end
125
128
  @token
126
129
  end
@@ -11,7 +11,7 @@ module Bench
11
11
  end
12
12
 
13
13
  def post(marker,url,headers={})
14
- @body = yield
14
+ @body = yield if block_given?
15
15
  _request(marker,:_post,url,headers)
16
16
  end
17
17
 
@@ -22,6 +22,10 @@ module Bench
22
22
  _request(marker,:_get,url_params,headers)
23
23
  end
24
24
 
25
+ def delete(marker,url,headers={})
26
+ _request(marker,:_delete,url,headers)
27
+ end
28
+
25
29
  protected
26
30
  def _request(marker,verb,url,headers)
27
31
  result = Result.new(marker,verb,url,@thread_id,@iteration)
@@ -58,6 +62,10 @@ module Bench
58
62
  RestClient.post(url, @body, headers)
59
63
  end
60
64
 
65
+ def _delete(url,headers)
66
+ RestClient.delete(url, headers)
67
+ end
68
+
61
69
  def _url_params(params)
62
70
  elements = []
63
71
  params.each do |key,value|