rhoconnect 3.3.6 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/CHANGELOG.md +40 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +27 -25
  4. data/bench/benchapp/Gemfile +7 -27
  5. data/bench/benchapp/config.ru +9 -31
  6. data/bench/blobapp/Gemfile +7 -27
  7. data/bench/blobapp/config.ru +9 -29
  8. data/bench/lib/bench.rb +8 -1
  9. data/bench/lib/bench/test_data.rb +4 -1
  10. data/bench/scripts/blob_cud_script.rb +4 -0
  11. data/bench/scripts/cud_script.rb +7 -1
  12. data/bench/scripts/helpers.rb +1 -1
  13. data/bench/scripts/test_query_script.rb +20 -7
  14. data/bench/spec/bench_spec_helper.rb +3 -1
  15. data/bin/rhoconnect +22 -12
  16. data/commands/{commands/dtach_commands → dtach}/dtach_about.rb +0 -0
  17. data/commands/{commands/dtach_commands → dtach}/dtach_install.rb +0 -0
  18. data/commands/{commands/redis_commands → dtach}/redis_attach.rb +0 -0
  19. data/commands/execute.rb +14 -15
  20. data/commands/generators/update.rb +26 -0
  21. data/commands/{commands/redis_commands → redis}/redis_about.rb +0 -0
  22. data/commands/redis/redis_download.rb +13 -0
  23. data/commands/redis/redis_install.rb +26 -0
  24. data/commands/{commands/redis_commands → redis}/redis_make.rb +0 -0
  25. data/commands/{commands/redis_commands → redis}/redis_restart.rb +3 -2
  26. data/commands/{commands/redis_commands → redis}/redis_start.rb +0 -0
  27. data/commands/{commands/redis_commands → redis}/redis_startbg.rb +0 -0
  28. data/commands/{commands/redis_commands → redis}/redis_stop.rb +3 -2
  29. data/commands/{commands/rhoconnect → rhoconnect}/clean_start.rb +0 -0
  30. data/commands/{commands/rhoconnect → rhoconnect}/config.rb +7 -2
  31. data/commands/{commands/rhoconnect → rhoconnect}/create_user.rb +0 -0
  32. data/commands/{commands/rhoconnect → rhoconnect}/delete_device.rb +0 -0
  33. data/commands/{commands/rhoconnect → rhoconnect}/delete_user.rb +0 -0
  34. data/commands/{commands/rhoconnect → rhoconnect}/flushdb.rb +4 -4
  35. data/commands/{commands/rhoconnect → rhoconnect}/get_token.rb +0 -0
  36. data/commands/{commands/rhoconnect → rhoconnect}/reset.rb +0 -0
  37. data/commands/{commands/rhoconnect → rhoconnect}/reset_refresh.rb +0 -0
  38. data/commands/{commands/rhoconnect → rhoconnect}/restart.rb +0 -0
  39. data/commands/{commands/rhoconnect → rhoconnect}/secret.rb +0 -0
  40. data/commands/{commands/rhoconnect → rhoconnect}/set_admin_password.rb +0 -0
  41. data/commands/{commands/rhoconnect → rhoconnect}/spec.rb +0 -0
  42. data/commands/rhoconnect/start.rb +27 -0
  43. data/commands/{commands/rhoconnect → rhoconnect}/startbg.rb +0 -0
  44. data/commands/{commands/rhoconnect → rhoconnect}/startdebug.rb +2 -2
  45. data/commands/{commands/rhoconnect → rhoconnect}/stop.rb +3 -4
  46. data/commands/{commands/rhoconnect → rhoconnect}/version.rb +0 -0
  47. data/commands/{commands/rhoconnect → rhoconnect}/web.rb +0 -0
  48. data/commands/rhoconnect_attach/attach.rb +10 -0
  49. data/commands/rhoconnect_console/console.rb +16 -0
  50. data/commands/{commands/rhoconnect → rhoconnect_console}/console_helper.rb +0 -0
  51. data/commands/{commands/rhoconnect → rhoconnect_war}/war.rb +0 -0
  52. data/commands/{commands/redis_commands → utilities}/redis_runner.rb +22 -19
  53. data/commands/utilities/utilities.rb +6 -0
  54. data/doc/benchmarks.txt +2 -2
  55. data/doc/bulk-sync.txt +12 -1
  56. data/doc/client-java.txt +3 -3
  57. data/doc/client-objc.txt +1 -1
  58. data/doc/client.txt +5 -5
  59. data/doc/command-line.txt +80 -135
  60. data/doc/deploying.txt +119 -12
  61. data/doc/extending-rhoconnect-server.txt +1 -1
  62. data/doc/heroku-addon.txt +119 -23
  63. data/doc/install.txt +101 -39
  64. data/doc/java-plugin.txt +2 -2
  65. data/doc/licensing.txt +1 -1
  66. data/doc/plugin-intro.txt +3 -1
  67. data/doc/preparing-production.txt +4 -4
  68. data/doc/public/cli.txt +2 -2
  69. data/doc/push-backend-setup.txt +11 -1
  70. data/doc/push-client-setup.txt +72 -2
  71. data/doc/push-server-setup.txt +129 -8
  72. data/doc/rails-plugin.txt +245 -40
  73. data/doc/rest-api.txt +10 -6
  74. data/doc/rhoconnect-calculator.txt +237 -0
  75. data/doc/rhoconnect-redis-stack.txt +35 -0
  76. data/doc/session-and-configuration.txt +24 -0
  77. data/doc/settings.txt +51 -41
  78. data/doc/source-adapters.txt +45 -45
  79. data/doc/stats-middleware.txt +2 -2
  80. data/doc/supported-platforms.txt +6 -6
  81. data/doc/testing.txt +2 -2
  82. data/doc/tutorial.txt +63 -63
  83. data/examples/simple/Gemfile +7 -35
  84. data/examples/simple/config.ru +8 -26
  85. data/examples/simple/sources/product.rb +6 -6
  86. data/generators/rhoconnect.rb +5 -0
  87. data/generators/templates/application/Gemfile +7 -37
  88. data/generators/templates/application/Rakefile +8 -0
  89. data/generators/templates/application/config.ru +12 -31
  90. data/generators/templates/application/rcgemfile +44 -0
  91. data/generators/templates/application/settings/settings.yml +7 -5
  92. data/install.sh +4 -4
  93. data/installer/unix-like/create_texts.rb +7 -2
  94. data/installer/unix-like/rho_connect_install_constants.rb +2 -2
  95. data/installer/unix-like/rho_connect_install_installers.rb +1 -16
  96. data/lib/rhoconnect.rb +51 -38
  97. data/lib/rhoconnect/api/app/query.rb +4 -1
  98. data/lib/rhoconnect/api/app/search.rb +4 -1
  99. data/lib/rhoconnect/api/client/list_client_docs.rb +3 -1
  100. data/lib/rhoconnect/api/user/ping.rb +1 -5
  101. data/lib/rhoconnect/application/init.rb +43 -0
  102. data/lib/rhoconnect/async.rb +11 -6
  103. data/lib/rhoconnect/client_sync.rb +30 -37
  104. data/lib/rhoconnect/document.rb +4 -0
  105. data/lib/rhoconnect/graph_helper.rb +74 -56
  106. data/lib/rhoconnect/middleware/helpers.rb +4 -0
  107. data/lib/rhoconnect/ping.rb +1 -0
  108. data/lib/rhoconnect/ping/gcm.rb +58 -0
  109. data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +7 -1
  110. data/lib/rhoconnect/source.rb +70 -56
  111. data/lib/rhoconnect/source_sync.rb +33 -5
  112. data/lib/rhoconnect/store.rb +358 -110
  113. data/lib/rhoconnect/user.rb +8 -0
  114. data/lib/rhoconnect/utilities.rb +16 -14
  115. data/lib/rhoconnect/version.rb +1 -1
  116. data/lib/rhoconnect/web-console/models/client.js +1 -1
  117. data/lib/rhoconnect/web-console/public/UNVR67bold.ttf +0 -0
  118. data/lib/rhoconnect/web-console/public/bootstrap.css +6 -0
  119. data/lib/rhoconnect/web-console/public/logo.png +0 -0
  120. data/lib/rhoconnect/web-console/server.rb +13 -11
  121. data/lib/rhoconnect/web-console/templates/index.erb +5 -5
  122. data/lib/rhoconnect/web-console/templates/jqplot.erb +1 -0
  123. data/lib/rhoconnect/web-console/views/doc.js +0 -4
  124. data/lib/rhoconnect/web-console/views/home.js +2 -1
  125. data/lib/rhoconnect/web-console/views/new_ping.js +11 -6
  126. data/lib/rhoconnect/web-console/views/stats.js +9 -5
  127. data/rhoconnect.gemspec +6 -4
  128. data/spec/api/app/fast_update_spec.rb +2 -2
  129. data/spec/api/source/get_source_params_spec.rb +1 -0
  130. data/spec/apps/rhotestapp/settings/settings.yml +5 -5
  131. data/spec/client_sync_spec.rb +3 -14
  132. data/spec/perf/perf_spec_helper.rb +11 -7
  133. data/spec/perf/store_perf_spec.rb +88 -11
  134. data/spec/ping/gcm_spec.rb +99 -0
  135. data/spec/server/server_spec.rb +7 -0
  136. data/spec/server/stats_spec.rb +9 -2
  137. data/spec/source_sync_spec.rb +29 -0
  138. data/spec/spec_helper.rb +40 -38
  139. data/spec/stats/record_spec.rb +18 -9
  140. data/spec/store_spec.rb +128 -19
  141. data/spec/testdata/10000-data.txt +0 -0
  142. data/spec/testdata/5-data.txt +0 -0
  143. data/spec/testdata/5000-data.txt +0 -0
  144. data/tasks/jasmine.rake +1 -0
  145. data/tasks/redis.rake +16 -13
  146. metadata +71 -39
  147. data/commands/commands/redis_commands/redis_download.rb +0 -33
  148. data/commands/commands/redis_commands/redis_install.rb +0 -26
  149. data/commands/commands/rhoconnect/attach.rb +0 -8
  150. data/commands/commands/rhoconnect/console.rb +0 -15
  151. data/commands/commands/rhoconnect/start.rb +0 -18
  152. data/commands/utilities/dtach_installed.rb +0 -10
