slack-ruby-bot 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e767ee739a4eb2e86b7b03affd315f7d20fdc866
4
- data.tar.gz: 5123671ea14bf10c590955d6a2391b436d3578bf
3
+ metadata.gz: 93e28531585979bbfc53dcd7888817707e93e1fd
4
+ data.tar.gz: e43ec17a2e9b0b674cf084ce6f53d270e9658cfe
5
5
  SHA512:
6
- metadata.gz: d13566b081e81835c685886917ba096bc0ec3c525287feab3ca50c6691f48139710ed4d0fb65c7e7369aee9a8608d83099f5e14b28c8a7d3fe5f85380beac3f4
7
- data.tar.gz: 4b6ed30645c1a9cc2ffaecd1924db4fd71bf6d4c845bc716e6107e76876066964f1f711ed0fc380d546ae192ab4ca1ca080fb89b15d95a59b02274a65d4b2d9b
6
+ metadata.gz: 2b29941c5b2a5ba6e4536751a3aabc89dc54e2ca2e2c4907c71a818737f4d5f7c8160841058a658efea83d06948194e3c80528fa7fcfb183f37b892ac6b8b10d
7
+ data.tar.gz: e7d8eca69579c1c6c115742a829bf77490e7bbcb886464a8c1f0a6773fea765dccef8036aa9b4b366d34967909b3a0ef72419a57589246a80b7b3c843c2a6e06
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.1 (7/21/2015)
2
+
3
+ * [#8](https://github.com/dblock/slack-ruby-bot/issues/8): Fix: `undefined method `strip!' for nil:NilClass` on nil message - [@dblock](https://github.com/dblock).
4
+
1
5
  ### 0.3.0 (7/19/2015)
2
6
 
3
7
  * [#5](https://github.com/dblock/slack-ruby-bot/issues/5): Added support for free-formed routes via `match` - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -50,6 +50,7 @@ A typical production Slack bot is a combination of a vanilla web server and a we
50
50
  The following examples of production-grade bots based on slack-ruby-bot are listed in growing order of complexity.
51
51
 
52
52
  * [slack-mathbot](https://github.com/dblock/slack-mathbot): Slack integration with math.
53
+ * [slack-aws](https://github.com/dblock/slack-aws): Slack integration with Amazon Web Services.
53
54
  * [slack-gamebot](https://github.com/dblock/slack-gamebot): A generic game bot for ping-pong, chess, etc.
54
55
 
55
56
  ### Commands and Operators
@@ -5,7 +5,7 @@ module SlackRubyBot
5
5
 
6
6
  def message(data)
7
7
  data = Hashie::Mash.new(data)
8
- data.text.strip!
8
+ data.text.strip! if data.text
9
9
  result = child_command_classes.detect { |d| d.invoke(data) }
10
10
  result ||= built_in_command_classes.detect { |d| d.invoke(data) }
11
11
  result ||= SlackRubyBot::Commands::Unknown.tap { |d| d.invoke(data) }
@@ -1,3 +1,3 @@
1
1
  module SlackRubyBot
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe SlackRubyBot::Commands do
4
+ let! :command do
5
+ Class.new(SlackRubyBot::Commands::Base) do
6
+ command 'nil_text'
7
+
8
+ def self.call(data, _match)
9
+ send_message data.channel, nil
10
+ end
11
+ end
12
+ end
13
+ def app
14
+ SlackRubyBot::App.new
15
+ end
16
+ it 'ignores nil messages' do
17
+ allow(Giphy).to receive(:random)
18
+ expect(SlackRubyBot::Commands::Base).to_not receive(:send_message_with_gif)
19
+ app.send(:message, text: nil, channel: 'channel', user: 'user')
20
+ end
21
+ end
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-19 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slack-api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.1.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.1.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: giphy
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.0.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.0.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: websocket-driver
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.5.4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.5.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rack-test
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: vcr
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: webmock
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - '>='
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
@@ -170,11 +170,11 @@ executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
173
- - ".gitignore"
174
- - ".rspec"
175
- - ".rubocop.yml"
176
- - ".rubocop_todo.yml"
177
- - ".travis.yml"
173
+ - .gitignore
174
+ - .rspec
175
+ - .rubocop.yml
176
+ - .rubocop_todo.yml
177
+ - .travis.yml
178
178
  - CHANGELOG.md
179
179
  - CONTRIBUTING.md
180
180
  - DEPLOYMENT.md
@@ -231,6 +231,7 @@ files:
231
231
  - spec/slack-ruby-bot/commands/empty_text_spec.rb
232
232
  - spec/slack-ruby-bot/commands/help_spec.rb
233
233
  - spec/slack-ruby-bot/commands/hi_spec.rb
234
+ - spec/slack-ruby-bot/commands/nil_message_spec.rb
234
235
  - spec/slack-ruby-bot/commands/not_implemented_spec.rb
235
236
  - spec/slack-ruby-bot/commands/operators_spec.rb
236
237
  - spec/slack-ruby-bot/commands/operators_with_block_spec.rb
@@ -248,17 +249,17 @@ require_paths:
248
249
  - lib
249
250
  required_ruby_version: !ruby/object:Gem::Requirement
250
251
  requirements:
251
- - - ">="
252
+ - - '>='
252
253
  - !ruby/object:Gem::Version
253
254
  version: '0'
254
255
  required_rubygems_version: !ruby/object:Gem::Requirement
255
256
  requirements:
256
- - - ">="
257
+ - - '>='
257
258
  - !ruby/object:Gem::Version
258
259
  version: 1.3.6
259
260
  requirements: []
260
261
  rubyforge_project:
261
- rubygems_version: 2.2.2
262
+ rubygems_version: 2.4.5
262
263
  signing_key:
263
264
  specification_version: 4
264
265
  summary: The easiest way to write a Slack bot in Ruby.
@@ -272,6 +273,7 @@ test_files:
272
273
  - spec/slack-ruby-bot/commands/empty_text_spec.rb
273
274
  - spec/slack-ruby-bot/commands/help_spec.rb
274
275
  - spec/slack-ruby-bot/commands/hi_spec.rb
276
+ - spec/slack-ruby-bot/commands/nil_message_spec.rb
275
277
  - spec/slack-ruby-bot/commands/not_implemented_spec.rb
276
278
  - spec/slack-ruby-bot/commands/operators_spec.rb
277
279
  - spec/slack-ruby-bot/commands/operators_with_block_spec.rb