slappy 0.5.0 → 0.5.1

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: 279a9dc258db912d4e7ed619595d66553ea75d69
4
- data.tar.gz: 1937de721354dba64d166128b34bad6b24726723
3
+ metadata.gz: 1b0b9c15815b3cf1132917f497bf462ac226e8ae
4
+ data.tar.gz: 6b56d7a4a85eaac4c46e988a6e2e5728058d6658
5
5
  SHA512:
6
- metadata.gz: 0ce87466b06fccd78a49e18e007dab3db1ec345e9c844437a05df2bc831a86ece70ebcb55cf00906a5312c7aa4b07a951216fc270500145066c819ce4388712c
7
- data.tar.gz: 2b85a23ac6d034c6c9dd623d6d61da941466ea652753ba9cdcd816cea73b78a903a0263f1dd4aec2da5bf7c89d44c7c593ae50030c85a802c14c35288a33411e
6
+ metadata.gz: fcba756785fa377ca2a3e65164edde9a1fea85f7ae66ac45bb5751e1a1fd5cb3372f1350e18702790ae0768d72f83add8bef188955b93e9d306a86f415c9cfe5
7
+ data.tar.gz: c27d86356d760e5a7fe3d1ea67b83b58a96758242eb2509d1e9eaf7b2a5703401df30c6b0772c8bb2d804f782c562e3cad7cab781742b5bf9d0b63510d1c5b25
data/README.md CHANGED
@@ -199,6 +199,9 @@ Slappy.start #=> Start WebSocket connection
199
199
 
200
200
  ## Release Note
201
201
 
202
+ - v0.5.1
203
+ - Fix monitor event disabled
204
+
202
205
  - v0.5.0
203
206
  - Support Schedule
204
207
  - Support Slack RMT Event
data/lib/slappy/client.rb CHANGED
@@ -30,9 +30,9 @@ module Slappy
30
30
  @callbacks[:message].push Listener::TextListener.new(pattern, block)
31
31
  end
32
32
 
33
- def monitor(subtype, &block)
34
- @callbacks[:message] ||= []
35
- @callbacks[:message].push Listener::SubtypeListener.new(subtype, block)
33
+ def monitor(type, &block)
34
+ @callbacks[type.to_sym] ||= []
35
+ @callbacks[type.to_sym].push Listener::TypeListener.new(type, block)
36
36
  end
37
37
 
38
38
  def say(text, options = {})
@@ -61,7 +61,7 @@ module Slappy
61
61
  case event_name
62
62
  when :hello
63
63
  listener.call
64
- when :message
64
+ else
65
65
  event = Event.new(data)
66
66
  listener.call(event)
67
67
  end
@@ -1,6 +1,7 @@
1
1
  require 'slappy/listeners/concerns/listenable'
2
2
  require 'slappy/listeners/base'
3
3
  require 'slappy/listeners/text_listener'
4
+ require 'slappy/listeners/type_listener'
4
5
  require 'slappy/listeners/subtype_listener'
5
6
 
6
7
  module Slappy
@@ -0,0 +1,6 @@
1
+ module Slappy
2
+ module Listener
3
+ class TypeListener < Base
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Slappy
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slappy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wakaba260
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-15 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slack-api
@@ -254,6 +254,7 @@ files:
254
254
  - lib/slappy/listeners/concerns/listenable.rb
255
255
  - lib/slappy/listeners/subtype_listener.rb
256
256
  - lib/slappy/listeners/text_listener.rb
257
+ - lib/slappy/listeners/type_listener.rb
257
258
  - lib/slappy/messanger.rb
258
259
  - lib/slappy/schedule.rb
259
260
  - lib/slappy/slack_api/base.rb