viaduct-webpush 1.0.2 → 1.0.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/viaduct/web_push.rb +2 -2
 - data/lib/viaduct/web_push/channel.rb +9 -0
 - 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: 5bd894fea39bb8ad5d5f82a3fbf241fa44f2d1b7
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3cd260918918a5f47716bdf2fce2a0e7bcbfd26b
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 305429ca69ea43580da39e84854414c1bdeae1d212f6d6933d696b15de29913b02b89584bd7822ec565d0900e8bf49b5982cf33e8e72402706e19bc90d676245
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 10d37a1a0e1743474b9dcc06d38e19cd4ec2a37d22fb20607c1d644f529578bba3d5ce03b057da3c73356af1e11cba600843921415487555efd54ad08fd55c21
         
     | 
    
        data/lib/viaduct/web_push.rb
    CHANGED
    
    | 
         @@ -21,14 +21,14 @@ module Viaduct 
     | 
|
| 
       21 
21 
     | 
    
         
             
                  # Return the application token
         
     | 
| 
       22 
22 
     | 
    
         
             
                  #
         
     | 
| 
       23 
23 
     | 
    
         
             
                  def token
         
     | 
| 
       24 
     | 
    
         
            -
                    @token || ENV['WEBPUSH_TOKEN'] || raise(Error, "Must set ` 
     | 
| 
      
 24 
     | 
    
         
            +
                    @token || ENV['WEBPUSH_TOKEN'] || raise(Error, "Must set `Viaduct::WebPush.token` to an application token")
         
     | 
| 
       25 
25 
     | 
    
         
             
                  end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
                  #
         
     | 
| 
       28 
28 
     | 
    
         
             
                  # Return the application secret
         
     | 
| 
       29 
29 
     | 
    
         
             
                  #
         
     | 
| 
       30 
30 
     | 
    
         
             
                  def secret
         
     | 
| 
       31 
     | 
    
         
            -
                    @secret || ENV['WEBPUSH_SECRET'] || raise(Error, "Must set ` 
     | 
| 
      
 31 
     | 
    
         
            +
                    @secret || ENV['WEBPUSH_SECRET'] || raise(Error, "Must set `Viaduct::WebPush.secret` to an application secret")
         
     | 
| 
       32 
32 
     | 
    
         
             
                  end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                  #
         
     | 
| 
         @@ -13,6 +13,15 @@ module Viaduct 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    self.class.trigger(@name, event, data)
         
     | 
| 
       14 
14 
     | 
    
         
             
                  end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
      
 16 
     | 
    
         
            +
                  #
         
     | 
| 
      
 17 
     | 
    
         
            +
                  # Trigger an event on the channel in its own thread
         
     | 
| 
      
 18 
     | 
    
         
            +
                  #
         
     | 
| 
      
 19 
     | 
    
         
            +
                  def trigger!(event, data = {})
         
     | 
| 
      
 20 
     | 
    
         
            +
                    Thread.new do
         
     | 
| 
      
 21 
     | 
    
         
            +
                      self.class.trigger(@name, event, data)
         
     | 
| 
      
 22 
     | 
    
         
            +
                    end
         
     | 
| 
      
 23 
     | 
    
         
            +
                  end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       16 
25 
     | 
    
         
             
                  #
         
     | 
| 
       17 
26 
     | 
    
         
             
                  # Trigger a single even on a given channel
         
     | 
| 
       18 
27 
     | 
    
         
             
                  #
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: viaduct-webpush
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Adam Cooke
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-12-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: json
         
     |