rbchannels 1.1.0 → 1.2.0
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 +5 -5
 - data/lib/rbchannels.rb +40 -11
 - data/lib/rbchannels/version.rb +1 -1
 - metadata +3 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: '019717f035eb18113901174c674eeee0b6a9eaed1b677161885403e8b5b822d1'
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 8b81e2bb0b6d59dfb900ac0aa2c21e3041cbe69521ff9026713fe40f6d3a87a0
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8c7a12b60b157d849628ae1cff704bbc4f63dd2aa88cc273f353295926071ae49fcca2fbcc9093bd027a17ce97ea190056f51c6cebfe5ec61b9c0ef5774efe07
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2818ae80442b7828395bec57cfc9884987733e302cc4c1f2bdbe210ab343db281c06efbff5de5828b1c3b1fc3fbcfccab7760f78d08b7d40b89955a22fce290b
         
     | 
    
        data/lib/rbchannels.rb
    CHANGED
    
    | 
         @@ -23,10 +23,34 @@ class Channels::Client 
     | 
|
| 
       23 
23 
     | 
    
         
             
                end
         
     | 
| 
       24 
24 
     | 
    
         
             
              end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
      
 26 
     | 
    
         
            +
              def toggle_mute
         
     | 
| 
      
 27 
     | 
    
         
            +
                command('toggle_mute')
         
     | 
| 
      
 28 
     | 
    
         
            +
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              def toggle_cc
         
     | 
| 
      
 31 
     | 
    
         
            +
                command('toggle_cc')
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              def channel_up
         
     | 
| 
      
 35 
     | 
    
         
            +
                command('channel_up')
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              def channel_down
         
     | 
| 
      
 39 
     | 
    
         
            +
                command('channel_down')
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              def previous_channel
         
     | 
| 
      
 43 
     | 
    
         
            +
                command('previous_channel')
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
       26 
46 
     | 
    
         
             
              def toggle_pause
         
     | 
| 
       27 
47 
     | 
    
         
             
                command('toggle_pause')
         
     | 
| 
       28 
48 
     | 
    
         
             
              end
         
     | 
| 
       29 
49 
     | 
    
         | 
| 
      
 50 
     | 
    
         
            +
              def toggle_record
         
     | 
| 
      
 51 
     | 
    
         
            +
                command('toggle_record')
         
     | 
| 
      
 52 
     | 
    
         
            +
              end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       30 
54 
     | 
    
         
             
              def pause
         
     | 
| 
       31 
55 
     | 
    
         
             
                command('pause')
         
     | 
| 
       32 
56 
     | 
    
         
             
              end
         
     | 
| 
         @@ -59,10 +83,6 @@ class Channels::Client 
     | 
|
| 
       59 
83 
     | 
    
         
             
                command('skip_backward')
         
     | 
| 
       60 
84 
     | 
    
         
             
              end
         
     | 
| 
       61 
85 
     | 
    
         | 
| 
       62 
     | 
    
         
            -
              def previous_channel
         
     | 
| 
       63 
     | 
    
         
            -
                command('previous_channel')
         
     | 
| 
       64 
     | 
    
         
            -
              end
         
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
86 
     | 
    
         
             
              def toggle_mute
         
     | 
| 
       67 
87 
     | 
    
         
             
                command('toggle_mute')
         
     | 
| 
       68 
88 
     | 
    
         
             
              end
         
     | 
| 
         @@ -75,20 +95,29 @@ class Channels::Client 
     | 
|
| 
       75 
95 
     | 
    
         
             
                command("play/recording/#{recording_id}")
         
     | 
| 
       76 
96 
     | 
    
         
             
              end
         
     | 
| 
       77 
97 
     | 
    
         | 
| 
      
 98 
     | 
    
         
            +
              def navigate(section)
         
     | 
| 
      
 99 
     | 
    
         
            +
                command("navigate/#{URI::encode(section)}")
         
     | 
