lita-onewheel-automatic-pancake 0.3.1 → 0.5.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
2
  SHA1:
3
- metadata.gz: ca9b1d3a2fb1906682cd7961afd7116c92aa52f7
4
- data.tar.gz: b8dad0867fee0be61b5bf7e0b3c5aea117a3a57c
3
+ metadata.gz: db3891496d832ccf555804df3ef93200b22811de
4
+ data.tar.gz: 2bf7c20e89560c609b21912f7412f685cb57acc7
5
5
  SHA512:
6
- metadata.gz: d26381a4409e97749e72b91c3df442a1219f447b01e334e40a38f84e80b0246e3094514c555bf47974458044de7048ec9d2a4278e4a1283b9956b200abcca98a
7
- data.tar.gz: 711ee690b9d231a5fb642f7711e7575a0cbc4df80ff623c9f81c9e3aea995694bb5bfe8479108036a82662ed400e5911f014ecc8ac5dd352885705a56fd0a19d
6
+ metadata.gz: 82dc00d92daf3d6b74eeefee53e80049f77cd1841c1d470b2227d095b1debf7bfe6fe703deb8292e2dacbb953b730c240e0b9435b98acbecc0ac12497f3c10ee
7
+ data.tar.gz: 3152cbb36ca20acec81d79fa41173fc28f12fe1738332eec545ee2b10f7a9f03ce3c37899b8520886831825d2c2a5a6fa9711fbe4c61e4eb39acb6b41df2ae6b
@@ -25,6 +25,11 @@ module Lita
25
25
  command: true,
26
26
  help: {'vol down' => 'Turn it down!'}
27
27
 
28
+ route /^vol (\d+)/i,
29
+ :vol_change,
30
+ command: true,
31
+ help: {'vol 80%' => 'Set volume to 80%.'}
32
+
28
33
  route /^playtube (.*)$/i,
29
34
  :youtube,
30
35
  command: true,
@@ -46,11 +51,19 @@ module Lita
46
51
  end
47
52
 
48
53
  def vol_up(response)
49
- RestClient.post "#{config.pancake_server}/vol/up", {}
54
+ 3.times do |i|
55
+ RestClient.post "#{config.pancake_server}/vol/up", {}
56
+ end
50
57
  end
51
58
 
52
59
  def vol_down(response)
53
- RestClient.post "#{config.pancake_server}/vol/down", {}
60
+ 3.times do |i|
61
+ RestClient.post "#{config.pancake_server}/vol/down", {}
62
+ end
63
+ end
64
+
65
+ def vol_change(response)
66
+ RestClient.post "#{config.pancake_server}/vol/#{response.matches[0][0]}", {}
54
67
  end
55
68
 
56
69
  def youtube(response)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-automatic-pancake'
3
- spec.version = '0.3.1'
3
+ spec.version = '0.5.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to Automatic Pancake.}
@@ -2,6 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe Lita::Handlers::OnewheelAutomaticPancake, lita_handler: true do
4
4
  it { is_expected.to route_command('play x') }
5
+ it { is_expected.to route_command('playtube x') }
6
+ it { is_expected.to route_command('vol up') }
7
+ it { is_expected.to route_command('vol down') }
8
+ it { is_expected.to route_command('vol 50') }
5
9
 
6
10
  # before do
7
11
  # mock = File.open('spec/fixtures/baileys.html').read
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-automatic-pancake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita