rhoconnect 3.3.3 → 3.3.4
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.
- data/CHANGELOG.md +3 -0
 - data/Gemfile.lock +2 -2
 - data/README.md +50 -7
 - data/lib/rhoconnect/store.rb +7 -11
 - data/lib/rhoconnect/version.rb +1 -1
 - data/spec/store_spec.rb +2 -0
 - metadata +623 -635
 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                rhoconnect (3.3. 
     | 
| 
      
 4 
     | 
    
         
            +
                rhoconnect (3.3.4)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  bundler (~> 1.0)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  json (~> 1.6.0)
         
     | 
| 
       7 
7 
     | 
    
         
             
                  rake (~> 0.9.2.2)
         
     | 
| 
         @@ -65,7 +65,7 @@ GEM 
     | 
|
| 
       65 
65 
     | 
    
         
             
                  cabin (~> 0.4.3)
         
     | 
| 
       66 
66 
     | 
    
         
             
                  clamp (= 0.3.1)
         
     | 
| 
       67 
67 
     | 
    
         
             
                  json (= 1.6.6)
         
     | 
| 
       68 
     | 
    
         
            -
                highline (1.6. 
     | 
| 
      
 68 
     | 
    
         
            +
                highline (1.6.14)
         
     | 
| 
       69 
69 
     | 
    
         
             
                hike (1.2.1)
         
     | 
| 
       70 
70 
     | 
    
         
             
                jasmine (1.2.1)
         
     | 
| 
       71 
71 
     | 
    
         
             
                  jasmine-core (>= 1.2.0)
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -2,13 +2,56 @@ RhoConnect App Integration Server 
     | 
|
| 
       2 
2 
     | 
    
         
             
            -------------------------------------------------------------
         
     | 
| 
       3 
3 
     | 
    
         
             
            RhoConnect is an app integration server which keeps enterprise data current and available on users’ devices.
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            Prerequisites
         
     | 
| 
      
 5 
     | 
    
         
            +
            Development Prerequisites
         
     | 
| 
       6 
6 
     | 
    
         
             
            -------------------------------------------------------------
         
     | 
| 
       7 
     | 
    
         
            -
            You will need to install the  
     | 
| 
      
 7 
     | 
    
         
            +
            You will need to install the following in order to run the RhoConnect specs.
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 9 
     | 
    
         
            +
            * QT: <http://qt.nokia.com/downloads>
         
     | 
| 
      
 10 
     | 
    
         
            +
            * RVM: <https://rvm.io/> or RB-env: <https://github.com/sstephenson/rbenv> with Ruby 1.9.3p194+ installed
         
     | 
| 
      
 11 
     | 
    
         
            +
            * Bundler: <http://gembundler.com/>
         
     | 
| 
      
 12 
     | 
    
         
            +
            * Redis: <http://redis.io>
         
     | 
| 
      
 13 
     | 
    
         
            +
            * Java JDK 1.6+: <http://www.oracle.com/technetwork/java/javase/downloads/index.html>
         
     | 
| 
      
 14 
     | 
    
         
            +
            * hsqldata.jar: <https://github.com/rhomobile/hsqldata/downloads> - put this in a directory called vendor/
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            Running Tests
         
     | 
| 
      
 17 
     | 
    
         
            +
            -------------------------------------------------------------
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            * Install dependencies
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            ```
         
     | 
| 
      
 22 
     | 
    
         
            +
            $ bundle install
         
     | 
| 
      
 23 
     | 
    
         
            +
            ```
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            * Start redis (assumes it is installed in /usr/local/bin)
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            ```
         
     | 
| 
      
 28 
     | 
    
         
            +
            $ rake redis:start
         
     | 
| 
      
 29 
     | 
    
         
            +
            ```
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            * Run RhoConnect specs
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            ```
         
     | 
| 
      
 34 
     | 
    
         
            +
            $ rake spec
         
     | 
| 
      
 35 
     | 
    
         
            +
            ```
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            You will see a lot of output including backtraces as negative tests produce exceptions that print to stdout.  This is normal.  At the end you should see something like the following:
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            <pre>
         
     | 
| 
      
 40 
     | 
    
         
            +
            Finished in 47.47 seconds
         
     | 
| 
      
 41 
     | 
    
         
            +
            543 examples, 0 failures
         
     | 
| 
      
 42 
     | 
    
         
            +
            ...
         
     | 
| 
      
 43 
     | 
    
         
            +
            Running Jasmine specs...
         
     | 
| 
      
 44 
     | 
    
         
            +
            .........................................
         
     | 
| 
      
 45 
     | 
    
         
            +
            PASS: 41 tests, 0 failures, 0.05 secs.
         
     | 
| 
      
 46 
     | 
    
         
            +
            </pre>
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            If you have 0 failures, everything is good!
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            Test Layout
         
     | 
| 
      
 51 
     | 
    
         
            +
            -------------------------------------------------------------
         
     | 
| 
      
 52 
     | 
    
         
            +
            RhoConnect uses the [RSpec](https://www.relishapp.com/rspec/) framework to implement tests.  All tests are located in the `spec/` directory.  Tests use the following file naming convention: `classname_spec.rb` where `classname` is the class under test (i.e. `server_spec.rb` tests the `Server` class).
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            Resources
         
     | 
| 
       10 
55 
     | 
    
         
             
            -------------------------------------------------------------
         
     | 
| 
       11 
     | 
    
         
            -
              *  
     | 
| 
       12 
     | 
    
         
            -
              *  
     | 
| 
       13 
     | 
    
         
            -
              * Tutorial:                  		<http://docs.rhomobile.com/rhoconnect/tutorial> 
         
     | 
| 
       14 
     | 
    
         
            -
              * RDoc (still rough):        		<http://rdoc.info/projects/rhomobile/rhoconnect>
         
     | 
| 
      
 56 
     | 
    
         
            +
              * RhoConnect:	<http://docs.rhomobile.com/rhoconnect/introduction>
         
     | 
| 
      
 57 
     | 
    
         
            +
              * Tutorial:   <http://docs.rhomobile.com/rhoconnect/tutorial> 
         
     | 
    
        data/lib/rhoconnect/store.rb
    CHANGED
    
    | 
         @@ -364,12 +364,10 @@ module Rhoconnect 
     | 
|
| 
       364 
364 
     | 
    
         
             
                    current_score_data = Store.db.zrevrange(dockey,0,0,:with_scores => true)
         
     | 
| 
       365 
365 
     | 
    
         
             
                    current_score = current_score_data[-1].to_i if current_score_data
         
     | 
| 
       366 
366 
     | 
    
         
             
                    current_score += 1
         
     | 
| 
       367 
     | 
    
         
            -
                     
     | 
| 
       368 
     | 
    
         
            -
                       
     | 
| 
       369 
     | 
    
         
            -
             
     | 
| 
       370 
     | 
    
         
            -
             
     | 
| 
       371 
     | 
    
         
            -
                        Store.put_data(unique_record_key,{key => hash_value})
         
     | 
| 
       372 
     | 
    
         
            -
                      end
         
     | 
| 
      
 367 
     | 
    
         
            +
                    data.each do |key,hash_value|
         
     | 
| 
      
 368 
     | 
    
         
            +
                      unique_record_key = setelement(current_score,assoc_key, key)
         
     | 
| 
      
 369 
     | 
    
         
            +
                      Store.db.zadd(dockey, current_score, unique_record_key)
         
     | 
| 
      
 370 
     | 
    
         
            +
                      Store.put_data("#{dockey}:#{unique_record_key}",{key => hash_value})
         
     | 
| 
       373 
371 
     | 
    
         
             
                    end
         
     | 
| 
       374 
372 
     | 
    
         
             
                    true
         
     | 
| 
       375 
373 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -382,7 +380,7 @@ module Rhoconnect 
     | 
|
| 
       382 
380 
     | 
    
         
             
                    unless data.nil?
         
     | 
| 
       383 
381 
     | 
    
         
             
                      scores = []
         
     | 
| 
       384 
382 
     | 
    
         
             
                      data.each do |zsetkey|
         
     | 
| 
       385 
     | 
    
         
            -
                        obj_hash = Store.get_data zsetkey
         
     | 
| 
      
 383 
     | 
    
         
            +
                        obj_hash = Store.get_data "#{dockey}:#{zsetkey}"
         
     | 
| 
       386 
384 
     | 
    
         
             
                        score,key,objkey = getelement(zsetkey)
         
     | 
| 
       387 
385 
     | 
    
         
             
                        if scores[-1] != score
         
     | 
| 
       388 
386 
     | 
    
         
             
                          ret << obj_hash
         
     | 
| 
         @@ -399,10 +397,8 @@ module Rhoconnect 
     | 
|
| 
       399 
397 
     | 
    
         
             
                  # Deletes all keys and their hashes from the Redis DB
         
     | 
| 
       400 
398 
     | 
    
         
             
                  def flush_zdata(dockey)
         
     | 
| 
       401 
399 
     | 
    
         
             
                    data = Store.db.zrange(dockey, 0, -1)
         
     | 
| 
       402 
     | 
    
         
            -
                     
     | 
| 
       403 
     | 
    
         
            -
                       
     | 
| 
       404 
     | 
    
         
            -
                        Store.db.del(hash_key)
         
     | 
| 
       405 
     | 
    
         
            -
                      end
         
     | 
| 
      
 400 
     | 
    
         
            +
                    data.each do |hash_key|
         
     | 
| 
      
 401 
     | 
    
         
            +
                      _delete_doc("#{dockey}:#{hash_key}")
         
     | 
| 
       406 
402 
     | 
    
         
             
                    end
         
     | 
| 
       407 
403 
     | 
    
         
             
                    Store.db.zremrangebyrank(dockey, 0, -1)
         
     | 
| 
       408 
404 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/rhoconnect/version.rb
    CHANGED
    
    
    
        data/spec/store_spec.rb
    CHANGED