data/CHANGELOG.md CHANGED
@@ -1,7 +1,43 @@
1
- ## 3.3.6 (2012-10-05)
2
- * Fix issue with Rhoconnect.api_token for admin user
3
- * Bump nginx to v1.3.6 and redis to v2.4.17, add http_stub_status_module and include "least_conn" directive to upstream section
4
- * Adding support for latest (3.0.x) redis client and resque library
1
+ ## 3.4.2 (2012-11-8)
2
+ * fixed `rhoconnect redis-start` and `rhoconnect redis-restart` commands on windows
3
+ # D-04052 - Resque.after_fork hook wasn't initializing efficiently
4
+
5
+ ## 3.4.1 (2012-11-6)
6
+ * D-04031 - `rhoconnect startbg` and `startdebug` commands not working on windows
7
+ * Locked win32-process gem to previous release (0.6.6) so Process.fork is available for
8
+ `startbg` and `startdebug` commands.
9
+ * `rhoconnect update` command handles exceptions with useful error message
10
+
11
+ ## 3.4.0 (2012-11-1)
12
+ * Let `pass_through` and `push_notify` be string or boolean
13
+ * B-90921 - `rhoconnect` command sets are now platform-specific
14
+ * D-03946 - Fixed `rhoconnect console` command on Windows
15
+ * B-91297 - Added defaults for api_token and push appname
16
+
17
+ ## 3.4.0.rc5 (2012-10-26)
18
+ * Refactor 'Gemfile' in app generator template, add rhoconnect cmd 'update' to simplify upgrade legacy apps to latest gem
19
+
20
+ ## 3.4.0.rc4 (2012-10-19)
21
+ * Updated production stack to ruby 1.9.3p286
22
+ * TK-04054 - fixed GCM push payload so 'data' field is passed to client
23
+
24
+ ## 3.4.0.rc3 (2012-10-15)
25
+ * B-03380 - Added Google Cloud Messaging (GCM) support
26
+ * Filter added to simplecov report so spec files are not included
27
+ * D-01639 - Issues with Resque workers connection to Redis using connection pool
28
+ * D-01563 - `rake resque:work` fails with undefined ROOT_PATH
29
+
30
+ ## 3.4.0.rc2 (2012-10-11)
31
+ * Removing Redis ConnectionPool from 1.8.7 (not supported there)
32
+ * Fixing GetClientDocs API with stats (incorrect return)
33
+
34
+ ## 3.4.0.rc1 (2012-10-09)
35
+ * Add Redis connection pool as a default
36
+ * Add redis_timeout option
37
+ * Implement automatic user notify after push_objects, push_deletes
38
+ * B-03739 - Store re-design : implement diff by object - optimizes speed and Redis memory usage
39
+ * Bump nginx to v. 1.3.6, add http_stub_status_module and include "least_conn" directive to upstream section
40
+ * B-03303 - Move page_token and count into separate headers for easy access (to avoid heavy JSON parsing)
5
41
 
