rhoconnect 3.1.2 → 3.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +14 -2
- data/CREDITS +151 -10
- data/Gemfile +16 -5
- data/Gemfile.lock +58 -23
- data/Rakefile +70 -50
- data/bench/bench_runner.rb +2 -2
- data/bench/benchapp/Gemfile +6 -0
- data/bench/benchapp/Gemfile.lock +5 -0
- data/bench/benchapp/config.ru +2 -0
- data/bench/lib/bench/cli.rb +2 -0
- data/bench/lib/bench/distr_runner.rb +3 -2
- data/bench/lib/bench/runner.rb +1 -1
- data/bench/lib/bench.rb +10 -1
- data/bench/run_bench.sh +1 -1
- data/bench/scripts/test_query_script.rb +2 -1
- data/bench/spec/bench_spec_helper.rb +1 -0
- data/bin/rhoconnect +9 -27
- data/bin/rhoconnect-benchmark +10 -1
- data/commands/commands/dtach_commands/dtach_about.rb +6 -0
- data/commands/commands/dtach_commands/dtach_install.rb +30 -0
- data/commands/commands/redis_commands/redis_about.rb +6 -0
- data/commands/commands/redis_commands/redis_attach.rb +6 -0
- data/commands/commands/redis_commands/redis_download.rb +33 -0
- data/commands/commands/redis_commands/redis_install.rb +26 -0
- data/commands/commands/redis_commands/redis_make.rb +9 -0
- data/commands/commands/redis_commands/redis_restart.rb +7 -0
- data/commands/commands/redis_commands/redis_runner.rb +67 -0
- data/commands/commands/redis_commands/redis_start.rb +6 -0
- data/commands/commands/redis_commands/redis_startbg.rb +6 -0
- data/commands/commands/redis_commands/redis_stop.rb +6 -0
- data/commands/commands/rhoconnect/attach.rb +7 -0
- data/commands/commands/rhoconnect/clean_start.rb +9 -0
- data/commands/commands/rhoconnect/config.rb +15 -0
- data/commands/commands/rhoconnect/console.rb +15 -0
- data/commands/commands/rhoconnect/console_helper.rb +3 -0
- data/commands/commands/rhoconnect/create_user.rb +18 -0
- data/commands/commands/rhoconnect/delete_device.rb +9 -0
- data/commands/commands/rhoconnect/delete_user.rb +8 -0
- data/commands/commands/rhoconnect/flushdb.rb +14 -0
- data/commands/commands/rhoconnect/get_token.rb +25 -0
- data/commands/commands/rhoconnect/reset.rb +16 -0
- data/commands/commands/rhoconnect/reset_refresh.rb +11 -0
- data/commands/commands/rhoconnect/restart.rb +7 -0
- data/commands/commands/rhoconnect/secret.rb +11 -0
- data/commands/commands/rhoconnect/set_admin_password.rb +26 -0
- data/commands/commands/rhoconnect/spec.rb +15 -0
- data/commands/commands/rhoconnect/start.rb +18 -0
- data/commands/commands/rhoconnect/startbg.rb +34 -0
- data/commands/commands/rhoconnect/startdebug.rb +35 -0
- data/commands/commands/rhoconnect/stop.rb +11 -0
- data/commands/commands/rhoconnect/war.rb +32 -0
- data/commands/commands/rhoconnect/web.rb +7 -0
- data/commands/execute.rb +35 -0
- data/commands/generators/app.rb +6 -0
- data/commands/generators/source.rb +6 -0
- data/commands/utilities/dtach_installed.rb +10 -0
- data/doc/benchmarks-running.txt +5 -0
- data/doc/command-line.txt +216 -27
- data/doc/heroku-addon.txt +1 -1
- data/doc/preparing-production.txt +20 -1
- data/doc/public/cli.txt +191 -0
- data/doc/push-backend-setup.txt +148 -0
- data/doc/push-client-setup.txt +61 -0
- data/doc/push-server-setup.txt +91 -0
- data/doc/push.txt +8 -137
- data/doc/rest-api.txt +96 -0
- data/doc/settings.txt +1 -1
- data/doc/supported-platforms.txt +2 -1
- data/doc/tutorial.txt +6 -4
- data/examples/simple/Gemfile +39 -0
- data/examples/simple/Rakefile +7 -12
- data/examples/simple/config.ru +16 -31
- data/examples/simple/settings/settings.yml +5 -4
- data/examples/simple/sources/product.rb +51 -0
- data/generators/templates/application/Gemfile +7 -0
- data/generators/templates/application/Rakefile +5 -18
- data/generators/templates/application/config.ru +11 -19
- data/install.sh +24 -49
- data/installer/unix-like/create_texts.rb +71 -123
- data/installer/unix-like/post_install.sh +3 -0
- data/installer/unix-like/post_uninstall.sh +2 -0
- data/installer/unix-like/pre_install.sh +5 -3
- data/installer/unix-like/pre_uninstall.sh +14 -6
- data/installer/unix-like/rho_connect_install_checkers.rb +1 -1
- data/installer/unix-like/rho_connect_install_constants.rb +6 -10
- data/installer/unix-like/rho_connect_install_debian.rb +2 -2
- data/installer/unix-like/rho_connect_install_dnd.rb +2 -5
- data/installer/unix-like/rho_connect_install_installers.rb +15 -23
- data/installer/unix-like/rho_connect_install_yum.rb +2 -2
- data/installer/utils/constants.rb +4 -4
- data/installer/utils/create_sha1.rb +1 -1
- data/installer/utils/nix_install_test.rb +32 -31
- data/installer/utils/nix_installation.rake +1 -1
- data/installer/utils/package_upload/repos.rake +34 -30
- data/installer/utils/package_upload/s3_upload.rb +3 -3
- data/lib/rhoconnect/api/source/fast_delete.rb +10 -0
- data/lib/rhoconnect/api/source/fast_insert.rb +10 -0
- data/lib/rhoconnect/api/source/fast_update.rb +10 -0
- data/lib/rhoconnect/api/source/get_source_params.rb +1 -1
- data/lib/rhoconnect/api/source/list_sources.rb +2 -2
- data/lib/rhoconnect/api/source/save_adapter.rb +1 -1
- data/lib/rhoconnect/api/source/update_source_params.rb +6 -0
- data/lib/rhoconnect/async.rb +82 -0
- data/lib/rhoconnect/bulk_data/bulk_data.rb +5 -1
- data/lib/rhoconnect/client_sync.rb +18 -3
- data/lib/rhoconnect/console/rhoconnect_api.rb +2 -2
- data/lib/rhoconnect/console/server.rb +5 -32
- data/lib/rhoconnect/console.rb +2 -2
- data/lib/rhoconnect/graph_helper.rb +225 -0
- data/lib/rhoconnect/jobs/bulk_data_job.rb +24 -2
- data/lib/rhoconnect/server.rb +31 -11
- data/lib/rhoconnect/source.rb +10 -5
- data/lib/rhoconnect/source_sync.rb +32 -2
- data/lib/rhoconnect/tasks.rb +19 -108
- data/lib/rhoconnect/test_methods.rb +20 -0
- data/lib/rhoconnect/utilities.rb +118 -0
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect/web-console/controllers/admins.js +245 -0
- data/lib/rhoconnect/web-console/models/adapter.js +53 -0
- data/lib/rhoconnect/web-console/models/client.js +105 -0
- data/lib/rhoconnect/web-console/models/doc.js +113 -0
- data/lib/rhoconnect/web-console/models/session.js +40 -0
- data/lib/rhoconnect/web-console/models/source.js +115 -0
- data/lib/rhoconnect/web-console/models/stats.js +84 -0
- data/lib/rhoconnect/web-console/models/user.js +111 -0
- data/lib/rhoconnect/web-console/public/backbone.js +1432 -0
- data/lib/rhoconnect/web-console/public/bootstrap.css +3990 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/excanvas.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.barRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisLabelRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisTickRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasTextRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.categoryAxisRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.cursor.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.pointLabels.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery-1.4.2.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.css +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.js +0 -0
- data/lib/rhoconnect/web-console/public/jquery-1.7.1.min.js +154 -0
- data/lib/rhoconnect/web-console/public/rhoconnect-web.js +15 -0
- data/lib/rhoconnect/web-console/public/underscore.js +999 -0
- data/lib/rhoconnect/web-console/server.rb +55 -0
- data/lib/rhoconnect/web-console/templates/index.erb +90 -0
- data/lib/rhoconnect/web-console/templates/jqplot.erb +60 -0
- data/lib/rhoconnect/web-console/views/api_token.js +16 -0
- data/lib/rhoconnect/web-console/views/doc.js +63 -0
- data/lib/rhoconnect/web-console/views/edit_user.js +43 -0
- data/lib/rhoconnect/web-console/views/home.js +56 -0
- data/lib/rhoconnect/web-console/views/index.js +63 -0
- data/lib/rhoconnect/web-console/views/new_ping.js +58 -0
- data/lib/rhoconnect/web-console/views/new_user.js +29 -0
- data/lib/rhoconnect/web-console/views/server_doc.js +103 -0
- data/lib/rhoconnect/web-console/views/set_adapter.js +38 -0
- data/lib/rhoconnect/web-console/views/settings.js +53 -0
- data/lib/rhoconnect/web-console/views/show_device.js +56 -0
- data/lib/rhoconnect/web-console/views/show_user.js +38 -0
- data/lib/rhoconnect/web-console/views/source_docs.js +30 -0
- data/lib/rhoconnect/web-console/views/stats.js +69 -0
- data/lib/rhoconnect/web-console/views/users.js +20 -0
- data/lib/rhoconnect.rb +2 -1
- data/rhoconnect.gemspec +3 -1
- data/spec/api/application/rhoconnect_api_spec.rb +3 -5
- data/spec/api/source/fast_delete_spec.rb +27 -0
- data/spec/api/source/fast_insert_spec.rb +28 -0
- data/spec/api/source/fast_update_spec.rb +51 -0
- data/spec/api/source/get_source_params_spec.rb +1 -0
- data/spec/api/source/update_source_params_spec.rb +24 -0
- data/spec/async_spec.rb +19 -0
- data/spec/client_sync_spec.rb +19 -2
- data/spec/javascripts/PlayerSpec.js +58 -0
- data/spec/javascripts/admins_routes_spec.js +117 -0
- data/spec/javascripts/admins_spec.js +27 -0
- data/spec/javascripts/doc_view_spec.js +37 -0
- data/spec/javascripts/edit_user_view_spec.js +44 -0
- data/spec/javascripts/helpers/SpecHelper.js +9 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +305 -0
- data/spec/javascripts/helpers/jasmine-sinon.js +43 -0
- data/spec/javascripts/helpers/sinon-1.3.2.js +3551 -0
- data/spec/javascripts/home_view_spec.js +39 -0
- data/spec/javascripts/index_view_spec.js +42 -0
- data/spec/javascripts/new_ping_view_spec.js +48 -0
- data/spec/javascripts/new_user_view_spec.js +42 -0
- data/spec/javascripts/server_doc_view_spec.js +39 -0
- data/spec/javascripts/set_adapter_view_spec.js +32 -0
- data/spec/javascripts/show_device_view_spec.js +41 -0
- data/spec/javascripts/show_user_view_spec.js +46 -0
- data/spec/javascripts/source_docs_view_spec.js +36 -0
- data/spec/javascripts/support/jasmine.yml +79 -0
- data/spec/javascripts/support/jasmine_config.rb +23 -0
- data/spec/javascripts/support/jasmine_runner.rb +32 -0
- data/spec/javascripts/users_view_spec.js +35 -0
- data/spec/jobs/bulk_data_job_spec.rb +10 -2
- data/spec/perf/bulk_data_perf_spec.rb +1 -0
- data/spec/server/server_spec.rb +3 -1
- data/spec/source_sync_spec.rb +14 -1
- data/spec/spec_helper.rb +51 -0
- data/spec/store_spec.rb +6 -0
- data/spec/test_methods_spec.rb +11 -0
- data/tasks/redis.rake +3 -1
- metadata +172 -64
- data/doc/contributing.txt +0 -60
- data/lib/rhoconnect/console/app/helpers/auth_helper.rb +0 -22
- data/lib/rhoconnect/console/app/helpers/extensions.rb +0 -19
- data/lib/rhoconnect/console/app/helpers/helpers.rb +0 -57
- data/lib/rhoconnect/console/app/public/ThickBox.css +0 -649
- data/lib/rhoconnect/console/app/public/home.css +0 -431
- data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/header_halo.jpg +0 -0
- data/lib/rhoconnect/console/app/public/images/land_separator.gif +0 -0
- data/lib/rhoconnect/console/app/public/images/landing_header.jpg +0 -0
- data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/tabs_separator.png +0 -0
- data/lib/rhoconnect/console/app/public/main.css +0 -7
- data/lib/rhoconnect/console/app/public/reset.css +0 -76
- data/lib/rhoconnect/console/app/public/style.css +0 -2201
- data/lib/rhoconnect/console/app/public/text.txt +0 -0
- data/lib/rhoconnect/console/app/routes/adapter.rb +0 -28
- data/lib/rhoconnect/console/app/routes/auth.rb +0 -29
- data/lib/rhoconnect/console/app/routes/client.rb +0 -31
- data/lib/rhoconnect/console/app/routes/docs.rb +0 -145
- data/lib/rhoconnect/console/app/routes/heroku.rb +0 -19
- data/lib/rhoconnect/console/app/routes/home.rb +0 -63
- data/lib/rhoconnect/console/app/routes/timing.rb +0 -242
- data/lib/rhoconnect/console/app/routes/user.rb +0 -122
- data/lib/rhoconnect/console/app/views/adapter.erb +0 -16
- data/lib/rhoconnect/console/app/views/client.erb +0 -30
- data/lib/rhoconnect/console/app/views/content.erb +0 -14
- data/lib/rhoconnect/console/app/views/doc.erb +0 -8
- data/lib/rhoconnect/console/app/views/docdata.erb +0 -28
- data/lib/rhoconnect/console/app/views/docs.erb +0 -30
- data/lib/rhoconnect/console/app/views/edituser.erb +0 -13
- data/lib/rhoconnect/console/app/views/headermenu.erb +0 -40
- data/lib/rhoconnect/console/app/views/home.erb +0 -24
- data/lib/rhoconnect/console/app/views/index.erb +0 -58
- data/lib/rhoconnect/console/app/views/jqplot.erb +0 -52
- data/lib/rhoconnect/console/app/views/layout.erb +0 -153
- data/lib/rhoconnect/console/app/views/login.erb +0 -26
- data/lib/rhoconnect/console/app/views/newuser.erb +0 -17
- data/lib/rhoconnect/console/app/views/ping.erb +0 -40
- data/lib/rhoconnect/console/app/views/result.erb +0 -11
- data/lib/rhoconnect/console/app/views/rightboxlinks.erb +0 -15
- data/lib/rhoconnect/console/app/views/select_doc.erb +0 -17
- data/lib/rhoconnect/console/app/views/upload_doc.erb +0 -23
- data/lib/rhoconnect/console/app/views/user.erb +0 -29
- data/lib/rhoconnect/console/app/views/users.erb +0 -19
- data/lib/rhoconnect/server/views/index.erb +0 -13
@@ -0,0 +1,15 @@
|
|
1
|
+
Execute.define_task do
|
2
|
+
begin
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
desc "spec", "Run source adapter specs"
|
5
|
+
def spec
|
6
|
+
files = File.join('spec','**','*_spec.rb')
|
7
|
+
RSpec::Core::RakeTask.new('rhoconnect:spec') do |t|
|
8
|
+
t.pattern = FileList[files]
|
9
|
+
t.rspec_opts = %w(-fn -b --color)
|
10
|
+
end #do
|
11
|
+
end #spec
|
12
|
+
rescue Exception => e
|
13
|
+
puts "Run source adapter specs error: #{e.inspect}"
|
14
|
+
end #begin
|
15
|
+
end #do
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Execute.define_task do
|
2
|
+
desc "start", "Start rhoconnect server"
|
3
|
+
def start
|
4
|
+
invoke :dtach_installed
|
5
|
+
command = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
|
6
|
+
if windows?
|
7
|
+
puts 'Starting rhoconnect...'
|
8
|
+
system("#{command} config.ru -P #{rhoconnect_pid}")
|
9
|
+
elsif jruby?
|
10
|
+
puts 'Starting rhoconnect in jruby environment...'
|
11
|
+
system("#{command}")
|
12
|
+
else
|
13
|
+
puts 'Detach with Ctrl+\ Re-attach with rhoconnect attach'
|
14
|
+
sleep 2
|
15
|
+
cmd "dtach -A #{rhoconnect_socket} #{command} config.ru -P #{rhoconnect_pid}"
|
16
|
+
end #if
|
17
|
+
end #start
|
18
|
+
end #do
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
# NOTE: On Windows Process.fork is implemented in a way
|
4
|
+
# that it re-starts the parent command with an additional "child#0"
|
5
|
+
# argument. Naturally, this leads to Thor rejecting that 2nd invocation
|
6
|
+
# since the original command is not supposed to have arguments.
|
7
|
+
# To overcome this issue all Background commands
|
8
|
+
# should be inside their own Thor::Group-derived class
|
9
|
+
# which declares an additional optional argument (which is not used)
|
10
|
+
# but exists merely to support Windows Process.fork artificial implementation
|
11
|
+
class StartBg < Thor::Group
|
12
|
+
argument :childname, :optional => true
|
13
|
+
#desc "startbg", "Start rhoconnect server in bg mode (Rhostudio) - this is an internal command"
|
14
|
+
def startbg
|
15
|
+
cmd = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
|
16
|
+
require 'win32/process' if windows?
|
17
|
+
|
18
|
+
p1 = Process.fork {
|
19
|
+
if windows?
|
20
|
+
puts 'Starting rhoconnect ...'
|
21
|
+
system("#{cmd} config.ru -P #{rhoconnect_pid}")
|
22
|
+
elsif jruby?
|
23
|
+
puts 'Starting rhoconnect in jruby environment...'
|
24
|
+
system("#{cmd}")
|
25
|
+
else
|
26
|
+
system("bundle exec #{cmd} config.ru -P #{rhoconnect_pid}")
|
27
|
+
end
|
28
|
+
}
|
29
|
+
Process.detach(p1)
|
30
|
+
|
31
|
+
exit
|
32
|
+
end #startbg
|
33
|
+
end
|
34
|
+
Execute.register StartBg, "startbg", "startbg", "Start rhoconnect server in bg mode (Rhostudio) - this is an internal command", :hide => true
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
# NOTE: On Windows Process.fork is implemented in a way
|
4
|
+
# that it re-starts the parent command with an additional "child#0"
|
5
|
+
# argument. Naturally, this leads to Thor rejecting that 2nd invocation
|
6
|
+
# since the original command is not supposed to have arguments.
|
7
|
+
# To overcome this issue all Background commands
|
8
|
+
# should be inside their own Thor::Group-derived class
|
9
|
+
# which declares an additional optional argument (which is not used)
|
10
|
+
# but exists merely to support Windows Process.fork artificial implementation
|
11
|
+
class StartDebug < Thor::Group
|
12
|
+
argument :childname, :optional => true
|
13
|
+
#desc "startdebug", "Start rhoconnect server in debug mode (Rhostudio) - this is an internal command", :hide => true
|
14
|
+
def startdebug
|
15
|
+
cmd = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
|
16
|
+
ENV['DEBUG'] = 'yes'
|
17
|
+
require 'win32/process' if windows?
|
18
|
+
|
19
|
+
p1 = Process.fork {
|
20
|
+
if windows?
|
21
|
+
puts 'Starting rhoconnect ...'
|
22
|
+
system("#{cmd} config.ru -P #{rhoconnect_pid}")
|
23
|
+
elsif jruby?
|
24
|
+
puts 'Starting rhoconnect in jruby environment...'
|
25
|
+
system("#{cmd}")
|
26
|
+
else
|
27
|
+
system("bundle exec #{cmd} config.ru -P #{rhoconnect_pid}")
|
28
|
+
end
|
29
|
+
}
|
30
|
+
Process.detach(p1)
|
31
|
+
|
32
|
+
exit
|
33
|
+
end #startdebug
|
34
|
+
end
|
35
|
+
Execute.register StartDebug, "startdebug", "startdebug", "Start rhoconnect server in debug mode (Rhostudio) - this is an internal command", :hide => true
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Execute.define_task do
|
2
|
+
desc "stop", "Stop rhoconnect server"
|
3
|
+
def stop
|
4
|
+
invoke :dtach_installed
|
5
|
+
if windows?
|
6
|
+
File.delete "#{rhoconnect_pid}" if system("FOR /F %A in (#{rhoconnect_pid}) do taskkill /F /PID %A")
|
7
|
+
else
|
8
|
+
cmd "cat #{rhoconnect_pid} | xargs kill -3"
|
9
|
+
end #if
|
10
|
+
end #stop
|
11
|
+
end #do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Execute.define_task do
|
2
|
+
desc "war", "Build executable WAR file to be used in Java App Servers"
|
3
|
+
def war
|
4
|
+
if jruby? then
|
5
|
+
puts "building the WAR file"
|
6
|
+
if not File::exists? "config/warble.rb"
|
7
|
+
puts "generating Warbler's config file"
|
8
|
+
includeDirs = []
|
9
|
+
Dir.mkdir('config') if not File.exists?('config')
|
10
|
+
aFile = File.new("config/warble.rb", "w+")
|
11
|
+
if aFile
|
12
|
+
includeDirs = FileList['*'].exclude do |entry|
|
13
|
+
entry if (not File.directory? entry) || (entry == 'spec')
|
14
|
+
end #if
|
15
|
+
configFile = "Warbler::Config.new do |config|\n" +
|
16
|
+
"config.dirs = %w(#{includeDirs.join(' ')})\n" +
|
17
|
+
"config.includes = FileList[\"./*\"]\n" +
|
18
|
+
"config.excludes = FileList[\"./*.war\",'spec']\nend"
|
19
|
+
aFile.write("#{configFile}")
|
20
|
+
aFile.close
|
21
|
+
else
|
22
|
+
puts "Unable to create config/warble.rb file!"
|
23
|
+
end #if
|
24
|
+
end #if
|
25
|
+
# build the executable WAR using the config/warble.rb file
|
26
|
+
ENV['BUNDLE_WITHOUT'] = ['development','test'].join(':')
|
27
|
+
sh 'warble executable war'
|
28
|
+
else
|
29
|
+
puts "Cannot build WAR files outside of JRuby environment!"
|
30
|
+
end #if
|
31
|
+
end #war
|
32
|
+
end #do
|
data/commands/execute.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'thor'
|
5
|
+
require 'json'
|
6
|
+
require 'zip/zip'
|
7
|
+
require 'uri'
|
8
|
+
require 'find'
|
9
|
+
$:.unshift File.join(File.dirname(__FILE__), '.')
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__), '..')
|
11
|
+
require 'lib/rhoconnect/utilities'
|
12
|
+
require 'lib/rhoconnect'
|
13
|
+
require 'lib/rhoconnect/console/rhoconnect_api'
|
14
|
+
|
15
|
+
include Utilities
|
16
|
+
|
17
|
+
TASK_DIRS = ['generators', 'commands', 'utilities']
|
18
|
+
|
19
|
+
class Execute < Thor
|
20
|
+
# Methods
|
21
|
+
no_tasks {
|
22
|
+
def self.define_task(&block)
|
23
|
+
Execute.class_eval &block
|
24
|
+
end
|
25
|
+
}
|
26
|
+
# Require all tasks defined in the tasks directories
|
27
|
+
TASK_DIRS.each do |dir|
|
28
|
+
Find.find("#{File.expand_path(File.dirname(__FILE__))}/#{dir}") do |path|
|
29
|
+
if !File.directory? path and
|
30
|
+
File.extname(path) == '.rb'
|
31
|
+
require path
|
32
|
+
end #if
|
33
|
+
end #do
|
34
|
+
end #do
|
35
|
+
end #Execute
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Execute.define_task do
|
2
|
+
desc "dtach_installed", "Check if dtach is installed.", :hide => true
|
3
|
+
def dtach_installed
|
4
|
+
if !windows? and (`which dtach` == '')
|
5
|
+
puts "WARNING: dtach not installed or not on path, some tasks will not work!"
|
6
|
+
puts " Install with '[sudo] rhoconnect dtach-install'"
|
7
|
+
exit
|
8
|
+
end
|
9
|
+
end #dtach_installed
|
10
|
+
end #do
|
data/doc/benchmarks-running.txt
CHANGED
@@ -54,6 +54,11 @@ To execute the Rhoconnect Benchmark test, use the `rhoconnect-benchmark` command
|
|
54
54
|
<td width="200"><code>--maxclientloops NUMBER</code></td>
|
55
55
|
<td>This option runs several tests in a loop varying number of concurrent clients between 1 and NUMBER. The specified interval will be split by 5. For example: -m 10 will produce 5 test executions , first for 1 client, then - for 3, 6, 8, and 10</td>
|
56
56
|
</tr>
|
57
|
+
<tr>
|
58
|
+
<td width="20">-S</td>
|
59
|
+
<td width="200"><code>--simtime NUMBER</code></td>
|
60
|
+
<td>This option allows to enforce NUMBER of seconds delay in the source adapter, thus simulating the backend communication round-trip.</td>
|
61
|
+
</tr>
|
57
62
|
<tr>
|
58
63
|
<td width="20">-A</td>
|
59
64
|
<td width="200"><code>--advanced</code></td>
|
data/doc/command-line.txt
CHANGED
@@ -17,42 +17,28 @@ Enter the name for your RhoConnect application in Project name. You may specify
|
|
17
17
|
|
18
18
|
## Generating a RhoConnect App from the Command Line
|
19
19
|
|
20
|
-
The `rhoconnect` utility is a command line tool for generating RhoConnect applications and
|
20
|
+
The `rhoconnect` utility is a command line tool for generating RhoConnect applications and source adapters.
|
21
21
|
|
22
|
-
The app name is passed as a parameter. The `rhoconnect` utility will generate a directory for your application with all the necessary files to get started. We will start with running `rhoconnect app` to see the usage:
|
22
|
+
The app name is passed as a parameter. The `rhoconnect` utility will generate a directory for your application with all the necessary files to get started. We will start with running `rhoconnect help app` to see the usage:
|
23
23
|
|
24
24
|
:::term
|
25
|
-
Usage:
|
25
|
+
Usage:
|
26
|
+
rhoconnect app NAME
|
26
27
|
|
27
28
|
Generates a new rhoconnect application.
|
28
29
|
|
29
|
-
Required:
|
30
|
-
name - application name
|
31
|
-
|
32
|
-
|
33
|
-
Options specific for this generator:
|
34
|
-
|
35
|
-
General options:
|
36
|
-
-p, --pretend Run, but do not make any changes.
|
37
|
-
-f, --force Overwrite files that already exist.
|
38
|
-
-s, --skip Skip files that already exist.
|
39
|
-
-d, --delete Delete files that have previously been generated with this generator.
|
40
|
-
--no-color Don't colorize the output
|
41
|
-
-h, --help Show this message
|
42
|
-
--debug Do not catch errors
|
43
|
-
|
44
30
|
For example:
|
45
31
|
|
46
32
|
:::term
|
47
33
|
$ rhoconnect app storeserver
|
48
34
|
Generating with app generator:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
35
|
+
[ADDED] storeserver/config.ru
|
36
|
+
[ADDED] storeserver/settings/settings.yml
|
37
|
+
[ADDED] storeserver/settings/license.key
|
38
|
+
[ADDED] storeserver/application.rb
|
39
|
+
[ADDED] storeserver/Rakefile
|
40
|
+
[ADDED] storeserver/Gemfile
|
41
|
+
[ADDED] storeserver/spec/spec_helper.rb
|
56
42
|
|
57
43
|
Here's a basic rundown of each of the files that were just generated:
|
58
44
|
|
@@ -71,7 +57,8 @@ After generating the application, you might be asked to change directories to yo
|
|
71
57
|
$ cd storeserver
|
72
58
|
$ bundle install
|
73
59
|
|
74
|
-
## Rake Tasks
|
60
|
+
## Rake Tasks (Rhoconnect v.3.1 and lower)
|
61
|
+
<span class="label label-important">As of version 4.0 of rhoconnect rake tasks will be deprecated!!</span>
|
75
62
|
|
76
63
|
Each RhoConnect application uses [rake](https://github.com/jimweirich/rake) to manage development tasks such as starting/stopping the app, starting resque workers, and running specs.
|
77
64
|
|
@@ -83,7 +70,7 @@ If you're using MacOS / Linux, install [dtach](http://dtach.sourceforge.net/) on
|
|
83
70
|
|
84
71
|
:::term
|
85
72
|
$ cd storeserver
|
86
|
-
|
73
|
+
$ [sudo] rake dtach:install
|
87
74
|
|
88
75
|
### Setup Redis
|
89
76
|
|
@@ -195,6 +182,208 @@ Here is a complete list of the rake tasks available in a RhoConnect application:
|
|
195
182
|
rake rhoconnect:war # Build executable WAR file to be used in Java App Servers
|
196
183
|
rake rhoconnect:web # Launch the web console in a browser - uses :syncserver: in settings.yml
|
197
184
|
|
185
|
+
## Rhoconnect CLI (Rhoconnect v.3.2+)
|
186
|
+
In rhoconnect versions 3.2 and higher the rake utility has been replaced using a ruby utility called [thor](https://github.com/wycats/thor).
|
187
|
+
Using this utility we are able to route all rake-like tasks through a custom command-line interface. All tasks now are used via the
|
188
|
+
rhoconnect gem's cli. In doing this we have also combined the app and source generators into the same command making it unnecessary to switch
|
189
|
+
from rhoconnect to rake at any point, simply use `rhoconnect` throughout.
|
190
|
+
|
191
|
+
To issue commands this way simply type rhoconnect followed by the task you wish to perform. To see a list of all the tasks you can issue with
|
192
|
+
rhoconnect, simply type `rhoconnect` or `rhoconnect help`.
|
193
|
+
|
194
|
+
:::term
|
195
|
+
$ rhoconnect help
|
196
|
+
Tasks:
|
197
|
+
rhoconnect app NAME # Generates a new rhoconnect application.
|
198
|
+
rhoconnect attach # Attach to rhoconnect console
|
199
|
+
rhoconnect clean-start # Clean rhoconnect, get token, and create new user
|
200
|
+
rhoconnect create-user # Creates and subscribes user for application in rhoconnect
|
201
|
+
rhoconnect delete-device # Deletes a device from rhoconnect
|
202
|
+
rhoconnect delete-user # Deletes a user from rhoconnect
|
203
|
+
rhoconnect dtach-about # About dtach
|
204
|
+
rhoconnect dtach-install # Install dtach 0.8 from source
|
205
|
+
rhoconnect flushdb # Flush data store - WARNING: THIS REMOVES ALL DATA IN RHOCONNECT
|
206
|
+
rhoconnect get-token # Fetches current api token from rhoconnect
|
207
|
+
rhoconnect help [TASK] # Describe available tasks or one specific task
|
208
|
+
rhoconnect redis-about # About redis
|
209
|
+
rhoconnect redis-attach # Attach to redis dtach socket
|
210
|
+
rhoconnect redis-download # Download redis package
|
211
|
+
rhoconnect redis-install # Install the latest verison of Redis from Github (requires git, duh)
|
212
|
+
rhoconnect redis-restart # Restart redis
|
213
|
+
rhoconnect redis-start # Start redis
|
214
|
+
rhoconnect redis-stop # Stop redis
|
215
|
+
rhoconnect reset # Reset the rhoconnect database (you will need to run rhoconnect:get_token afterwards)
|
216
|
+
rhoconnect reset-refresh # Reset source refresh time
|
217
|
+
rhoconnect restart # Alias for `rhoconnect stop; rhoconnect start`
|
218
|
+
rhoconnect secret # Generate a cryptographically secure secret session key
|
219
|
+
rhoconnect set-admin-password # Sets the admin password
|
220
|
+
rhoconnect source NAME # Generates a new source adapter.
|
221
|
+
rhoconnect spec # Run source adapter specs
|
222
|
+
rhoconnect start # Start rhoconnect server
|
223
|
+
rhoconnect stop # Stop rhoconnect server
|
224
|
+
rhoconnect war # Build executable WAR file to be used in Java App Servers
|
225
|
+
rhoconnect web # Launch the web console in a browser - uses :syncserver: in settings.yml
|
226
|
+
|
227
|
+
### Installing DTach (Mac OS / Linux only)
|
228
|
+
|
229
|
+
If you're using MacOS / Linux, install [dtach](http://dtach.sourceforge.net/) on your path before running any of the rake tasks. [DTach](http://dtach.sourceforge.net/) is a simple utility which runs processes in a detached state so you can re-attach your console later.
|
230
|
+
|
231
|
+
:::term
|
232
|
+
$ cd storeserver
|
233
|
+
$ rhoconnect dtach-install
|
234
|
+
|
235
|
+
### Setup Redis
|
236
|
+
|
237
|
+
Next, you will need to setup and start a [redis](http://redis.io/) server:
|
238
|
+
|
239
|
+
:::term
|
240
|
+
$ rhoconnect redis-install
|
241
|
+
$ rhoconnect redis-start
|
242
|
+
|
243
|
+
The server will show that it is running on the console.
|
244
|
+
|
245
|
+
### Start the Application
|
246
|
+
|
247
|
+
Open a new console window (since the redis server is running in the previous console window). Then change directories to your rhoconnect applciation and start the application.
|
248
|
+
|
249
|
+
:::term
|
250
|
+
$ cd storeserver
|
251
|
+
$ rhoconnect start
|
252
|
+
|
253
|
+
If everything went well, you should see the following in your console:
|
254
|
+
|
255
|
+
[05:47:10 PM 2011-04-19] Rhoconnect Server v3.0.0 started...
|
256
|
+
|
257
|
+
To open the web console, navigate to [http://localhost:9292/](http://localhost:9292) in your browser or run:
|
258
|
+
|
259
|
+
:::term
|
260
|
+
$ rhoconnect web
|
261
|
+
|
262
|
+
### Creating executable WAR containers (JRuby environment only)
|
263
|
+
|
264
|
+
It is possible to create Java WAR containers for your Rhoconnect application that can be deployed into the
|
265
|
+
Java App Servers (for example, JBoss). To create the executable WAR container, execute the following command in your app's root directory:
|
266
|
+
|
267
|
+
:::term
|
268
|
+
$ cd storeserver
|
269
|
+
$ rhoconnect war
|
270
|
+
|
271
|
+
This will build the WAR file named <your_app>.war that can be deployed into the Java App Server.
|
272
|
+
|
273
|
+
|
274
|
+
Below is provided a list of rake tasks and their corresponding rhoconnect command.
|
275
|
+
|
276
|
+
<table border="1", cellpadding="5", width="100%">
|
277
|
+
<tr>
|
278
|
+
<th>rake Command</th>
|
279
|
+
<th>rhoconnect command</th>
|
280
|
+
</tr>
|
281
|
+
<tr>
|
282
|
+
<td>rake -T</td>
|
283
|
+
<td>rhoconnect help</td>
|
284
|
+
</tr>
|
285
|
+
<tr>
|
286
|
+
<td>rake rhoconnect:attach</td>
|
287
|
+
<td>rhoconnect attach</td>
|
288
|
+
</tr>
|
289
|
+
<tr>
|
290
|
+
<td>rake rhoconnect:clean_start</td>
|
291
|
+
<td>rhoconnect clean-start</td>
|
292
|
+
</tr>
|
293
|
+
<tr>
|
294
|
+
<td>rake rhoconnect:reate_user</td>
|
295
|
+
<td>rhoconnect create-user</td>
|
296
|
+
</tr>
|
297
|
+
<tr>
|
298
|
+
<td>rake rhoconnect:delete_device</td>
|
299
|
+
<td>rhoconnect delete-device</td>
|
300
|
+
</tr>
|
301
|
+
<tr>
|
302
|
+
<td>rake rhoconnect:delete_user</td>
|
303
|
+
<td>rhoconnect delete-user</td>
|
304
|
+
</tr>
|
305
|
+
<tr>
|
306
|
+
<td>rake rhoconnect:flushdb</td>
|
307
|
+
<td>rhoconnect flushdb</td>
|
308
|
+
</tr>
|
309
|
+
<tr>
|
310
|
+
<td>rake rhoconnect:get_token</td>
|
311
|
+
<td>rhoconnect get-token</td>
|
312
|
+
</tr>
|
313
|
+
<tr>
|
314
|
+
<td>rake rhoconnect:reset</td>
|
315
|
+
<td>rhoconnect reset</td>
|
316
|
+
</tr>
|
317
|
+
<tr>
|
318
|
+
<td>rake rhoconnect:reset_refresh</td>
|
319
|
+
<td>rhoconnect reset-refresh</td>
|
320
|
+
</tr>
|
321
|
+
<tr>
|
322
|
+
<td>rake rhoconnect:restart</td>
|
323
|
+
<td>rhoconnect restart</td>
|
324
|
+
</tr>
|
325
|
+
<tr>
|
326
|
+
<td>rake rhoconnect:set_admin_password</td>
|
327
|
+
<td>rhoconnect set-admin-password</td>
|
328
|
+
</tr>
|
329
|
+
<tr>
|
330
|
+
<td>rake rhoconnect:spec</td>
|
331
|
+
<td>rhoconnect spec</td>
|
332
|
+
</tr>
|
333
|
+
<tr>
|
334
|
+
<td>rake rhoconnect:start</td>
|
335
|
+
<td>rhoconnect start</td>
|
336
|
+
</tr>
|
337
|
+
<tr>
|
338
|
+
<td>rake rhoconnect:stop</td>
|
339
|
+
<td>rhoconnect stop</td>
|
340
|
+
</tr>
|
341
|
+
<tr>
|
342
|
+
<td>rake rhoconnect:war</td>
|
343
|
+
<td>rhoconnect war</td>
|
344
|
+
</tr>
|
345
|
+
<tr>
|
346
|
+
<td>rake rhoconnect:web</td>
|
347
|
+
<td>rhoconnect web</td>
|
348
|
+
</tr>
|
349
|
+
<tr>
|
350
|
+
<td>rake dtach:about</td>
|
351
|
+
<td>rhoconnect dtach-about</td>
|
352
|
+
</tr>
|
353
|
+
<tr>
|
354
|
+
<td>rake dtach:install</td>
|
355
|
+
<td>rhoconnect dtach-install</td>
|
356
|
+
</tr>
|
357
|
+
<tr>
|
358
|
+
<td>rake redis:about</td>
|
359
|
+
<td>rhoconnect redis-about</td>
|
360
|
+
</tr>
|
361
|
+
<tr>
|
362
|
+
<td>rake redis:attach</td>
|
363
|
+
<td>rhoconnect redis-attach</td>
|
364
|
+
</tr>
|
365
|
+
<tr>
|
366
|
+
<td>rake redis:download</td>
|
367
|
+
<td>rhoconnect redis-download</td>
|
368
|
+
</tr>
|
369
|
+
<tr>
|
370
|
+
<td>rake redis:install</td>
|
371
|
+
<td>rhoconnect redis-install</td>
|
372
|
+
</tr>
|
373
|
+
<tr>
|
374
|
+
<td>rake redis:restart</td>
|
375
|
+
<td>rhoconnect redis-restart</td>
|
376
|
+
</tr>
|
377
|
+
<tr>
|
378
|
+
<td>rake redis:start</td>
|
379
|
+
<td>rhoconnect redis-start</td>
|
380
|
+
</tr>
|
381
|
+
<tr>
|
382
|
+
<td>rake redis:stop</td>
|
383
|
+
<td>rhoconnect redis-stop</td>
|
384
|
+
</tr>
|
385
|
+
</table>
|
386
|
+
|
198
387
|
## Generate Source
|
199
388
|
|
200
389
|
Connecting to a backend service with RhoConnect requires that you write a small amount of code for the query, create, update and delete operations of your particular enterprise backend. The collection of the code for these operations is called a source. You can create source for your RhoConnect application two ways:
|
data/doc/heroku-addon.txt
CHANGED
@@ -28,7 +28,7 @@ RhoConnect is now setup with your backend service.
|
|
28
28
|
|
29
29
|
Connecting a simple rhodes app
|
30
30
|
-------------------------------
|
31
|
-
To view a full tutorial about creating a rhodes application and the features of rhodes see [
|
31
|
+
To view a full tutorial about creating a rhodes application and the features of rhodes see [RhoStudio tutorial](http://docs.rhomobile.com/rhostudio.tutorial).
|
32
32
|
|
33
33
|
##Gem installation:
|
34
34
|
|
@@ -35,7 +35,7 @@ Then plug this secret into your `config.ru`:
|
|
35
35
|
|
36
36
|
:::ruby
|
37
37
|
Rhoconnect::Server.set :secret, '040a2355475e9d0fb591ef78d5b9ca61a34cbcfd3f11942b18bc1d91f1ca66c27b2e0386333843a7efa29f40fff03624cd908d0883364ffbfa3208ab23fa2664'
|
38
|
-
|
38
|
+
|
39
39
|
To run RhoConnect in production mode, use `RACK_ENV` environment variable set to "production". This ensures RhoConnect will use the `:production` section of the settings. For example:
|
40
40
|
|
41
41
|
:::term
|
@@ -45,6 +45,24 @@ Will start thin in with `RACK_ENV` set to "production".
|
|
45
45
|
|
46
46
|
NOTE: If you deploy using passenger or on RhoHub, this variable is automatically set to production.
|
47
47
|
|
48
|
+
### Asynchronous processing
|
49
|
+
|
50
|
+
RhoConnect version 3.2.x introduces a new feature which enables asynchronous processing of the incoming requests to improve the responsiveness of the Rhoconnect application using EventMachine, Fibers API, and Rack Fiber Pool. This new feature is available with Ruby 1.9.x and enabled by default. It is not available with Ruby 1.8.7, JRuby and REE.
|
51
|
+
To disable the feature and revert back to synchronous handling, you can use the following options in the `config.ru` file:
|
52
|
+
|
53
|
+
:::ruby
|
54
|
+
Rhoconnect::Server.set :use_async_model, false # true by default
|
55
|
+
|
56
|
+
By default, the Rhoconnect application is started with Rack FiberPool's size equal to 100 and EventMachine's thread pool size set to 20. To adjust those settings you can use the following options:
|
57
|
+
|
58
|
+
:::ruby
|
59
|
+
# adjust the Rack FiberPool size
|
60
|
+
Rhoconnect::Server.set :fiberpool_size, 50 # default is 100
|
61
|
+
|
62
|
+
# adjust the EventMachine Thread Pool size
|
63
|
+
EventMachine.threadpool_size = 25 # default is 20
|
64
|
+
|
65
|
+
|
48
66
|
## settings/settings.yml
|
49
67
|
This file contains all source adapter options and settings like the redis server connection. Before deploying to production, make sure you have the appropriate production settings:
|
50
68
|
|
@@ -61,3 +79,4 @@ This file contains all source adapter options and settings like the redis server
|
|
61
79
|
## settings/license.key
|
62
80
|
This contains your RhoConnect license key text. By default, a RhoConnect application comes with a 10 device license. Please see the [licensing page](/rhoconnect/licensing) for more details.
|
63
81
|
|
82
|
+
|