redact 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
 - data/lib/redact.rb +8 -4
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9f859024a006575309d7d616e5a1c996e5c1e79c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6ef60e3ad77160e2d22a1d538f71f10be6043962
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 68805e7ee55892d4898e57ee98fb51307297090b7b4de6d444c98f21c05a3e388cb301b54bd6394e2ef3accf4594f5dc46f38f439836b143dcf6e5245b7b5ba5
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 77ad7358b7ce73b0f90397c4fbf4a69842f2d1bdeeba74fa1346241e005c7ac17b594cfbd74d6832635e4ef6e25bb9732a62eedc48a6dd526a1428da9d0944a6
         
     | 
    
        data/lib/redact.rb
    CHANGED
    
    | 
         @@ -151,18 +151,22 @@ class Redact 
     | 
|
| 
       151 
151 
     | 
    
         
             
              ##
         
     | 
| 
       152 
152 
     | 
    
         
             
              ## +opts+ are:
         
     | 
| 
       153 
153 
     | 
    
         
             
              ## * +blocking+: if true, #each will block until items are available (and will never return)
         
     | 
| 
      
 154 
     | 
    
         
            +
              ## * +block_timeout+: when +blocking+ is true, the timeout (in seconds) before stopping. A value of nil or 0 will block forever.
         
     | 
| 
       154 
155 
     | 
    
         
             
              ## * +retries+: how many times an individual job should be retried before resulting in an error state. Default is 2 (so 3 tries total).
         
     | 
| 
       155 
156 
     | 
    
         
             
              ## * +worker_id+: the id of this worker process, for debugging. (If nil, will use a reasonably intelligent default.)
         
     | 
| 
       156 
157 
     | 
    
         
             
              def each opts={}
         
     | 
| 
       157 
158 
     | 
    
         
             
                worker_id = opts[:worker_id] || [Socket.gethostname, $$, $0].join("-")
         
     | 
| 
       158 
159 
     | 
    
         
             
                retries = opts[:retries] || 2
         
     | 
| 
       159 
160 
     | 
    
         
             
                blocking = opts[:blocking]
         
     | 
| 
      
 161 
     | 
    
         
            +
                block_timeout = opts[:block_timeout] || 0
         
     | 
| 
       160 
162 
     | 
    
         | 
| 
       161 
163 
     | 
    
         
             
                while true
         
     | 
| 
       162 
     | 
    
         
            -
                   
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
                   
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
      
 164 
     | 
    
         
            +
                  token = if blocking
         
     | 
| 
      
 165 
     | 
    
         
            +
                    @redis.brpoplpush @queue, @processing_list, block_timeout
         
     | 
| 
      
 166 
     | 
    
         
            +
                  else
         
     | 
| 
      
 167 
     | 
    
         
            +
                    @redis.rpoplpush @queue, @processing_list
         
     | 
| 
      
 168 
     | 
    
         
            +
                  end
         
     | 
| 
      
 169 
     | 
    
         
            +
                  break unless token # no more tokens!
         
     | 
| 
       166 
170 
     | 
    
         | 
| 
       167 
171 
     | 
    
         
             
                  ## decompose the token
         
     | 
| 
       168 
172 
     | 
    
         
             
                  task, target, run_id, insertion_time = parse_token token
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: redact
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - William Morgan
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-10-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: trollop
         
     |