6
42
  ## 3.3.5 (2012-09-20)
7
43
  * merge changes from master to fix broken bench script helper
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'win32-process', :platforms => [:mswin, :mingw]
7
7
 
8
8
  # use thin and eventmachine everywhere except JRuby
9
9
  platforms :ruby, :ruby_19, :mingw, :mingw_19 do
10
- gem "eventmachine", "~> 1.0.0.beta"
10
+ gem "eventmachine", "~> 1.0.0"
11
11
  # using thin by default
12
12
  gem 'thin'
13
13
  end
@@ -39,7 +39,7 @@ end
39
39
  group :test do
40
40
  gem 'rspec', '~> 2.10.0'
41
41
  gem "rcov", '~> 1.0.0', :require => false, :platforms => :ruby_18
42
- gem 'simplecov', :require => false, :platforms => [:ruby_19,:jruby]
42
+ gem 'simplecov', '>= 0.7.1', :require => false, :platforms => [:ruby_19,:jruby]
43
43
  gem 'rack-test', '>= 0.5.3', :require => 'rack/test'
44
44
  gem 'jasmine', :platforms => :ruby_19
45
45
  gem 'jasmine-headless-webkit', :platforms => :ruby_19
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (3.3.6)
4
+ rhoconnect (3.4.2)
5
5
  bundler (~> 1.0)
