rbchannels 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 75e4fdd59a5b274b544e6b2a0a764d250bde4894
4
- data.tar.gz: 2a11af3146235dbd2dc555f73c1c548ad97c321f
2
+ SHA256:
3
+ metadata.gz: '019717f035eb18113901174c674eeee0b6a9eaed1b677161885403e8b5b822d1'
4
+ data.tar.gz: 8b81e2bb0b6d59dfb900ac0aa2c21e3041cbe69521ff9026713fe40f6d3a87a0
5
5
  SHA512:
6
- metadata.gz: 3fd9d224ec759b0ae9ba4e8cf0f887dbba02a7503677dba37552ecc91a27162898b4ec9fe80197c20be8057e7f17655ffd827aa9b1ea0c7b0d1f7fdbae6c9586
7
- data.tar.gz: e22fdf2da42c63142b9a2982f6cb8761c5c29e2e40cdab671edbd636b5f1e4a9575abe94cfd50534eab6cbc91eaeec54699e80ef5faa5eca4fba43bdf0ebd87c
6
+ metadata.gz: 8c7a12b60b157d849628ae1cff704bbc4f63dd2aa88cc273f353295926071ae49fcca2fbcc9093bd027a17ce97ea190056f51c6cebfe5ec61b9c0ef5774efe07
7
+ data.tar.gz: 2818ae80442b7828395bec57cfc9884987733e302cc4c1f2bdbe210ab343db281c06efbff5de5828b1c3b1fc3fbcfccab7760f78d08b7d40b89955a22fce290b
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Channels
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
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.1.0
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: 2019-01-31 00:00:00.000000000 Z
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
- rubyforge_project:
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