rhoconnect 3.3.6 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -32,6 +32,14 @@ module Rhoconnect
32
32
  return if current_user.nil?
33
33
  return current_user if User.encrypt(password, current_user.salt) == current_user.hashed_password
34
34
  end
35
+
36
+ def ping(params)
37
+ if params['async']
38
+ PingJob.enqueue(params)
39
+ else
40
+ PingJob.perform(params)
41
+ end
42
+ end
35
43
  end
36
44
 
37
45
  def new_password=(pass)
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'rbconfig'
2
3
 
3
4
  module Utilities
4
5
  # Prints the command to be issued and then issues it to system
@@ -7,10 +8,6 @@ module Utilities
7
8
  system "#{cmd}"
8
9
  end #cmd
9
10
 
10
- def redis_home
11
- ENV['REDIS_HOME'] || File.join($redis_dest,$redis_ver)
12
- end
13
-
14
11
  def mk_bin_dir(bin_dir)
15
12
  begin
16
13
  mkdir_p bin_dir unless File.exists?(bin_dir)
@@ -28,7 +25,7 @@ module Utilities
28
25
 
29
26
  def print_resp(resp,success=true)
30
27
  if success
31
- puts "=> OK"
28
+ puts "=> OK"
32
29
  else
33
30
  puts "=> FAILED"
34
31
  end
@@ -43,7 +40,7 @@ module Utilities
43
40
  print msg
44
41
  STDIN.gets.chomp
45
42
  end
46
-
43
+
47
44
  def load_settings(file)
48
45
  begin
49
46
  $settings = YAML.load_file(file)
@@ -53,11 +50,11 @@ module Utilities
53
50
  raise e
54
51
  end
55
52
  end
56
-
53
+
57
54
  def rhoconnect_socket
58
55
  '/tmp/rhoconnect.dtach'
59
56
  end
60
-
57
+
61
58
  def rhoconnect_pid
62
59
  if windows?
63
60
  Dir.mkdir 'C:/TMP' unless File.directory? 'C:/TMP'
@@ -67,18 +64,23 @@ module Utilities
67
64
  end
68
65
  end
69
66
 
67
+ # See http://rbjl.net/35-how-to-properly-check-for-your-ruby-interpreter-version-and-os
70
68
  def windows?
71
- RUBY_PLATFORM =~ /(win|w)32$/
69
+ RbConfig::CONFIG['host_os'] =~ /(win|w)32$/
72
70
  end
73
-
71
+
72
+ def redis_home
73
+ ENV['REDIS_HOME'] || File.join($redis_dest,$redis_ver)
74
+ end
75
+
74
76
  def ruby19?
75
- RUBY_VERSION =~ /1.9/
77
+ RUBY_VERSION =~ /1.9/
76
78
  end
77
79
 
78
80
  def jruby?
79
81
  defined?(JRUBY_VERSION)
80
82
  end
81
-
83
+
82
84
  def thin?
83
85
  begin
84
86
  require 'thin'
@@ -87,7 +89,7 @@ module Utilities
87
89
  nil
88
90
  end
89
91
  end
90
-
92
+
91
93
  def mongrel?
92
94
  begin
93
95
  require 'mongrel'
@@ -96,7 +98,7 @@ module Utilities
96
98
  nil
97
99
  end
98
100
  end
99
-
101
+
100
102
  def report_missing_server
101
103
  msg =<<-EOF
102
104
  Could not find 'thin' or 'mongrel' on your system. Please install one:
@@ -1,3 +1,3 @@
1
1
  module Rhoconnect
2
- VERSION = '3.3.6'
2
+ VERSION = '3.4.2'
3
3
  end