6
+ connection_pool (>= 0.9.2)
6
7
  json (~> 1.6.0)
7
8
  rake (~> 0.9.2.2)
8
9
  redis (>= 3.0.1)
@@ -28,27 +29,28 @@ GEM
28
29
  mime-types
29
30
  xml-simple
30
31
  backports (2.6.2)
31
- builder (3.1.3)
32
+ builder (3.1.4)
32
33
  cabin (0.4.4)
33
34
  json
34
- childprocess (0.3.5)
35
+ childprocess (0.3.6)
35
36
  ffi (~> 1.0, >= 1.0.6)
36
37
  clamp (0.3.1)
37
38
  coffee-script (2.2.0)
38
39
  coffee-script-source
39
40
  execjs
40
- coffee-script-source (1.3.3)
41
+ coffee-script-source (1.4.0)
42
+ connection_pool (0.9.2)
41
43
  crack (0.3.1)
42
44
  daemons (1.1.9)
43
45
  diff-lcs (1.1.3)
44
46
  eventmachine (1.0.0)
45
- excon (0.16.4)
47
+ excon (0.16.10)
46
48
  execjs (1.4.0)
47
49
  multi_json (~> 1.0)
48
50
  extlib (0.9.15)
49
51
  ffaker (1.14.0)
50
- ffi (1.1.5)
51
- fog (1.6.0)
52
+ ffi (1.2.0)
53
+ fog (1.8.0)
52
54
  builder
53
55
  excon (~> 0.14)
54
56
  formatador (~> 0.2.0)
@@ -58,8 +60,8 @@ GEM
58
60
  net-ssh (>= 2.1.3)
59
61
  nokogiri (~> 1.5.0)
60
62
  ruby-hmac
61
- formatador (0.2.3)
62
- fpm (0.4.20)
63
+ formatador (0.2.4)
64
+ fpm (0.4.24)
63
65
  arr-pm (~> 0.0.7)
64
66
  backports (= 2.6.2)
65
67
  cabin (~> 0.4.3)
@@ -67,28 +69,27 @@ GEM
67
69
  json (= 1.6.6)
68
70
  highline (1.6.15)
69
71
  hike (1.2.1)
