otstatus 0.2.1 → 0.2.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/otstatus.rb +8 -4
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a9f31d3c7b6e16c2f433696d113ca5828c9dcafd
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d89967af4ac327002ae74d44b3e5da54e6d465a5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 98a67064776b004bb1e27ee26578606a63d086841f5c7c01d4c35ad4d26b56ca5b9aaa126c47702ac39a0c67d4548875dadd5c5243f3a1550bed2d3b4d9ed2c7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 82a7f100f37b4360dba681d5c37e5b95039e2ba258318d42649e5b22edc1d806a5f9a38a82b50813fb70eb08afca6999ec2fedc021103e8b36dbb2327cb9252e
         
     | 
    
        data/lib/otstatus.rb
    CHANGED
    
    | 
         @@ -3,18 +3,20 @@ require 'eventmachine' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require 'nori'
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            module OtStatus
         
     | 
| 
       6 
     | 
    
         
            -
              VERSION = '0.2. 
     | 
| 
      
 6 
     | 
    
         
            +
              VERSION = '0.2.3'
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
              class Query
         
     | 
| 
       9 
9 
     | 
    
         
             
                attr_accessor :response
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                def initialize
         
     | 
| 
      
 11 
     | 
    
         
            +
                def initialize connect_timeout=5, inactivity_timeout=10
         
     | 
| 
       12 
12 
     | 
    
         
             
                  @response = nil
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @connect_timeout = connect_timeout
         
     | 
| 
      
 14 
     | 
    
         
            +
                  @inactivity_timeout = inactivity_timeout
         
     | 
| 
       13 
15 
     | 
    
         
             
                end
         
     | 
| 
       14 
16 
     | 
    
         | 
| 
       15 
17 
     | 
    
         
             
                def run hostname, port
         
     | 
| 
       16 
18 
     | 
    
         
             
                  EventMachine.run {
         
     | 
| 
       17 
     | 
    
         
            -
                    EventMachine::connect hostname, port, Connection, self
         
     | 
| 
      
 19 
     | 
    
         
            +
                    EventMachine::connect hostname, port, Connection, self, @connect_timeout, @inactivity_timeout
         
     | 
| 
       18 
20 
     | 
    
         
             
                  }
         
     | 
| 
       19 
21 
     | 
    
         | 
| 
       20 
22 
     | 
    
         
             
                  parse @response
         
     | 
| 
         @@ -31,8 +33,10 @@ module OtStatus 
     | 
|
| 
       31 
33 
     | 
    
         | 
| 
       32 
34 
     | 
    
         
             
                  attr_reader :query
         
     | 
| 
       33 
35 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
                  def initialize query
         
     | 
| 
      
 36 
     | 
    
         
            +
                  def initialize query, connect_timeout, inactivity_timeout
         
     | 
| 
       35 
37 
     | 
    
         
             
                    @query = query
         
     | 
| 
      
 38 
     | 
    
         
            +
                    self.pending_connect_timeout = connect_timeout
         
     | 
| 
      
 39 
     | 
    
         
            +
                    self.comm_inactivity_timeout = inactivity_timeout
         
     | 
| 
       36 
40 
     | 
    
         
             
                  end
         
     | 
| 
       37 
41 
     | 
    
         | 
| 
       38 
42 
     | 
    
         
             
                  def post_init
         
     |