message_router 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.
- data/lib/message_router/router.rb +4 -4
 - data/lib/message_router/version.rb +1 -1
 - data/spec/message_router_spec.rb +1 -1
 - metadata +3 -3
 
| 
         @@ -18,7 +18,7 @@ class MessageRouter 
     | 
|
| 
       18 
18 
     | 
    
         
             
              #
         
     | 
| 
       19 
19 
     | 
    
         
             
              #       # Matches if the first word of env['body'] is PING (case insensitive).
         
     | 
| 
       20 
20 
     | 
    
         
             
              #       # Overwrite #default_attribute in your router to match against a
         
     | 
| 
       21 
     | 
    
         
            -
              #       # different  
     | 
| 
      
 21 
     | 
    
         
            +
              #       # different value.
         
     | 
| 
       22 
22 
     | 
    
         
             
              #       match 'ping' do
         
     | 
| 
       23 
23 
     | 
    
         
             
              #         PingCounter.increment!
         
     | 
| 
       24 
24 
     | 
    
         
             
              #         send_reply 'pong', env
         
     | 
| 
         @@ -26,7 +26,7 @@ class MessageRouter 
     | 
|
| 
       26 
26 
     | 
    
         
             
              #
         
     | 
| 
       27 
27 
     | 
    
         
             
              #       # Matches if env['body'] matches the given Regexp.
         
     | 
| 
       28 
28 
     | 
    
         
             
              #       # Overwrite #default_attribute in your router to match against a
         
     | 
| 
       29 
     | 
    
         
            -
              #       # different  
     | 
| 
      
 29 
     | 
    
         
            +
              #       # different value.
         
     | 
| 
       30 
30 
     | 
    
         
             
              #       match /\Ahelp/i do
         
     | 
| 
       31 
31 
     | 
    
         
             
              #         SupportQueue.contact_asap(env['from'])
         
     | 
| 
       32 
32 
     | 
    
         
             
              #         send_reply 'Looks like you need some help. Hold tight someone will call you soon.', env
         
     | 
| 
         @@ -277,7 +277,7 @@ class MessageRouter 
     | 
|
| 
       277 
277 
     | 
    
         | 
| 
       278 
278 
     | 
    
         
             
                  case should_i
         
     | 
| 
       279 
279 
     | 
    
         
             
                  when Regexp, String
         
     | 
| 
       280 
     | 
    
         
            -
                     
     | 
| 
      
 280 
     | 
    
         
            +
                    Proc.new { attr_matches? default_attribute, should_i }
         
     | 
| 
       281 
281 
     | 
    
         | 
| 
       282 
282 
     | 
    
         
             
                  when TrueClass, FalseClass, NilClass
         
     | 
| 
       283 
283 
     | 
    
         
             
                    Proc.new { should_i }
         
     | 
| 
         @@ -322,7 +322,7 @@ class MessageRouter 
     | 
|
| 
       322 
322 
     | 
    
         
             
                end
         
     | 
| 
       323 
323 
     | 
    
         | 
| 
       324 
324 
     | 
    
         
             
                def default_attribute
         
     | 
| 
       325 
     | 
    
         
            -
                  'body'
         
     | 
| 
      
 325 
     | 
    
         
            +
                  env['body']
         
     | 
| 
       326 
326 
     | 
    
         
             
                end
         
     | 
| 
       327 
327 
     | 
    
         
             
              end
         
     | 
| 
       328 
328 
     | 
    
         
             
            end
         
     | 
    
        data/spec/message_router_spec.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: message_router
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 29
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 1
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 3
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.1.3
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - Brad Gessler
         
     |