70
- jasmine (1.2.1)
71
- jasmine-core (>= 1.2.0)
72
+ jasmine (1.3.1)
73
+ jasmine-core (~> 1.3.1)
72
74
  rack (~> 1.0)
73
75
  rspec (>= 1.3.1)
74
76
  selenium-webdriver (>= 0.1.3)
75
- jasmine-core (1.2.0)
77
+ jasmine-core (1.3.1)
76
78
  jasmine-headless-webkit (0.8.4)
77
79
  coffee-script
78
80
  jasmine-core (~> 1.1)
79
81
  multi_json
80
82
  rainbow
81
83
  sprockets (~> 2)
82
- jruby-pageant (1.1.1)
83
84
  json (1.6.6)
84
- libwebsocket (0.1.5)
85
+ libwebsocket (0.1.7.1)
85
86
  addressable
87
+ websocket
86
88
  mime-types (1.19)
87
- multi_json (1.3.6)
89
+ multi_json (1.4.0)
88
90
  net-scp (1.0.4)
89
91
  net-ssh (>= 1.99.1)
90
- net-ssh (2.6.0)
91
- jruby-pageant (>= 1.1.1)
92
+ net-ssh (2.6.2)
92
93
  nokogiri (1.5.5)
93
94
  rack (1.4.1)
94
95
  rack-fiber_pool (0.9.2)
@@ -119,20 +120,20 @@ GEM
119
120
  rspec-mocks (2.10.1)
120
121
  ruby-hmac (0.4.0)
121
122
  rubyzip (0.9.9)
122
- selenium-webdriver (2.25.0)
123
+ selenium-webdriver (2.26.0)
123
124
  childprocess (>= 0.2.5)
124
125
  libwebsocket (~> 0.1.3)
125
126
  multi_json (~> 1.0)
126
127
  rubyzip
127
- simplecov (0.6.4)
128
+ simplecov (0.7.1)
128
129
  multi_json (~> 1.0)
129
- simplecov-html (~> 0.5.3)
130
- simplecov-html (0.5.3)
130
+ simplecov-html (~> 0.7.1)
131
+ simplecov-html (0.7.1)
131
132
  sinatra (1.3.3)
132
133
  rack (~> 1.3, >= 1.3.6)
133
134
  rack-protection (~> 1.2)
134
135
  tilt (~> 1.3, >= 1.3.3)
135
- sprockets (2.6.0)
136
+ sprockets (2.8.1)
136
137
  hike (~> 1.2)
137
138
  multi_json (~> 1.0)
138
139
  rack (~> 1.0)
@@ -154,7 +155,8 @@ GEM
154
155
  webmock (1.8.11)
155
156
  addressable (>= 2.2.7)
156
157
  crack (>= 0.1.7)
157
- xml-simple (1.1.1)
158
+ websocket (1.0.4)
159
+ xml-simple (1.1.2)
158
160
 
159
161
  PLATFORMS
160
162
  ruby
@@ -165,7 +167,7 @@ DEPENDENCIES
165
167
  aws-s3 (>= 0.6.2)
166
168
  dbd-jdbc (>= 0.1.4)
167
169
  dbi (>= 0.4.5)
168
- eventmachine (~> 1.0.0.beta)
170
+ eventmachine (~> 1.0.0)
169
171
  ffaker (~> 1.14.0)
170
172
  fog (>= 1.1.0)
171
173
  fpm (>= 0.4.9)
@@ -178,7 +180,7 @@ DEPENDENCIES
178
180
  rcov (~> 1.0.0)
179
181
  rhoconnect!
180
182
  rspec (~> 2.10.0)
181
- simplecov
183
+ simplecov (>= 0.7.1)
182
184
  sqlite3 (>= 1.3.3)
183
185
  thin
184
186
  warbler
@@ -2,31 +2,11 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rhoconnect', :path => '../../'
4
4
 
5
- # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
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'
5
+ gemfile_path = File.join(File.dirname(__FILE__), '..', '..', 'generators','templates', 'application', ".rcgemfile")
6
+ begin
7
+ eval(IO.read(gemfile_path))
8
+ rescue Exception => e
9
+ puts "ERROR: Couldn't find RhoConnect .rcgemfile"
10
+ puts e.message
11
+ exit 1
21
12
  end
