rhoconnect 4.0.4 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +54 -5
- data/CREDITS +219 -219
- data/Gemfile +2 -2
- data/Gemfile.lock +68 -79
- data/Rakefile +1 -2
- data/bench/benchapp/spec/models/ruby/mock_adapter_spec.rb +17 -17
- data/bench/benchapp/spec/models/ruby/queue_mock_adapter_spec.rb +17 -17
- data/bench/benchapp/spec/spec_helper.rb +3 -3
- data/bench/blobapp/spec/models/ruby/blob_adapter_spec.rb +17 -17
- data/bench/blobapp/spec/spec_helper.rb +3 -3
- data/bench/lib/bench/runner.rb +1 -69
- data/bench/lib/bench.rb +18 -18
- data/bench/spec/mock_adapter_spec.rb +54 -55
- data/bench/spec/mock_client_spec.rb +47 -48
- data/bench/spec/result_spec.rb +41 -44
- data/bench/spec/utils_spec.rb +24 -25
- data/commands/generators/app.rb +7 -5
- data/commands/generators/controller.rb +7 -5
- data/commands/generators/model.rb +7 -5
- data/commands/generators/source.rb +7 -5
- data/commands/parser.rb +1 -1
- data/commands/redis/redis_download.rb +1 -1
- data/doc/async-jobs.txt +9 -9
- data/doc/supported-platforms.txt +0 -2
- data/generators/rhoconnect.rb +92 -212
- data/generators/templates/application/rcgemfile +3 -3
- data/generators/templates/application/spec/application_controller_spec.rb +14 -16
- data/generators/templates/application/spec/js_spec.rb +20 -20
- data/generators/templates/application/spec/spec_helper.rb +1 -1
- data/generators/templates/source/controllers/ruby/controller_spec.rb +18 -19
- data/generators/templates/source/models/ruby/model_spec.rb +17 -17
- data/install.sh +10 -21
- data/installer/unix-like/rho_connect_install_constants.rb +5 -5
- data/installer/unix-like/rho_connect_install_installers.rb +4 -4
- data/installer/utils/constants.rb +6 -6
- data/installer/utils/nix_install_test.rb +29 -29
- data/installer/utils/package_upload/repos.rake +16 -26
- data/js-adapters/node.rb +4 -4
- data/js-adapters/node_channel.rb +4 -8
- data/lib/rhoconnect/db_adapter.rb +13 -13
- data/lib/rhoconnect/handler/changes/engine.rb +1 -1
- data/lib/rhoconnect/jobs/bulk_data_job.rb +29 -29
- data/lib/rhoconnect/license.rb +7 -7
- data/lib/rhoconnect/model/helpers/find_duplicates_on_update.rb +13 -13
- data/lib/rhoconnect/ping/apple.rb +4 -4
- data/lib/rhoconnect/server.rb +2 -2
- data/lib/rhoconnect/source.rb +2 -2
- data/lib/rhoconnect/store.rb +12 -6
- data/lib/rhoconnect/utilities.rb +2 -2
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect.rb +6 -4
- data/rhoconnect.gemspec +5 -6
- data/spec/api/api_helper.rb +1 -1
- data/spec/api/app/fast_delete_spec.rb +22 -22
- data/spec/api/app/fast_insert_spec.rb +23 -23
- data/spec/api/app/fast_update_spec.rb +63 -63
- data/spec/api/app/push_deletes_spec.rb +11 -13
- data/spec/api/app/push_objects_spec.rb +39 -39
- data/spec/api/client/client_get_db_doc_spec.rb +29 -29
- data/spec/api/client/client_set_db_doc_spec.rb +11 -11
- data/spec/api/client/get_client_params_spec.rb +29 -29
- data/spec/api/client/list_client_docs_spec.rb +32 -34
- data/spec/api/client/reset_spec.rb +30 -30
- data/spec/api/readstate/set_refresh_time_spec.rb +43 -43
- data/spec/api/source/get_source_params_spec.rb +32 -34
- data/spec/api/source/list_sources_spec.rb +13 -13
- data/spec/api/source/update_source_params_spec.rb +19 -19
- data/spec/api/store/get_db_doc_spec.rb +27 -27
- data/spec/api/store/set_db_doc_spec.rb +38 -38
- data/spec/api/system/adapter_spec.rb +27 -29
- data/spec/api/system/get_license_info_spec.rb +11 -11
- data/spec/api/system/login_spec.rb +37 -37
- data/spec/api/system/reset_spec.rb +15 -15
- data/spec/api/system/stats_spec.rb +70 -71
- data/spec/api/user/create_user_spec.rb +37 -37
- data/spec/api/user/delete_client_spec.rb +7 -7
- data/spec/api/user/delete_user_spec.rb +62 -62
- data/spec/api/user/list_clients_spec.rb +24 -24
- data/spec/api/user/list_source_docs_spec.rb +29 -29
- data/spec/api/user/list_users_spec.rb +22 -22
- data/spec/api/user/ping_spec.rb +18 -18
- data/spec/api/user/show_user_spec.rb +10 -10
- data/spec/api/user/update_user_spec.rb +43 -43
- data/spec/api/user/user_get_db_doc_spec.rb +12 -12
- data/spec/api/user/user_set_db_doc_spec.rb +37 -37
- data/spec/api_token_spec.rb +8 -8
- data/spec/app_spec.rb +18 -17
- data/spec/apps/jstestapp/settings/settings.yml +2 -0
- data/spec/async_spec.rb +9 -11
- data/spec/bulk_data/bulk_data_spec.rb +120 -120
- data/spec/cli/cli_spec.rb +50 -53
- data/spec/client_spec.rb +105 -105
- data/spec/client_sync_spec.rb +529 -528
- data/spec/controllers/js_base_spec.rb +147 -141
- data/spec/doc/doc_spec.rb +51 -52
- data/spec/document_spec.rb +58 -58
- data/spec/dynamic_adapter_spec.rb +33 -36
- data/spec/generator/generator_spec.rb +76 -42
- data/spec/jobs/bulk_data_job_spec.rb +101 -102
- data/spec/jobs/ping_job_spec.rb +176 -177
- data/spec/jobs/source_job_spec.rb +24 -25
- data/spec/license_spec.rb +54 -55
- data/spec/models/js_base_spec.rb +121 -120
- data/spec/perf/bulk_data_perf_spec.rb +23 -24
- data/spec/perf/perf_spec_helper.rb +7 -7
- data/spec/perf/store_perf_spec.rb +139 -140
- data/spec/ping/apple_spec.rb +65 -65
- data/spec/ping/gcm_spec.rb +83 -84
- data/spec/ping/rhoconnect_push_spec.rb +52 -53
- data/spec/predefined_adapters/rho_internal_bench_adapter_controller_js_spec.rb +100 -101
- data/spec/predefined_adapters/rho_internal_js_bench_adapter_js_spec.rb +29 -31
- data/spec/read_state_spec.rb +24 -25
- data/spec/rhoconnect_spec.rb +7 -7
- data/spec/server/server_spec.rb +664 -662
- data/spec/server/stats_spec.rb +12 -12
- data/spec/source_adapter_spec.rb +124 -125
- data/spec/source_spec.rb +148 -149
- data/spec/source_sync_spec.rb +736 -736
- data/spec/spec_helper.rb +4 -5
- data/spec/stats/record_spec.rb +22 -21
- data/spec/store_orm_spec.rb +48 -48
- data/spec/store_spec.rb +428 -426
- data/spec/support/shared_examples.rb +5 -7
- data/spec/sync_states_spec.rb +67 -67
- data/spec/test_methods_spec.rb +121 -123
- data/spec/testdata/10000-data.txt +0 -0
- data/spec/testdata/5000-data.txt +0 -0
- data/spec/user_spec.rb +102 -102
- data/tasks/redis.rake +3 -3
- metadata +154 -195
- data/bench/benchapp/tmp/pids/passenger.9292.pid.lock +0 -0
- data/bench/benchapp/tmp/restart.txt +0 -0
- data/bench/blobapp/settings/license.key.bak +0 -2
- data/bench/blobapp/tmp/restart.txt +0 -0
- data/bench/lib/testdata/1-data.txt +0 -0
- data/bench/lib/testdata/10-data.txt +0 -0
- data/bench/lib/testdata/2-data.txt +0 -0
- data/bench/lib/testdata/250-data.txt +0 -0
- data/bench/lib/testdata/5-blob_data.txt +0 -0
- data/bench/lib/testdata/5-data.txt +0 -0
- data/bench/lib/testdata/50-data.txt +0 -0
- data/bench/lib/testdata/500-data.txt +0 -0
- data/doc/protocol.html +0 -1993
- data/spec/coverage/rcov/assets/0.2.3/jquery-1.3.2.min.js +0 -19
- data/spec/coverage/rcov/assets/0.2.3/jquery.tablesorter.min.js +0 -15
- data/spec/coverage/rcov/assets/0.2.3/print.css +0 -12
- data/spec/coverage/rcov/assets/0.2.3/rcov.js +0 -42
- data/spec/coverage/rcov/assets/0.2.3/screen.css +0 -270
- data/spec/coverage/rcov/index.html +0 -88
- data/spec/generator/generator_spec_helper.rb +0 -9
@@ -3,59 +3,58 @@ require 'bench_spec_helper'
|
|
3
3
|
require 'benchapp/models/ruby/mock_adapter'
|
4
4
|
|
5
5
|
describe "MockAdapter" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
6
|
+
include_examples "BenchSpecHelper"
|
7
|
+
|
8
|
+
before(:each) do
|
9
|
+
@s_fields = {
|
10
|
+
:source_id => 1,
|
11
|
+
:name => 'SampleAdapter',
|
12
|
+
:url => 'http://example.com',
|
13
|
+
:login => 'testuser',
|
14
|
+
:password => 'testpass',
|
15
|
+
}
|
16
|
+
@s_params = {
|
17
|
+
:user_id => 'mock_user_id',
|
18
|
+
:app_id => 'mock_app_id'
|
19
|
+
}
|
20
|
+
@s = Source.create(@s_fields,@s_params)
|
21
|
+
@ma = MockAdapter.new(@s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should return db name" do
|
25
|
+
@ma.db_name.should == "test_db_storage:mock_app_id:mock_user_id"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should return db lock name" do
|
29
|
+
@ma.lock_name.should == "lock:test_db_storage:mock_app_id:mock_user_id"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should login" do
|
33
|
+
@ma.login.should == true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should query data from db" do
|
37
|
+
set_state(@ma.db_name => @data)
|
38
|
+
@ma.query.should == @data
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should create object in the db" do
|
42
|
+
@product1.merge!('mock_id'=>'1')
|
43
|
+
@ma.create(@product1).should == '1'
|
44
|
+
verify_result(@ma.db_name => {'1' => @product1})
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should update object in db" do
|
48
|
+
set_state(@ma.db_name => @data)
|
49
|
+
@ma.update('id' => '3','price' => '99.99')
|
50
|
+
@product3['price'] = '99.99'
|
51
|
+
verify_result(@ma.db_name => @data)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should delete object in db" do
|
55
|
+
set_state(@ma.db_name => @data)
|
56
|
+
del_object = {}.merge!(@product2).merge!('id'=>'2')
|
57
|
+
@ma.delete(del_object)
|
58
|
+
verify_result(@ma.db_name => {'1' => @product1, '3' => @product3})
|
59
|
+
end
|
61
60
|
end
|
@@ -2,64 +2,63 @@ $:.unshift File.join(File.dirname(__FILE__))
|
|
2
2
|
require 'bench_spec_helper'
|
3
3
|
|
4
4
|
describe "MockClient" do
|
5
|
-
|
6
|
-
it_behaves_like "BenchSpecHelper" do
|
7
|
-
before(:each) do
|
8
|
-
@mc = MockClient.new(1,2,123)
|
9
|
-
end
|
5
|
+
include_examples "BenchSpecHelper"
|
10
6
|
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
before(:each) do
|
8
|
+
@mc = MockClient.new(1,2,123)
|
9
|
+
end
|
14
10
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
11
|
+
it "should return document type" do
|
12
|
+
@mc.doc_type.should == "123:mock:cd"
|
13
|
+
end
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
15
|
+
it "should insert objects into the client document" do
|
16
|
+
@mc.insert(@data)
|
17
|
+
verify_result(@mc.doc_type => @data)
|
18
|
+
end
|
25
19
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
20
|
+
it "should delete objects from the client document" do
|
21
|
+
set_state(@mc.doc_type => @data)
|
22
|
+
@mc.delete('1' => @product1,'3' => @product3)
|
23
|
+
verify_result(@mc.doc_type => {'2' => @product2})
|
24
|
+
end
|
31
25
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
it "should verify state of the client document" do
|
27
|
+
set_state(@mc.doc_type => @data)
|
28
|
+
@mc.verify(@data).should == true
|
29
|
+
@mc.verify('1' => @product1,'3' => @product3).should == false
|
30
|
+
end
|
37
31
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
32
|
+
it "should parse server message and insert objects into the client document" do
|
33
|
+
message = [{:version => 3},{:token=>'123'},{:count=>3},{:progress_count=>0},{:total_count=>3},{:insert=>@data}].to_json
|
34
|
+
@mc.parse message
|
35
|
+
verify_result(@mc.doc_type => @data)
|
36
|
+
end
|
44
37
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
38
|
+
it "should parse server message and delete objects for the client document" do
|
39
|
+
set_state(@mc.doc_type => @data)
|
40
|
+
message = [{:version => 3},{:token=>'123'},{:count=>3},{:progress_count=>0},{:total_count=>3},{:delete=>{'2'=>@product2}}].to_json
|
41
|
+
@mc.parse message
|
42
|
+
verify_result(@mc.doc_type => {'1' => @product1,'3' => @product3})
|
43
|
+
end
|
52
44
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
it "should parse server message and insert/delete objects to/from client document" do
|
46
|
+
set_state(@mc.doc_type => {'1' => @product1,'2' => @product2})
|
47
|
+
message = [{:version => 3},{:token=>'123'},{:count=>3},{:progress_count=>0},{:total_count=>3},
|
48
|
+
{:insert=>{'3'=>@product3}},{:delete=>{'2'=>@product2}}].to_json
|
49
|
+
@mc.parse message
|
50
|
+
verify_result(@mc.doc_type => {'1' => @product1,'3' => @product3})
|
51
|
+
end
|
58
52
|
|
59
|
-
|
53
|
+
it "should raise exception on wrong message format" do
|
54
|
+
message = [{:version => 3},{:token=>'123'},{:count=>3},{:progress_count=>0}].to_json
|
55
|
+
lambda { @mc.parse message }.should raise_error(Exception,
|
56
|
+
'[T:001|I:002] Wrong message format. Message: "[{\"version\":3},{\"token\":\"123\"},{\"count\":3},{\"progress_count\":0}]"')
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should raise exception on wrong protocol version" do
|
60
60
|
message = [{:version => 1},{:token=>'123'},{:count=>3},{:progress_count=>0},{:total_count=>0},{}].to_json
|
61
61
|
lambda { @mc.parse message }.should raise_error(Exception,
|
62
62
|
'[T:001|I:002] Wrong protocol version. Message: "[{\"version\":1},{\"token\":\"123\"},{\"count\":3},{\"progress_count\":0},{\"total_count\":0},{}]"')
|
63
|
-
|
64
|
-
end
|
63
|
+
end
|
65
64
|
end
|
data/bench/spec/result_spec.rb
CHANGED
@@ -3,59 +3,56 @@ require 'bench_spec_helper'
|
|
3
3
|
require 'rest_client'
|
4
4
|
|
5
5
|
describe "ResultSpec" do
|
6
|
-
# it_should_behave_like "BenchSpecHelper"
|
7
|
-
|
8
6
|
include Utils
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
describe "test @last_response wrapper" do
|
23
|
-
|
24
|
-
it "should return 'code'" do
|
25
|
-
@result.code.should == 200
|
26
|
-
end
|
7
|
+
include_examples "BenchSpecHelper"
|
8
|
+
|
9
|
+
before(:each) do
|
10
|
+
@s1 = [{"foo" => {"bar" => "cake"}}]
|
11
|
+
@s2 = [{"foo" => {"bar" => "cake1"}},{"hello" => "world"}]
|
12
|
+
@result = Result.new("marker",:get,"some/url",0,1)
|
13
|
+
client = double("RestClient")
|
14
|
+
client.stub(:headers).and_return({'header1'=>'headervalue1'})
|
15
|
+
client.stub(:cookies).and_return({'session1'=>'sessval1'})
|
16
|
+
client.stub(:code).and_return(200)
|
17
|
+
client.stub(:to_s).and_return(@s1.to_json)
|
18
|
+
@result.last_response = client
|
19
|
+
end
|
27
20
|
|
28
|
-
|
29
|
-
JSON.parse(@result.body).should == @s1
|
30
|
-
end
|
21
|
+
describe "test @last_response wrapper" do
|
31
22
|
|
32
|
-
|
33
|
-
|
34
|
-
|
23
|
+
it "should return 'code'" do
|
24
|
+
@result.code.should == 200
|
25
|
+
end
|
35
26
|
|
36
|
-
|
37
|
-
|
38
|
-
|
27
|
+
it "should return 'body'" do
|
28
|
+
JSON.parse(@result.body).should == @s1
|
29
|
+
end
|
39
30
|
|
31
|
+
it "should return 'cookies'" do
|
32
|
+
@result.cookies.should == {'session1'=>'sessval1'}
|
40
33
|
end
|
41
34
|
|
42
|
-
it "
|
43
|
-
|
44
|
-
:path=>[0, "foo", "bar"], :actual=>"cake1"},
|
45
|
-
{:expected=>nil, :path=>[1], :actual=>{"hello"=>"world"}}]
|
35
|
+
it "shhould return 'headers'" do
|
36
|
+
@result.headers.should == {'header1'=>'headervalue1'}
|
46
37
|
end
|
47
38
|
|
48
|
-
|
49
|
-
@result.should_receive(:bench_log).exactly(8).times
|
50
|
-
@result.verify_body(@s2.to_json)
|
51
|
-
@result.verification_error.should == 1
|
52
|
-
end
|
39
|
+
end
|
53
40
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
41
|
+
it "should compare two array/hash structures" do
|
42
|
+
compare(:expected,@s1,:actual,@s2).should == [{:expected=>"cake",
|
43
|
+
:path=>[0, "foo", "bar"], :actual=>"cake1"},
|
44
|
+
{:expected=>nil, :path=>[1], :actual=>{"hello"=>"world"}}]
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should verify body" do
|
48
|
+
@result.should_receive(:bench_log).exactly(8).times
|
49
|
+
@result.verify_body(@s2.to_json)
|
50
|
+
@result.verification_error.should == 1
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should verify code" do
|
54
|
+
@result.should_receive(:bench_log).exactly(4).times
|
55
|
+
@result.verify_code(500)
|
56
|
+
@result.verification_error.should == 1
|
59
57
|
end
|
60
|
-
|
61
58
|
end
|
data/bench/spec/utils_spec.rb
CHANGED
@@ -2,35 +2,34 @@ $:.unshift File.join(File.dirname(__FILE__))
|
|
2
2
|
require 'bench_spec_helper'
|
3
3
|
|
4
4
|
describe "UtilsSpec" do
|
5
|
-
# it_should_behave_like "BenchSpecHelper"
|
6
5
|
include Utils
|
7
6
|
include Logging
|
8
7
|
|
9
|
-
|
10
|
-
it "should compare two identical hashes" do
|
11
|
-
h1 = {'key1' => {'key2' => 'value2'}}
|
12
|
-
h2 = {'key1' => {'key2' => 'value2'}}
|
13
|
-
compare(:expected,h1,:actual,h2).should == []
|
14
|
-
end
|
8
|
+
include_examples "BenchSpecHelper"
|
15
9
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
10
|
+
it "should compare two identical hashes" do
|
11
|
+
h1 = {'key1' => {'key2' => 'value2'}}
|
12
|
+
h2 = {'key1' => {'key2' => 'value2'}}
|
13
|
+
compare(:expected,h1,:actual,h2).should == []
|
14
|
+
end
|
22
15
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
it "should compare two different hashes" do
|
17
|
+
h1 = {'key1' => {'key2' => 'value2'}}
|
18
|
+
h2 = {'key1' => {'key2' => 'value3'}}
|
19
|
+
compare(:expected,h1,:actual,h2).should ==
|
20
|
+
[{:actual=>"value3", :path=>["key1", "key2"], :expected=>"value2"}]
|
21
|
+
end
|
29
22
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
23
|
+
it "should compare_and_log two identical hashes" do
|
24
|
+
h1 = {'key1' => {'key2' => 'value2'}}
|
25
|
+
h2 = {'key1' => {'key2' => 'value2'}}
|
26
|
+
Bench::Utils.should_not_receive(:bench_log)
|
27
|
+
compare_and_log(h1,h2,'the caller').should == 0
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should compare_and_log two different hashes" do
|
31
|
+
h1 = {'key1' => {'key2' => 'value2'}}
|
32
|
+
h2 = {'key1' => {'key2' => 'value3'}}
|
33
|
+
compare_and_log(h1,h2,'the caller').should == 1
|
34
|
+
end
|
36
35
|
end
|
data/commands/generators/app.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Execute.define_task do
|
2
|
-
desc "app NAME [
|
3
|
-
def app(name,platform=nil)
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
desc "app NAME [--js]", "Generate a new rhoconnect application"
|
3
|
+
def app(name, platform=nil)
|
4
|
+
# ARGV = [command, argument, ... option, ...]
|
5
|
+
ARGV.shift
|
6
|
+
invoke :app_generator
|
7
|
+
end
|
8
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
Execute.define_task do
|
2
|
-
desc "
|
3
|
-
def controller(name,platform='ruby')
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
desc "controller NAME [--js]", "Generate a new source adapter controller", :hide => true
|
3
|
+
def controller(name, platform='ruby')
|
4
|
+
# ARGV = [command, argument, ... option, ...]
|
5
|
+
ARGV.shift
|
6
|
+
invoke :controller_generator
|
7
|
+
end
|
8
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
Execute.define_task do
|
2
|
-
desc "
|
3
|
-
def model(name,platform='ruby')
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
desc "model NAME [--js]", "Generate a new source adapter model", :hide => true
|
3
|
+
def model(name, platform='ruby')
|
4
|
+
# ARGV = [command, argument, ... option, ...]
|
5
|
+
ARGV.shift
|
6
|
+
invoke :model_generator
|
7
|
+
end
|
8
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
Execute.define_task do
|
2
|
-
desc "source NAME [
|
3
|
-
def source(name,platform=nil)
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
desc "source NAME [--js]", "Generate a new source adapter"
|
3
|
+
def source(name, platform=nil)
|
4
|
+
# ARGV = [command, argument, ... option, ...]
|
5
|
+
ARGV.shift
|
6
|
+
invoke :source_generator
|
7
|
+
end
|
8
|
+
end
|
data/commands/parser.rb
CHANGED
@@ -134,7 +134,7 @@ end
|
|
134
134
|
|
135
135
|
# rhoconnect get-token|set-admin-password
|
136
136
|
module AdminCommands
|
137
|
-
def self.match?(input); input
|
137
|
+
def self.match?(input); input =~ /get[-_]token/ || input =~ /set[-_]admin[-_]password/; end
|
138
138
|
def self.execute(input)
|
139
139
|
require_relative '../commands/rhoconnect/config'
|
140
140
|
require_relative '../commands/rhoconnect/get_token'
|
data/doc/async-jobs.txt
CHANGED
@@ -12,21 +12,21 @@ RhoConnect supports three job types: BulkDataJob, PingJob, SourceJob
|
|
12
12
|
### PingJob
|
13
13
|
Ping jobs are used to execute a [device ping](/rhoconnect/push). A PingJob can be queued from anywhere in your RhoConnect application (i.e. at the end of another job or adapter query method).
|
14
14
|
|
15
|
-
Example:
|
16
|
-
|
15
|
+
Example:
|
16
|
+
|
17
17
|
:::ruby
|
18
18
|
Resque.enqueue(
|
19
19
|
PingJob,
|
20
20
|
{
|
21
21
|
"user_id" => current_user.login,
|
22
|
-
"message" => "New products available!",
|
23
|
-
"badge" => 1,
|
22
|
+
"message" => "New products available!",
|
23
|
+
"badge" => 1,
|
24
24
|
"sources" => ['Product']
|
25
25
|
}
|
26
26
|
)
|
27
27
|
|
28
28
|
### SourceJob
|
29
|
-
Source jobs are used to execute source adapter queues asynchronously.
|
29
|
+
Source jobs are used to execute source adapter queues asynchronously.
|
30
30
|
|
31
31
|
To make your source adapters always run asynchronously, define a queue in `settings/settings.yml`:
|
32
32
|
|
@@ -37,14 +37,14 @@ To make your source adapters always run asynchronously, define a queue in `setti
|
|
37
37
|
Then run a resque worker so the job will execute.
|
38
38
|
|
39
39
|
Example that queues a new source adapter job manually:
|
40
|
-
|
40
|
+
|
41
41
|
:::ruby
|
42
42
|
Resque.enqueue(
|
43
43
|
SourceJob,
|
44
44
|
:query,
|
45
45
|
APP_NAME,
|
46
46
|
'Joe',
|
47
|
-
'some-client-id
|
47
|
+
'some-client-id'
|
48
48
|
)
|
49
49
|
|
50
50
|
## Running Async Jobs
|
@@ -55,11 +55,11 @@ Running RhoConnect jobs requires one or more [resque](http://github.com/defunkt/
|
|
55
55
|
$ QUEUE=* rake resque:work
|
56
56
|
|
57
57
|
To start multiple workers(in this case 5):
|
58
|
-
|
58
|
+
|
59
59
|
:::term
|
60
60
|
$ cd <your rhoconnect app>
|
61
61
|
$ QUEUE=* COUNT=5 rake resque:workers
|
62
|
-
|
62
|
+
|
63
63
|
For more information on the options available when running resque workers, please refer to the [resque readme](https://github.com/defunkt/resque#readme).
|
64
64
|
|
65
65
|
If you want to run resque workers in daemon mode, we recommend using [nohup](http://en.wikipedia.org/wiki/Nohup), [god](http://github.com/defunkt/resque/tree/master/examples/god/), or [monit](http://github.com/defunkt/resque/tree/master/examples/monit):
|
data/doc/supported-platforms.txt
CHANGED
@@ -67,5 +67,3 @@ The components you should have for this environment are:
|
|
67
67
|
|
68
68
|
* Usually JDK is shipped with only weak encryption, and that simply will not allow the proper key sizes being created by openssl. RhoConnect uses strong encryption for license keys and to function properly in JRuby environment installation of Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction policy files might be required.
|
69
69
|
* Path to user’s gems, warbler data should not include white spaces (i.e. in user's account name).
|
70
|
-
|
71
|
-
|