@@ -49,7 +49,7 @@ var Client = Backbone.Model.extend({
49
49
  var r = JSON.parse(resp)
50
50
  data = ""
51
51
  $.each(r,function(index,value){
52
- data += "<tr><td><a href='#doc/"+value+"/source_id="+source_id+"'>"+value+"</a></td></tr>";
52
+ data += "<tr><td colspan='2'><a href='#doc/"+value+"/source_id="+source_id+"'>"+value+"</a></td></tr>";
53
53
  })
54
54
  $('tr.remove-tr-docs').remove();
55
55
  $('#sourcedocs-table tr:last').after(data);
@@ -62,6 +62,12 @@ img {
62
62
  -ms-interpolation-mode: bicubic;
63
63
  vertical-align: middle;
64
64
  }
65
+ @font-face {
66
+ font-family: Motofont;
67
+ src: url("UNVR67bold.ttf") format("truetype"); /* For IE */
68
+ src: local("Motofont"), url("UNVR67bold.ttf") format("truetype"); /* For non-IE */
69
+ }
70
+
65
71
  button,
66
72
  input,
67
73
  select,
@@ -60,18 +60,20 @@ module RhoconnectConsole
60
60
  end
61
61
 
62
62
  get '/get_http_routes' do
63
- keys = get_user_count("http:*:*")
64
- sources = get_sources('all')
63
+ # keys = get_user_count("http:*:*")
64
+ # sources = get_sources('all')
65
+ #
66
+ # #loop through arrays and remove any regex matches
67
+ # keysf = keys.inject([]) do |keys_final, element|
68
+ # found = true
69
+ # sources.each do |s|
70
+ # found = false if element.match(s)
71
+ # end
72
+ # keys_final << element.strip if found
73
+ # keys_final
74
+ # end
65
75
 
66
- #loop through arrays and remove any regex matches
67
- keysf = keys.inject([]) do |keys_final, element|
68
- found = true
69
- sources.each do |s|
70
- found = false if element.match(s)
71
- end
72
- keys_final << element.strip if found
73
- keys_final
74
- end
76
+ keysf = get_http_routes()
75
77
 
76
78
  keysf.to_json
77
79
  end
@@ -45,11 +45,11 @@
45
45
  <div id='nav_menu' class="navbar navbar-fixed-top" style="<%@heroku ? 'display:none' : 'display:block'%>">
46
46
  <div class='navbar-inner'>
47
47
  <div class='container'>
48
- <div class="brand" style='padding-bottom:8px'>
49
- <!--<img src='public/logo.png' alt='image' height='40' width='40'/>-->
50
- RhoConnect
48
+ <div class="brand" style='padding:5px 0 0 0;margin-left:0;font-size:26px'>
49
+ <img src='public/logo.png' alt='image' height='40' width='40'/>
50
+ <div style='font-family:Motofont;display:inline-block'>RHO<div style='color:#c91a1d;display:inline'>CONNECT</div></div>
51
51
  </div>
52
- <ul class='nav pull-right'>
52
+ <ul class='nav pull-right' style='margin-top:10px'>
53
53
  <li class=""><a href="/resque/" >Resque</a></li>
54
54
  <li class="active"><a href="#" >Console</a></li>
55
55
  <li><a href='http://docs.rhomobile.com/rhoconnect/introduction' target='_blank'>Docs</a></li>
@@ -61,7 +61,7 @@
61
61
  </div><!-- END navbar -->
62
62
  <div class='container'>
63
63
  <!-- secondary nav after login -->
64
- <div id='secondary-nav' class='span12' style='display:none;margin-top:50px;margin-left:0'>
64
+ <div id='secondary-nav' class='span12' style='display:none;margin-top:70px;margin-left:0'>
65
65
  <ul class='nav nav-tabs'>
66
66
  <li id='info_home'><a href='#'>Home</a></li>
67
67
  <li id='server_doc'><a href='#docselect'>Server Doc</a></li>
@@ -5,6 +5,7 @@
5
5
  <script language="javascript" type="text/javascript" src="public/jqplot/jqplot.canvasTextRenderer.js"></script>
6
6
  <script language="javascript" type="text/javascript" src="public/jqplot/jqplot.canvasAxisLabelRenderer.js"></script>
7
7
  <script language="javascript" type="text/javascript" src="public/jqplot/jqplot.canvasAxisTickRenderer.js"></script>
8
+ <script language="javascript" type="text/javascript" src="public/jqplot/jqplot.pointLabels.min.js"></script>
8
9
  <script language="javascript" type="text/javascript" src="public/jqplot/jqplot.cursor.js"></script>
9
10
  <style type='text/css'>
10
11
  .jqplot-yaxis-label{
@@ -49,10 +49,6 @@ App.Views.Doc = Backbone.View.extend({
49
49
  $('#secondary-nav').css('display','block');
50
50
  out = "<div class='page-header'><h2>Document&nbsp;"+dbkey+"</h2></div>";
51
51
  out += "<div id='docalert' class='alert alert-error' style='display:none'></div>";
52
- //out += "<form 'string_s' class='form-horizontal'>";
53
- //out += "<input type='text' name='data' value='' class='input-xlarge' placeholder='Upload string'/>";
54
- //out += "<input type='submit' value='Submit' class='btn btn-primary' style='margin-left:10px'>";
55
- //out += "</form>";
56
52
  out += "<table id='docdata-table' class='table table-bordered'><tr></tr>";
57
53
  out += "<tr class='remove-tr-doc'><td colspan='2' style='text-align:center'>Loading...</td></tr>"
58
54
  out += "</table>"
@@ -26,7 +26,8 @@ App.Views.Home = Backbone.View.extend({
26
26
  reset: function(){
27
27
  var session = new Session();
28
28
  if(confirm("Are you sure you want to reset?")){
29
- session.reset()
29
+ session.reset();
30
+ this.model.get_license_info();
30
31
  }
31
32
  },
32
33
 
@@ -1,9 +1,9 @@
1
1
  App.Views.NewPing = Backbone.View.extend({
2
-
2
+
3
3
  events:{
4
4
  "submit form" : "ping"
5
5
  },
6
-
6
+
7
7
  initialize: function() {
8
8
  var name = this.model.get('name');
9
9
  this.render(name);
@@ -19,7 +19,12 @@ App.Views.NewPing = Backbone.View.extend({
19
19
  var vibrate = $('#pingvibrate').val();
20
20
  var sound = $('#pingsound').val();
21
21
  var badge = $('#pingbadge').val();
22
- var sources = $('#sources').val().split(',');
22
+ var sources = $('#sources').val();
23
+ if(sources.length > 0) {
24
+ sources = sources.split(',');
25
+ } else {
26
+ sources = [];
27
+ }
23
28
  var token = this.model.get('api_token');
24
29
  $.ajax({
25
30
  type: 'POST',
@@ -47,7 +52,7 @@ App.Views.NewPing = Backbone.View.extend({
47
52
  }
48
53
  })
49
54
  },
50
-
55
+
51
56
  render: function(name) {
52
57
  $('#secondary-nav').css('display','block');
53
58
  out = "<div class='page-header'><h2>Ping User/s</h2></div>";
@@ -62,11 +67,11 @@ App.Views.NewPing = Backbone.View.extend({
62
67
  out += "<td>allows you to play audio file if it exists on client</td></tr>"
63
68
  out += "<tr><td>Badge</td><td><input id='pingbadge' type='text' name='badge' value='1' class='input-small'/></td>";
64
69
  out += "<td>Number displayed on device next to app when push notification arrives. Available for iPhone</td></tr>"
65
- out += "<tr><td>Vibrate</td><td><input id='pingvibrate' type='text' name='vibrate' value='2' class='input-small'/>&nbsp;(seconds)</td>"
70
+ out += "<tr><td>Vibrate</td><td><input id='pingvibrate' type='text' name='vibrate' value='2' class='input-small'/>&nbsp;(milliseconds)</td>"
66
71
  out += "<td>Duration of vibration when push notification is received</td></tr>"
67
72
  out += "<tr><td colspan=3><input type='submit' class='btn btn-primary' value='Ping!' /></td></tr>"
68
73
  out += "</table></form>";
69
-
74
+
70
75
  $(this.el).html(out);
71
76
  $('#main_content').html(this.el);
72
77
  }
@@ -24,12 +24,14 @@ App.Views.Stats = Backbone.View.extend({
24
24
  },
25
25
 
26
26
  device_count: function(){
27
+ $('#stats_main').html("<i>Loading...</i>")
27
28
  $("#user_count").attr('class','');
28
29
  $('#device_count').attr('class','label label-info');
29
30
  this.model.device_count();
30
31
  },
31
32
 
32
33
  http_timing: function(ev){
34
+ $('#stats_main').html("<i>Loading...</i>")
33
35
  var display_name = ev.currentTarget.id;
34
36
  $('.http_timing').attr('class','http_timing');
35
37
  ev.currentTarget.className = "http_timing label label-info"
@@ -37,6 +39,7 @@ App.Views.Stats = Backbone.View.extend({
37
39
  },
38
40
 
39
41
  http_timing_key: function(ev){
42
+ $('#stats_main').html("<i>Loading...</i>")
40
43
  var display_name = ev.currentTarget.id;
41
44
  $('.http_timing_key').attr('class','http_timing_key');
42
45
  ev.currentTarget.className = "http_timing_key label label-info"
@@ -44,6 +47,7 @@ App.Views.Stats = Backbone.View.extend({
44
47
  },
45
48
 
46
49
  source_timing_display: function(ev){
50
+ $('#stats_main').html("<i>Loading...</i>")
47
51
  var display_name = ev.currentTarget.id;
48
52
 
49
53
  $(".source_timing_display").attr('class','source_timing_display');
@@ -83,11 +87,11 @@ App.Views.Stats = Backbone.View.extend({
83
87
  out += "<div id='collapseTwo' class='accordion-body collapse'>";
84
88
  out += "</div></div>"
85
89
 
86
- // out += "<div class='accordion-group'>"
87
- // out += "<div class='accordion-heading' style='font-weight:bold'>"
88
- // out += "<a class='accordion-toggle' data-toggle='collapse' data-parent='#accordion2' href='#collapseFour'>HTTP Route Timing</a></div>"
89
- // out += "<div id='collapseFour' class='accordion-body collapse'>";
90
- // out += "</div></div>"
90
+ out += "<div class='accordion-group'>"
91
+ out += "<div class='accordion-heading' style='font-weight:bold'>"
92
+ out += "<a class='accordion-toggle' data-toggle='collapse' data-parent='#accordion2' href='#collapseFour'>HTTP Route Timing</a></div>"
93
+ out += "<div id='collapseFour' class='accordion-body collapse'>";
94
+ out += "</div></div>"
91
95
 
92
96
  out += "<div class='accordion-group'>"
93
97
  out += "<div class='accordion-heading' style='font-weight:bold'>"
data/rhoconnect.gemspec CHANGED
@@ -14,15 +14,16 @@ Gem::Specification.new do |s|
14
14
  s.description = %q{RhoConnect App Integration Server and related command-line utilities}
15
15
 
16
16
  s.rubyforge_project = nil
17
-
18
- s.files = %w(
19
- CHANGELOG.md CREDITS Gemfile Gemfile.lock install.sh README.md Rakefile LICENSE Rakefile rhoconnect.gemspec
17
+
18
+ s.files = %w(
19
+ CHANGELOG.md CREDITS Gemfile Gemfile.lock install.sh README.md Rakefile LICENSE Rakefile rhoconnect.gemspec
20
20
  )
21
21
  s.files += Dir.glob("bench/**/*")
22
22
  s.files += Dir.glob("commands/**/*")
23
23
  s.files += Dir.glob("doc/**/*")
24
24
  s.files += Dir.glob("examples/**/*")
25
25
  s.files += Dir.glob("generators/**/*")
26
+ s.files += Dir.glob("generators/templates/application/.rcgemfile")
26
27
  s.files += Dir.glob("installer/**/*")
27
28
  s.files += Dir.glob("lib/**/*")
28
29
  s.files += Dir.glob("tasks/**/*")
@@ -37,12 +38,13 @@ Gem::Specification.new do |s|
37
38
  "README.md"
38
39
  ]
39
40
 
40
- s.add_dependency('bundler', '~> 1.0')
41
+ s.add_dependency('bundler', '~> 1.0')
41
42
  s.add_dependency("sinatra", '~> 1.3')
42
43
  s.add_dependency('rake', '~> 0.9.2.2')
43
44
  s.add_dependency('json', '~> 1.6.0')
44
45
  s.add_dependency('rubyzip', '~> 0.9.4')
45
46
  s.add_dependency('uuidtools', '>= 2.1.1')
47
+ s.add_dependency('connection_pool', '>= 0.9.2')
46
48
  s.add_dependency('redis', '>= 3.0.1')
47
49
  s.add_dependency('resque', '>= 1.22.0')
48
50
  s.add_dependency('rest-client', '~> 1.6.1')
@@ -49,7 +49,7 @@ describe "RhoconnectApiFastUpdate" do
49
49
  verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'3')
50
50
  end
51
51
 
52
- it "should remove all attributes , but leave the count incorrect (because fast_update doesn't check if the whole object is deleted)" do
52
+ it "should remove all attributes , and properly adjust md_size" do
53
53
  data = {'1' => @product1, '2' => @product2, '3' => @product3}
54
54
  @s = Source.load(@s_fields[:name],@s_params)
55
55
  set_state(@s.docname(:md) => data,@s.docname(:md_size) => '3')
@@ -61,7 +61,7 @@ describe "RhoconnectApiFastUpdate" do
61
61
  {:user_id => @u.id, :delete_data => orig_obj_attrs, :data => new_obj_attrs}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
62
62
  last_response.should be_ok
63
63
  data.delete('3')
64
- verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'3')
64
+ verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'2')
65
65
  end
66
66
  end
67
67
  end
@@ -21,6 +21,7 @@ describe "RhoconnectApiGetSourceParams" do
21
21
  {"name"=>"retry_limit", "type"=>"integer", "value"=>0},
22
22
  {"name"=>"simulate_time", "value"=>0, "type"=>"integer"},
23
23
  {"name"=>"partition_type", "value"=>"user", "type"=>"string"},
24
+ {"name"=>"push_notify", "value"=>"false", "type"=>"string"},
24
25
  {"name"=>"sync_type", "value"=>"incremental", "type"=>"string"},
25
26
  {"name"=>"belongs_to", "type"=>"string", "value"=>nil},
26
27
  {"name"=>"has_many", "type"=>"string", "value"=>"FixedSchemaAdapter,brand"},
@@ -9,24 +9,24 @@
9
9
  :poll_interval: 300
10
10
  :priority: 5
11
11
  sync_type: 'incremental'
12
- belongs_to:
12
+ belongs_to:
13
13
  - brand: 'SampleAdapter'
14
14
  OtherAdapter:
15
15
  partition_type: 'app'
16
16
  :force_default: true
17
17
  :poll_interval: 300
18
-
18
+
19
19
  :development:
20
20
  :licensefile: settings/license.key
21
21
  :bulk_sync_poll_interval: 3600
22
22
  :redis: localhost:6379
23
23
  :syncserver: http://localhost:9292/application/
24
- :test:
24
+ :test:
25
25
  :licensefile: settings/license.key
26
26
  :iphonecertfile: settings/apple_fake_cert.pem
27
27
  :iphonepassphrase: certpassword
28
28
  :iphoneserver: gateway.sandbox.push.apple.com
29
- :iphoneport: 2195
29
+ :iphoneport: 2195
30
30
  :bulk_sync_poll_interval: 3600
31
31
  :redis: localhost:6379
32
32
  :syncserver: http://localhost:9292/application/
@@ -34,7 +34,7 @@
34
34
  :push_server: http://user:pwd@localhost:8675
35
35
  :cookie_expire: 9999999
36
36
  :poll_interval_default: 201
37
- :production:
37
+ :production:
38
38
  :licensefile: settings/license.key
39
39
  :bulk_sync_poll_interval: 3600
40
40
  :redis: localhost:6379
@@ -518,7 +518,7 @@ describe "ClientSync" do
518
518
  Store.get_data(@c.docname(:cd)).should == @expected
519
519
  end
520
520
 
521
- it "should return deleted objects in the client document" do
521
+ it "should delete objects from the client document and return deleted objects in the page" do
522
522
  Store.put_data(@s.docname(:md),@data).should == true
523
523
  Store.get_data(@s.docname(:md)).should == @data
524
524
 
@@ -527,22 +527,11 @@ describe "ClientSync" do
527
527
  Store.get_data(@cs.client.docname(:cd)).should == @cd
528
528
 
529
529
  @expected = {'4'=>@product4}
530
- @cs.compute_deleted_page.should == @expected
530
+ @cs.send_new_page
531
531
  Store.get_data(@cs.client.docname(:delete_page)).should == @expected
532
+ Store.get_data(@cs.client.docname(:cd)).should == @data
532
533
  end
533
534
 
534
- it "should delete objects from client document" do
535
- Store.put_data(@s.docname(:md),@data).should == true
536
- Store.get_data(@s.docname(:md)).should == @data
537
-
538
- @cd = {'1'=>@product1,'2'=>@product2,'3'=>@product3,'4'=>@product4}
539
- Store.put_data(@cs.client.docname(:cd),@cd)
540
- Store.get_data(@cs.client.docname(:cd)).should == @cd
541
-
542
- Store.delete_data(@cs.client.docname(:cd),@cs.compute_deleted_page).should == true
543
- Store.get_data(@cs.client.docname(:cd)).should == @data
544
- end
545
-
546
535
  it "should resend page if page exists and no token provided" do
547
536
  expected = {'1'=>@product1}
548
537
  set_test_data('test_db_storage',{'1'=>@product1,'2'=>@product2,'4'=>@product4})