22
-
23
- platforms :jruby do
24
- gem 'jdbc-sqlite3', ">= 3.7.2"
25
- gem 'dbi', ">= 0.4.5"
26
- gem 'dbd-jdbc', ">= 0.1.4"
27
- gem 'jruby-openssl', ">= 0.7.4"
28
- gem 'trinidad'
29
- gem 'warbler'
30
- end
31
-
32
- gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
@@ -1,38 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rubygems'
3
- require 'bundler'
4
- Bundler.require
2
+ require 'rhoconnect/application/init'
5
3
 
6
- # Try to load vendor-ed rhoconnect, otherwise load the gem
7
- begin
8
- require 'vendor/rhoconnect/lib/rhoconnect/server'
9
- require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
10
- rescue LoadError
11
- require 'rhoconnect/server'
12
- require 'rhoconnect/web-console/server'
13
- end
14
-
15
- # By default, turn on the resque web console
16
- require 'resque/server'
17
-
18
- ROOT_PATH = File.expand_path(File.dirname(__FILE__))
19
-
20
- # Rhoconnect server flags
21
- Rhoconnect::Server.disable :run
22
- Rhoconnect::Server.disable :clean_trace
23
- Rhoconnect::Server.enable :raise_errors
24
4
  Rhoconnect::Server.set :secret, 'cf8e8a1d3653fcfb2332d8b1af9f6762c3c45ea12144bb5f15cd5618cc8e453b45a02dd304bdd791489dcd1ae35b807e4b4f4e6f7faedb551e76996c0f3c11c6'
25
- Rhoconnect::Server.set :root, ROOT_PATH
26
- Rhoconnect::Server.use Rack::Static, :urls => ["/data"], :root => Rhoconnect::Server.root
5
+
6
+ # !!! Add your custom initializers and overrides here !!!
7
+ # For example, uncomment the following line to enable Stats
8
+ #Rhoconnect::Server.enable :stats
27
9
  Rhoconnect::Server.disable :logging
28
- #Rhoconnect::Server.set :use_async_model, false # true by default
29
- #Rhoconnect::Server.set :fiberpool_size, 50 # default is 100
30
10
 
31
- # Load our rhoconnect application
32
- require "#{ROOT_PATH}/application"
11
+ # Load RhoConnect application
12
+ require './application'
33
13
 
34
14
  # Setup the url map
35
- run Rack::URLMap.new \
36
- "/" => Rhoconnect::Server.new,
37
- "/resque" => Resque::Server.new, # If you don't want resque frontend, disable it here
38
- "/console" => RhoconnectConsole::Server.new # If you don't want rhoconnect frontend, disable it here
15
+ # run RhoConnect Application
16
+ run Rhoconnect.app
@@ -2,31 +2,11 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rhoconnect', :path => '../../'
4
4
 
5
- # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
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'
5
+ gemfile_path = File.join(File.dirname(__FILE__), '..', '..', 'generators','templates', 'application', ".rcgemfile")
6
+ begin
7
+ eval(IO.read(gemfile_path))
8
+ rescue Exception => e
9
+ puts "ERROR: Couldn't find RhoConnect .rcgemfile"
10
+ puts e.message
11
+ exit 1
21
12
  end
22
-
23
- platforms :jruby do
24
- gem 'jdbc-sqlite3', ">= 3.7.2"
25
- gem 'dbi', ">= 0.4.5"
26
- gem 'dbd-jdbc', ">= 0.1.4"
27
- gem 'jruby-openssl', ">= 0.7.4"
28
- gem 'trinidad'
29
- gem 'warbler'
30
- end
31
-
32
- gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
@@ -1,35 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rubygems'
3
- require 'bundler'
4
- Bundler.require
2
+ require 'rhoconnect/application/init'
5
3
 
6
- # Try to load vendor-ed rhoconnect, otherwise load the gem
7
- begin
8
- require 'vendor/rhoconnect/lib/rhoconnect/server'
9
- require 'vendor/rhoconnect/lib/rhoconnect/web-console/server'
10
- rescue LoadError
11
- require 'rhoconnect/server'
12
- require 'rhoconnect/web-console/server'
13
- end
14
-
15
- # By default, turn on the resque web console
16
- require 'resque/server'
17
-
18
- ROOT_PATH = File.expand_path(File.dirname(__FILE__))
19
-
20
- # Rhoconnect server flags
21
- Rhoconnect::Server.disable :run
22
- Rhoconnect::Server.disable :clean_trace
23
- Rhoconnect::Server.enable :raise_errors
24
4
  Rhoconnect::Server.set :secret, '096a8a4212b18d2b281d377f2c350421898a21fec78ac1baf5482c68ee41b30dcc46309cc2fb51ccc37f24789eeaed673a291efdfd0ec42df9f62351e71806f8'