| 
      
 100 
     | 
    
         
            +
              end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
              def notify(title, message)
         
     | 
| 
      
 103 
     | 
    
         
            +
                data = {title: title, message: message}
         
     | 
| 
      
 104 
     | 
    
         
            +
                command("notify", data)
         
     | 
| 
      
 105 
     | 
    
         
            +
              end
         
     | 
| 
       78 
106 
     | 
    
         | 
| 
       79 
107 
     | 
    
         
             
              private
         
     | 
| 
       80 
108 
     | 
    
         | 
| 
       81 
     | 
    
         
            -
              def request(method, path)
         
     | 
| 
      
 109 
     | 
    
         
            +
              def request(method, path, data=nil)
         
     | 
| 
      
 110 
     | 
    
         
            +
                headers = {"Content-Type": "application/json", "Accept": "application/json"}
         
     | 
| 
       82 
111 
     | 
    
         
             
                begin
         
     | 
| 
       83 
112 
     | 
    
         
             
                  case method
         
     | 
| 
       84 
113 
     | 
    
         
             
                  when "GET"
         
     | 
| 
       85 
     | 
    
         
            -
                    response = self.class.get(path)
         
     | 
| 
      
 114 
     | 
    
         
            +
                    response = self.class.get(path, headers: headers)
         
     | 
| 
       86 
115 
     | 
    
         
             
                  when "POST"
         
     | 
| 
       87 
     | 
    
         
            -
                    response = self.class.post(path)
         
     | 
| 
      
 116 
     | 
    
         
            +
                    response = self.class.post(path, {body: data.to_json, headers: headers})
         
     | 
| 
       88 
117 
     | 
    
         
             
                  when "PUT"
         
     | 
| 
       89 
     | 
    
         
            -
                    response = self.class.put(path)
         
     | 
| 
      
 118 
     | 
    
         
            +
                    response = self.class.put(path, body: data.to_json, headers: headers)
         
     | 
| 
       90 
119 
     | 
    
         
             
                  when "DELETE"
         
     | 
| 
       91 
     | 
    
         
            -
                    response = self.class.delete(path)
         
     | 
| 
      
 120 
     | 
    
         
            +
                    response = self.class.delete(path, headers: headers)
         
     | 
| 
       92 
121 
     | 
    
         
             
                  end
         
     | 
| 
       93 
122 
     | 
    
         | 
| 
       94 
123 
     | 
    
         
             
                  if response
         
     | 
| 
         @@ -101,8 +130,8 @@ class Channels::Client 
     | 
|
| 
       101 
130 
     | 
    
         
             
                end
         
     | 
| 
       102 
131 
     | 
    
         
             
              end
         
     | 
| 
       103 
132 
     | 
    
         | 
| 
       104 
     | 
    
         
            -
              def command(named_command)
         
     | 
| 
       105 
     | 
    
         
            -
                return request('POST', '/' + named_command)
         
     | 
| 
      
 133 
     | 
    
         
            +
              def command(named_command, data=nil)
         
     | 
| 
      
 134 
     | 
    
         
            +
                return request('POST', '/' + named_command, data)
         
     | 
| 
       106 
135 
     | 
    
         
             
              end
         
     | 
| 
       107 
136 
     | 
    
         | 
| 
       108 
137 
     | 
    
         
             
            end
         
     | 
    
        data/lib/rbchannels/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rbchannels
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jon Maddox
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-08-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: httparty
         
     | 
| 
         @@ -52,8 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       52 
52 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       53 
53 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       54 
54 
     | 
    
         
             
            requirements: []
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
            rubygems_version: 2.6.13
         
     | 
| 
      
 55 
     | 
    
         
            +
            rubygems_version: 3.1.2
         
     | 
| 
       57 
56 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       58 
57 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       59 
58 
     | 
    
         
             
            summary: API client for the Channels app - https://getchannels.com
         
     |