25
- Rhoconnect::Server.set :root, ROOT_PATH
26
- Rhoconnect::Server.use Rack::Static, :urls => ["/data"], :root => Rhoconnect::Server.root
27
5
 
28
- # Load our rhoconnect application
29
- require "#{ROOT_PATH}/application"
6
+ # !!! Add your custom initializers and overrides here !!!
7
+ # For example, uncomment the following line to enable Stats
8
+ #Rhoconnect::Server.enable :stats
9
+
10
+ # Load RhoConnect application
11
+ require './application'
30
12
 
31
13
  # Setup the url map
32
- run Rack::URLMap.new \
33
- "/" => Rhoconnect::Server.new,
34
- "/resque" => Resque::Server.new, # If you don't want resque frontend, disable it here
35
- "/console" => RhoconnectConsole::Server.new # If you don't want rhoconnect frontend, disable it here
14
+ # run RhoConnect Application
15
+ run Rhoconnect.app
data/bench/lib/bench.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rest_client'
2
2
  require 'zip/zip'
3
+ require 'securerandom'
3
4
  $:.unshift File.dirname(__FILE__)
4
5
  require 'bench/timer'
5
6
  require 'bench/logging'
@@ -91,7 +92,13 @@ module Bench
91
92
  {:app_name => @app_name, :attributes => {:login => user_name, :password => password}}.to_json,
92
93
  {:content_type => :json, 'X-RhoConnect-API-TOKEN' => token})
93
94
  end
94
-
95
+
96
+ def delete_user(user_name)
97
+ token = get_token
98
+ RestClient.delete("#{@host}/rc/v1/users/#{user_name}",
99
+ { 'X-RhoConnect-API-TOKEN' => token } )
100
+ end
101
+
95
102
  def set_server_state(doc,data,append=false)
96
103
  token = get_token
97
104
  params = {:data => data, :append => append}
@@ -51,7 +51,10 @@ module Bench
51
51
  "Email" => Faker::Internet.free_email,
52
52
  "Company" => Faker::Company.name,
53
53
  "JobTitle" => title,
54
- "Phone1" => Faker::PhoneNumber.phone_number
54
+ "Phone1" => Faker::PhoneNumber.phone_number,
55
+ "Geolocation" => Faker::Geolocation.lat.to_s + ":" + Faker::Geolocation.lng.to_s,
56
+ "Education" => Faker::Education.degree,
57
+ "School" => Faker::Education.school
55
58
  }
56
59
  if generate_blob
57
60
  img_file_name = IMAGE_FILES[rand(IMAGE_FILES.size)]
@@ -91,4 +91,8 @@ Bench.verify do |config,sessions|
91
91
  master_doc.merge!(user_doc)
92
92
  end
93
93
  Bench.verify_error = Bench.compare_and_log(@expected_md, master_doc, current_line)
94
+
95
+ @users.each do |user|
96
+ Bench.delete_user(user.user_name)
97
+ end
94
98
  end
@@ -88,4 +88,10 @@ Bench.verify do |config,sessions|
88
88
  master_doc.merge!(user_doc)
89
89
  end
90
90
  Bench.verify_error = Bench.compare_and_log(@expected_md, master_doc, current_line)
91
- end
91
+
92
+ @users.each do |user|
93
+ Bench.delete_user(user.user_name)
94
+ end
95
+ end
96
+
97
+
@@ -72,7 +72,7 @@ module BenchHelpers
72
72
  end
73
73
  sleep rand(timeout)
74
74
  token = JSON.parse(session.last_result.body)[1]['token']
75
- progress_count = JSON.parse(session.last_result.body)[4]['total_count']
75
+ progress_count = JSON.parse(session.last_result.body)[4]['total_count']
76
76
  return progress_count if token == ''
77
77
 
78
78
  verify_count(session,caller+"\n"+current_line)