slack-ruby-bot 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ab5b8a4dc4ab10bd0f5ef08fa56f0f2a7fb0d9148012f2a37b0b4fd2d8636af
4
- data.tar.gz: b819aedc03a60e8ef5dea3798c42c8ba0a549437f3df81c0e666ac07a0038ab2
3
+ metadata.gz: c6c1329b698f67974759dd037ed5b1f5df3b69d3488c46710e15483e8d1c697a
4
+ data.tar.gz: e936269d17f733b75fe5253e8895c82095839f280e65a6a76d7f209c493c99d0
5
5
  SHA512:
6
- metadata.gz: e669b128e63dc889ea502837c7fd0cc74c19c5c4cc03e63e4076e08546899a5801f52f0cb142502990e748eb14287c73199443a60f3cbaae8cb09e59690a2eb6
7
- data.tar.gz: ba46b14a83edcc108de08d231079f1c91f8d880f2aa8ae518f60686048d395f8e5c966dc44893d165a0934d22b6e712999aea09be93db0249248ad80d54772b4
6
+ metadata.gz: ddf22b03b7f32b9c9d3d029a75f2e85188799f19940dcfb22dbc058d5cd9bbd94b3ec5fdf028c6c7b51359a2575431f60b0420182c3ca4b45bc3343b38edf01b
7
+ data.tar.gz: faa773163bd32cd1523b872459b010b33b9a7f5c1ac85872a0fff33301f5527fd3cd381d210956f90cfbd4e00a8f52a509e6b35c7fb7b5b6f3228a07a39d942e
@@ -1,3 +1,10 @@
1
+ ### 0.15.0 (2020/5/8)
2
+
3
+ * [#258](https://github.com/slack-ruby/slack-ruby-bot/pull/258): Extract development dependencies (VCR) from shared rspec configuraion - [@dikond](https://github.com/dikond).
4
+ * [#256](https://github.com/slack-ruby/slack-ruby-bot/pull/256): Allow command matcher to receive no-break spaces as regular spaces - [@MichaelM-Shopify](https://github.com/MichaelM-Shopify), [@dblock](https://github.com/dblock).
5
+ * [#254](https://github.com/slack-ruby/slack-ruby-bot/pull/254): Allow setting of `config.token` and `config.aliases` in initializer - [@wasabigeek](https://github.com/wasabigeek).
6
+ * [#253](https://github.com/slack-ruby/slack-ruby-bot/pull/253): Remove reference to unsupported Giphy content rating - [@wasabigeek](https://github.com/wasabigeek).
7
+
1
8
  ### 0.14.0 (2020/4/2)
2
9
 
3
10
  * [#250](https://github.com/slack-ruby/slack-ruby-bot/pull/250): Added `config.allow_bot_messages`, defaults to `false` - [@dblock](https://github.com/dblock).
@@ -18,13 +18,17 @@ git remote add upstream https://github.com/slack-ruby/slack-ruby-bot.git
18
18
 
19
19
  ## Bundle Install and Test
20
20
 
21
- Ensure that you can build the project and run tests.
21
+ Ensure that you can build the project and run tests. Make sure you have set `CONCURRENCY` env variable to one of the following: `celluloid-io`, `faye-websocket` or `async-websocket`.
22
22
 
23
23
  ```
24
+ export CONCURRENCY=async-websocket
24
25
  bundle install
25
26
  bundle exec rake
26
27
  ```
27
28
 
29
+ Take a look at the [travis configuration](https://github.com/slack-ruby/slack-ruby-bot/blob/master/.travis.yml) for more details.
30
+
31
+
28
32
  ## Run SlackRubyBot in Development
29
33
 
30
34
  Create a private slack group for yourself.
data/README.md CHANGED
@@ -19,7 +19,7 @@ If you are not familiar with Slack bots or Slack API concepts, you might want to
19
19
 
20
20
  ## Stable Release
21
21
 
22
- You're reading the documentation for the **stable** release of slack-ruby-bot, v0.14.0.
22
+ You're reading the documentation for the **stable** release of slack-ruby-bot, v0.15.0.
23
23
  See [CHANGELOG](CHANGELOG.md) for a history of changes and [UPGRADING](UPGRADING.md) for how to upgrade to more recent versions.
24
24
 
25
25
  ## Usage
@@ -345,11 +345,11 @@ Giphy.configure do |config|
345
345
  end
346
346
  ```
347
347
 
348
- With `GiphyClient` you can configure the default GIF rating, which supports Y, G, PG, PG-13, and R. The default value is `G`.
348
+ With `GiphyClient` you can configure the default GIF [content rating](https://developers.giphy.com/docs/optional-settings#rating), which supports G, PG, PG-13, and R. The default value is `G`.
349
349
 
350
350
  ```ruby
351
351
  Giphy.configure do |config|
352
- config.rating = 'Y' # illustrated content only, i.e. cartoons
352
+ config.rating = 'PG'
353
353
  end
354
354
  ```
355
355
 
@@ -1,6 +1,14 @@
1
1
  Upgrading SlackRubyBot
2
2
  ======================
3
3
 
4
+ ### Upgrading to >= 0.15.0
5
+
6
+ #### Set up VCR explicitly
7
+
8
+ Requiring `slack-ruby-bot/rspec` will no longer set up [VCR](https://rubygems.org/gems/vcr) anymore. If your spec suite implicitly relies on this you would need to set up VCR explicitly in your spec suite. Just follow standard VCR documentation.
9
+
10
+ See [#258](https://github.com/slack-ruby/slack-ruby-bot/pull/258) for more information.
11
+
4
12
  ### Upgrading to >= 0.14.0
5
13
 
6
14
  #### Bot Messages Disabled
@@ -2,23 +2,27 @@
2
2
 
3
3
  module SlackRubyBot
4
4
  class App < Server
5
- def initialize(options = {})
6
- SlackRubyBot.configure do |config|
7
- config.token = ENV['SLACK_API_TOKEN'] || raise("Missing ENV['SLACK_API_TOKEN'].")
8
- config.aliases = ENV['SLACK_RUBY_BOT_ALIASES'].split(' ') if ENV['SLACK_RUBY_BOT_ALIASES']
9
- end
10
- Slack.configure do |config|
11
- config.token = SlackRubyBot.config.token
12
- end
13
- super
14
- end
15
-
16
5
  def config
17
6
  SlackRubyBot.config
18
7
  end
19
8
 
20
9
  def self.instance
21
- @instance ||= new
10
+ @instance ||= begin
11
+ configure!
12
+ new(token: SlackRubyBot.config.token)
13
+ end
14
+ end
15
+
16
+ def self.configure!
17
+ SlackRubyBot.configure do |config|
18
+ config.token = ENV['SLACK_API_TOKEN'] if ENV.key?('SLACK_API_TOKEN')
19
+ raise('Missing Slack API Token.') unless config.token.present?
20
+
21
+ config.aliases = ENV['SLACK_RUBY_BOT_ALIASES'].split(' ') if ENV.key?('SLACK_RUBY_BOT_ALIASES')
22
+ end
23
+ Slack.configure do |config|
24
+ config.token = SlackRubyBot.config.token
25
+ end
22
26
  end
23
27
 
24
28
  private
@@ -50,7 +50,7 @@ module SlackRubyBot
50
50
 
51
51
  def command(*values, &block)
52
52
  values = values.map { |value| value.is_a?(Regexp) ? value.source : Regexp.escape(value) }.join('|')
53
- match Regexp.new("^#{bot_matcher}[\\s]+(?<command>#{values})([\\s]+(?<expression>.*)|)$", Regexp::IGNORECASE | Regexp::MULTILINE), &block
53
+ match Regexp.new("^#{bot_matcher}[[:space:]]+(?<command>#{values})([[:space:]]+(?<expression>.*)|)$", Regexp::IGNORECASE | Regexp::MULTILINE), &block
54
54
  end
55
55
 
56
56
  def invoke(client, data)
@@ -4,12 +4,13 @@ shared_examples 'a slack ruby bot' do
4
4
  context 'not configured' do
5
5
  before do
6
6
  @slack_api_token = ENV.delete('SLACK_API_TOKEN')
7
+ SlackRubyBot.configure { |config| config.token = nil }
7
8
  end
8
9
  after do
9
10
  ENV['SLACK_API_TOKEN'] = @slack_api_token
10
11
  end
11
12
  it 'requires SLACK_API_TOKEN' do
12
- expect { subject }.to raise_error RuntimeError, "Missing ENV['SLACK_API_TOKEN']."
13
+ expect { described_class.instance }.to raise_error RuntimeError, 'Missing Slack API Token.'
13
14
  end
14
15
  end
15
16
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  RSpec.configure do |config|
4
- config.before :all do
4
+ config.before :each do
5
5
  ENV['SLACK_API_TOKEN'] ||= 'test'
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SlackRubyBot
4
- VERSION = '0.14.0'
4
+ VERSION = '0.15.0'
5
5
  end
@@ -7,10 +7,71 @@ describe SlackRubyBot::App do
7
7
  it_behaves_like 'a slack ruby bot'
8
8
 
9
9
  describe '.instance' do
10
+ let(:token) { 'slack-api-token' }
11
+ let(:klass) { Class.new(SlackRubyBot::App) }
12
+
10
13
  it 'creates an instance of the App subclass' do
11
- klass = Class.new(SlackRubyBot::App)
12
14
  expect(klass.instance.class).to be klass
13
15
  end
16
+
17
+ it 'sets config.token from ENV' do
18
+ expect(klass.instance.config.token).to eq('test')
19
+ end
20
+
21
+ context 'when token is not defined' do
22
+ before do
23
+ ENV.delete('SLACK_API_TOKEN')
24
+ SlackRubyBot::Config.token = nil
25
+ end
26
+
27
+ it 'raises error' do
28
+ expect { klass.instance }.to raise_error RuntimeError, 'Missing Slack API Token.'
29
+ end
30
+ end
31
+
32
+ context 'when token is defined in ENV but not config' do
33
+ before do
34
+ SlackRubyBot::Config.token = nil
35
+ end
36
+
37
+ it 'sets config.token from ENV' do
38
+ expect(klass.instance.config.token).to eq('test')
39
+ end
40
+ end
41
+
42
+ context 'when token is not defined in ENV but is defined in config' do
43
+ before do
44
+ ENV.delete('SLACK_API_TOKEN')
45
+ end
46
+
47
+ it 'sets config.token from config' do
48
+ expect(klass.instance.config.token).to eq('testtoken')
49
+ end
50
+ end
51
+
52
+ context 'when aliases are defined in config only' do
53
+ let(:aliases) { %w[alias alias2] }
54
+ before do
55
+ SlackRubyBot::Config.aliases = aliases
56
+ end
57
+
58
+ it 'sets config.aliases' do
59
+ expect(klass.instance.config.aliases).to eq(aliases)
60
+ end
61
+ end
62
+
63
+ context 'when aliases are defined in ENV only' do
64
+ before do
65
+ ENV['SLACK_RUBY_BOT_ALIASES'] = 'alias3 alias4'
66
+ end
67
+ after do
68
+ ENV.delete('SLACK_RUBY_BOT_ALIASES')
69
+ end
70
+
71
+ it 'sets config.aliases from env' do
72
+ expect(klass.instance.config.aliases).to eq(%w[alias3 alias4])
73
+ end
74
+ end
14
75
  end
15
76
 
16
77
  describe 'executable' do
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe SlackRubyBot::Commands do
4
+ let! :command do
5
+ Class.new(SlackRubyBot::Commands::Base) do
6
+ command 'non_breaking_space' do |client, data, match|
7
+ client.say(channel: data.channel, text: match['expression'])
8
+ end
9
+ end
10
+ end
11
+ it 'sends a message with non-breaking space after bot name' do
12
+ expect(message: "#{SlackRubyBot.config.user}\u00a0non_breaking_space message").to respond_with_slack_message('message')
13
+ end
14
+ it 'sends a message with non-breaking space after command' do
15
+ expect(message: "#{SlackRubyBot.config.user} non_breaking_space\u00a0message").to respond_with_slack_message('message')
16
+ end
17
+ it 'sends a message with all non-breaking spaces' do
18
+ expect(message: "#{SlackRubyBot.config.user}\u00a0non_breaking_space\u00a0message").to respond_with_slack_message('message')
19
+ end
20
+ it 'sends a message with trailing non-breaking spaces' do
21
+ expect(message: "#{SlackRubyBot.config.user} non_breaking_space message\u00a0").to respond_with_slack_message("message\u00a0")
22
+ end
23
+ it 'sends a message with multiple non-breaking spaces' do
24
+ expect(message: "#{SlackRubyBot.config.user} non_breaking_space message1\u00a0message2").to respond_with_slack_message("message1\u00a0message2")
25
+ end
26
+ it 'sends a message with non-breaking spaces on multiple lines' do
27
+ expect(message: "#{SlackRubyBot.config.user} non_breaking_space message1\u00a0message2\nmessage3\u00a0message4").to respond_with_slack_message("message1\u00a0message2\nmessage3\u00a0message4")
28
+ end
29
+ end
@@ -14,15 +14,15 @@ if ENV.key?('WITH_GIPHY_CLIENT')
14
14
  expect(Giphy.random('burrito').image_url).to eq burrito_gif
15
15
  end
16
16
  end
17
- context 'rated y' do
17
+ context 'rated pg' do
18
18
  before do
19
- Giphy.config.rating = 'Y'
19
+ Giphy.config.rating = 'PG'
20
20
  end
21
21
  after do
22
22
  Giphy.config.rating = 'G'
23
23
  end
24
- let(:burrito_gif) { 'https://media3.giphy.com/media/hkdKLmIgB3ane/giphy.gif' }
25
- it 'random', vcr: { cassette_name: 'giphy_client_burrito_rated_y' } do
24
+ let(:burrito_gif) { 'https://media0.giphy.com/media/3o6gb3OJb2tWB76uwE/giphy.gif' }
25
+ it 'random', vcr: { cassette_name: 'giphy_client_burrito_rated_pg' } do
26
26
  expect(Giphy.random('burrito').image_url).to eq burrito_gif
27
27
  end
28
28
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'slack-ruby-bot/rspec'
4
4
  require 'webmock/rspec'
5
+ require_relative 'support/vcr'
5
6
 
6
7
  module WithGiphy
7
8
  def self.env?
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.giphy.com/v1/gifs/random?api_key=giphy-api-key&rating=PG&tag=burrito
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Swagger-Codegen/1.0.0/ruby
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ Expect:
17
+ - ''
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json
25
+ X-Robots-Tag:
26
+ - noindex
27
+ Access-Control-Allow-Credentials:
28
+ - 'true'
29
+ Access-Control-Allow-Methods:
30
+ - GET, POST, PUT, DELETE, OPTIONS
31
+ Access-Control-Allow-Headers:
32
+ - Content-Type, Accept, x-requested-with, cache-control, X-GIPHY-SDK-NAME, X-GIPHY-SDK-VERSION,
33
+ X-GIPHY-SDK-PLATFORM
34
+ Access-Control-Allow-Origin:
35
+ - "*"
36
+ Accept-Ranges:
37
+ - bytes
38
+ - bytes
39
+ - bytes
40
+ - bytes
41
+ Age:
42
+ - '0'
43
+ - '0'
44
+ - '0'
45
+ - '0'
46
+ X-Rule-Debug:
47
+ - '1'
48
+ X-Cachiness-Rule-Name:
49
+ - giphy_api_vcl_fetch_stale_if_error_val_set
50
+ X-Cachiness-Edge-Timeout:
51
+ - '120.000'
52
+ X-Cachiness-Cdn-Content-If-Error-Ttl:
53
+ - '86400.000'
54
+ X-Cachiness-Cdn-Content-While-Revalidate-Ttl:
55
+ - '1200.000'
56
+ X-Cachiness-Cdn-Content-Varnish-Grace-Ttl:
57
+ - '86400.000'
58
+ Transfer-Encoding:
59
+ - chunked
60
+ Date:
61
+ - Sun, 05 Apr 2020 09:48:06 GMT
62
+ Connection:
63
+ - keep-alive
64
+ X-Served-By:
65
+ - cache-bwi5120-BWI, cache-sin18037-SIN
66
+ X-Cache-Hits:
67
+ - 0, 0
68
+ X-Timer:
69
+ - S1586080086.016895,VS0,VE405
70
+ Vary:
71
+ - Accept-Encoding
72
+ body:
73
+ encoding: UTF-8
74
+ string: '{"data":{"type":"gif","id":"3o6gb3OJb2tWB76uwE","url":"https:\/\/giphy.com\/gifs\/new-girl-fox-new-girl-3o6gb3OJb2tWB76uwE","slug":"new-girl-fox-new-girl-3o6gb3OJb2tWB76uwE","bitly_gif_url":"https:\/\/gph.is\/217Ajw3","bitly_url":"https:\/\/gph.is\/217Ajw3","embed_url":"https:\/\/giphy.com\/embed\/3o6gb3OJb2tWB76uwE","username":"new-girl","source":"","title":"megan
75
+ fox GIF by New Girl","rating":"pg","content_url":"","source_tld":"","source_post_url":"","is_sticker":0,"import_datetime":"2016-02-17
76
+ 00:06:19","trending_datetime":"0000-00-00 00:00:00","images":{"downsized_large":{"height":"281","size":"2065896","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.gif","width":"500"},"fixed_height_small_still":{"height":"100","size":"10860","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100_s.gif","width":"178"},"original":{"frames":"29","hash":"ce4159fb04d3cdf136684bd6ed168a2b","height":"281","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.mp4","mp4_size":"352777","size":"2065896","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.webp","webp_size":"575422","width":"500"},"fixed_height_downsampled":{"height":"200","size":"176994","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200_d.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200_d.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200_d.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200_d.webp","webp_size":"88866","width":"356"},"downsized_still":{"height":"281","size":"36155","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-downsized_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-downsized_s.gif","width":"500"},"fixed_height_still":{"height":"200","size":"28570","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200_s.gif","width":"356"},"downsized_medium":{"height":"281","size":"2065896","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.gif","width":"500"},"downsized":{"height":"281","size":"988581","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-downsized.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-downsized.gif","width":"500"},"preview_webp":{"height":"106","size":"34956","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-preview.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-preview.webp","width":"188"},"original_mp4":{"height":"268","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy.mp4","mp4_size":"352777","width":"480"},"fixed_height_small":{"height":"100","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100.mp4","mp4_size":"27984","size":"299158","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100.webp","webp_size":"94524","width":"178"},"fixed_height":{"height":"200","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200.mp4","mp4_size":"107639","size":"793935","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200.webp","webp_size":"257462","width":"356"},"downsized_small":{"height":"180","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-downsized-small.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-downsized-small.mp4","mp4_size":"33430","width":"321"},"preview":{"height":"198","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-preview.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-preview.mp4","mp4_size":"30813","width":"353"},"fixed_width_downsampled":{"height":"112","size":"76626","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w_d.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w_d.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w_d.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w_d.webp","webp_size":"34772","width":"200"},"fixed_width_small_still":{"height":"56","size":"3889","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100w_s.gif","width":"100"},"fixed_width_small":{"height":"56","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100w.mp4","mp4_size":"10620","size":"88828","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100w.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=100w.webp","webp_size":"43728","width":"100"},"original_still":{"height":"281","size":"77064","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy_s.gif","width":"500"},"fixed_width_still":{"height":"112","size":"13623","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w_s.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w_s.gif","width":"200"},"looping":{"mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-loop.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-loop.mp4","mp4_size":"1588862"},"fixed_width":{"height":"112","mp4":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w.mp4?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w.mp4","mp4_size":"30417","size":"350865","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w.gif","webp":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w.webp?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=200w.webp","webp_size":"109422","width":"200"},"preview_gif":{"height":"56","size":"48146","url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy-preview.gif?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=giphy-preview.gif","width":"100"},"480w_still":{"url":"https:\/\/media4.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/480w_s.jpg?cid=6ef6bcb4368a35413d72b78d296866a9dd0c839bdc0f4643&rid=480w_s.jpg","width":"480","height":"270"}},"user":{"avatar_url":"https:\/\/media1.giphy.com\/avatars\/new-girl\/I1nNp7T5S75c.png","banner_image":"https:\/\/media1.giphy.com\/headers\/new-girl\/T8rbcrTIdvy4.png","banner_url":"https:\/\/media1.giphy.com\/headers\/new-girl\/T8rbcrTIdvy4.png","profile_url":"https:\/\/giphy.com\/new-girl\/","username":"new-girl","display_name":"New
77
+ Girl","is_verified":true},"image_original_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.gif","image_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.gif","image_mp4_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/giphy.mp4","image_frames":"29","image_width":"500","image_height":"281","fixed_height_downsampled_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200_d.gif","fixed_height_downsampled_width":"356","fixed_height_downsampled_height":"200","fixed_width_downsampled_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/200w_d.gif","fixed_width_downsampled_width":"200","fixed_width_downsampled_height":"112","fixed_height_small_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100.gif","fixed_height_small_still_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100_s.gif","fixed_height_small_width":"178","fixed_height_small_height":"100","fixed_width_small_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w.gif","fixed_width_small_still_url":"https:\/\/media0.giphy.com\/media\/3o6gb3OJb2tWB76uwE\/100w_s.gif","fixed_width_small_width":"100","fixed_width_small_height":"56","caption":""},"meta":{"status":200,"msg":"OK","response_id":"368a35413d72b78d296866a9dd0c839bdc0f4643"}}'
78
+ http_version: null
79
+ recorded_at: Sun, 05 Apr 2020 09:48:06 GMT
80
+ recorded_with: VCR 5.1.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-03 00:00:00.000000000 Z
11
+ date: 2020-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -188,10 +188,6 @@ files:
188
188
  - lib/slack-ruby-bot/mvc/view/base.rb
189
189
  - lib/slack-ruby-bot/rspec.rb
190
190
  - lib/slack-ruby-bot/rspec/support/bots_for_tests.rb
191
- - lib/slack-ruby-bot/rspec/support/fixtures/slack/giphy_burrito.yml
192
- - lib/slack-ruby-bot/rspec/support/fixtures/slack/giphy_client_burrito.yml
193
- - lib/slack-ruby-bot/rspec/support/fixtures/slack/giphy_client_burrito_rated_y.yml
194
- - lib/slack-ruby-bot/rspec/support/fixtures/slack/migration_in_progress.yml
195
191
  - lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
196
192
  - lib/slack-ruby-bot/rspec/support/slack-ruby-bot/not_respond.rb
197
193
  - lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_error.rb
@@ -201,7 +197,6 @@ files:
201
197
  - lib/slack-ruby-bot/rspec/support/slack_api_key.rb
202
198
  - lib/slack-ruby-bot/rspec/support/slack_ruby_bot_configure.rb
203
199
  - lib/slack-ruby-bot/rspec/support/spec_helpers.rb
204
- - lib/slack-ruby-bot/rspec/support/vcr.rb
205
200
  - lib/slack-ruby-bot/server.rb
206
201
  - lib/slack-ruby-bot/support/loggable.rb
207
202
  - lib/slack-ruby-bot/version.rb
@@ -239,6 +234,7 @@ files:
239
234
  - spec/slack-ruby-bot/commands/match_spec.rb
240
235
  - spec/slack-ruby-bot/commands/message_loop_spec.rb
241
236
  - spec/slack-ruby-bot/commands/nil_message_spec.rb
237
+ - spec/slack-ruby-bot/commands/non_breaking_space_spec.rb
242
238
  - spec/slack-ruby-bot/commands/not_implemented_spec.rb
243
239
  - spec/slack-ruby-bot/commands/operators_spec.rb
244
240
  - spec/slack-ruby-bot/commands/operators_with_block_spec.rb
@@ -266,6 +262,11 @@ files:
266
262
  - spec/slack-ruby-bot/support/loggable_spec.rb
267
263
  - spec/slack-ruby-bot/version_spec.rb
268
264
  - spec/spec_helper.rb
265
+ - spec/support/fixtures/slack/giphy_burrito.yml
266
+ - spec/support/fixtures/slack/giphy_client_burrito.yml
267
+ - spec/support/fixtures/slack/giphy_client_burrito_rated_pg.yml
268
+ - spec/support/fixtures/slack/migration_in_progress.yml
269
+ - spec/support/vcr.rb
269
270
  homepage: https://github.com/slack-ruby/slack-ruby-bot
270
271
  licenses:
271
272
  - MIT
@@ -314,6 +315,7 @@ test_files:
314
315
  - spec/slack-ruby-bot/commands/match_spec.rb
315
316
  - spec/slack-ruby-bot/commands/message_loop_spec.rb
316
317
  - spec/slack-ruby-bot/commands/nil_message_spec.rb
318
+ - spec/slack-ruby-bot/commands/non_breaking_space_spec.rb
317
319
  - spec/slack-ruby-bot/commands/not_implemented_spec.rb
318
320
  - spec/slack-ruby-bot/commands/operators_spec.rb
319
321
  - spec/slack-ruby-bot/commands/operators_with_block_spec.rb
@@ -341,3 +343,8 @@ test_files:
341
343
  - spec/slack-ruby-bot/support/loggable_spec.rb
342
344
  - spec/slack-ruby-bot/version_spec.rb
343
345
  - spec/spec_helper.rb
346
+ - spec/support/fixtures/slack/giphy_burrito.yml
347
+ - spec/support/fixtures/slack/giphy_client_burrito.yml
348
+ - spec/support/fixtures/slack/giphy_client_burrito_rated_pg.yml
349
+ - spec/support/fixtures/slack/migration_in_progress.yml
350
+ - spec/support/vcr.rb
@@ -1,71 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://api.giphy.com/v1/gifs/random?api_key=giphy-api-key&rating=Y&tag=burrito
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Swagger-Codegen/1.0.0/ruby
12
- Content-Type:
13
- - application/json
14
- Accept:
15
- - application/json
16
- Expect:
17
- - ''
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Content-Type:
24
- - application/json
25
- Accept-Ranges:
26
- - bytes
27
- - bytes
28
- Access-Control-Allow-Credentials:
29
- - 'true'
30
- Access-Control-Allow-Headers:
31
- - Content-Type, Accept, x-requested-with, cache-control
32
- Access-Control-Allow-Methods:
33
- - GET, POST, PUT, DELETE, OPTIONS
34
- Access-Control-Allow-Origin:
35
- - "*"
36
- Age:
37
- - '0'
38
- X-Robots-Tag:
39
- - noindex
40
- X-Kong-Upstream-Latency:
41
- - '150'
42
- X-Kong-Proxy-Latency:
43
- - '0'
44
- Content-Length:
45
- - '6419'
46
- Date:
47
- - Fri, 04 May 2018 12:22:29 GMT
48
- X-Served-By:
49
- - cache-den19627-DEN
50
- X-Cache:
51
- - MISS
52
- - MISS from 3
53
- X-Cache-Hits:
54
- - '0'
55
- X-Timer:
56
- - S1525436549.420736,VS0,VE202
57
- Vary:
58
- - Accept-Encoding, Accept-Encoding
59
- Via:
60
- - kong/0.11.0.3-enterprise-edition, 1.1 varnish, 1.1 3 (squid)
61
- Connection:
62
- - keep-alive
63
- body:
64
- encoding: UTF-8
65
- string: '{"data":{"type":"gif","id":"hkdKLmIgB3ane","slug":"cartoonhangover-cartoon-hangover-bee-and-puppycat-deckard-hkdKLmIgB3ane","url":"https:\/\/giphy.com\/gifs\/cartoonhangover-cartoon-hangover-bee-and-puppycat-deckard-hkdKLmIgB3ane","bitly_gif_url":"http:\/\/gph.is\/1qsLT19","bitly_url":"http:\/\/gph.is\/1qsLT19","embed_url":"https:\/\/giphy.com\/embed\/hkdKLmIgB3ane","username":"beeandpuppycat","source":"http:\/\/hangover.cartoonhangover.com\/post\/101982802617\/texts-from-bae-watch-now","content_url":"","source_tld":"hangover.cartoonhangover.com","source_post_url":"http:\/\/hangover.cartoonhangover.com\/post\/101982802617\/texts-from-bae-watch-now","is_sticker":0,"import_datetime":"2014-11-07
66
- 04:00:33","trending_datetime":"1970-01-01 00:00:00","user":{"avatar_url":"https:\/\/media.giphy.com\/avatars\/beeandpuppycat\/cyT9kR6MIqbK.gif","banner_url":"https:\/\/media.giphy.com\/headers\/beeandpuppycat\/TLNhReAxLFI9.jpg","profile_url":"https:\/\/giphy.com\/beeandpuppycat\/","username":"beeandpuppycat","display_name":"Bee
67
- and Puppycat","twitter":"","is_verified":true},"images":{"fixed_height_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200_s.gif","width":"356","height":"200"},"original_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy_s.gif","width":"400","height":"225"},"fixed_width":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w.gif","width":"200","height":"113","size":"499059","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w.mp4","mp4_size":"159807","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w.webp","webp_size":"1023352"},"fixed_height_small_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100_s.gif","width":"178","height":"100"},"fixed_height_downsampled":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200_d.gif","width":"356","height":"200","size":"334553","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200_d.webp","webp_size":"140458"},"preview":{"width":"400","height":"224","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-preview.mp4","mp4_size":"44780"},"fixed_height_small":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100.gif","width":"178","height":"100","size":"892868","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100.mp4","mp4_size":"87596","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100.webp","webp_size":"544088"},"downsized_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-downsized_s.gif","width":"400","height":"225","size":"62328"},"downsized":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-downsized.gif","width":"400","height":"225","size":"1002923"},"downsized_large":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.gif","width":"400","height":"225","size":"1002923"},"fixed_width_small_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w_s.gif","width":"100","height":"56"},"preview_webp":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-preview.webp","width":"174","height":"98","size":"48566"},"fixed_width_still":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w_s.gif","width":"200","height":"113"},"fixed_width_small":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w.gif","width":"100","height":"56","size":"499059","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w.mp4","mp4_size":"30578","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w.webp","webp_size":"226546"},"downsized_small":{"width":"400","height":"224","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-downsized-small.mp4","mp4_size":"44780"},"fixed_width_downsampled":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w_d.gif","width":"200","height":"113","size":"132991","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w_d.webp","webp_size":"55952"},"downsized_medium":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.gif","width":"400","height":"225","size":"1002923"},"original":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.gif","width":"400","height":"225","size":"1002923","frames":"112","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.mp4","mp4_size":"827796","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.webp","webp_size":"1819838"},"fixed_height":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200.gif","width":"356","height":"200","size":"892868","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200.mp4","mp4_size":"322931","webp":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200.webp","webp_size":"2597356"},"looping":{"mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-loop.mp4","mp4_size":"3392324"},"original_mp4":{"width":"480","height":"270","mp4":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.mp4","mp4_size":"827796"},"preview_gif":{"url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy-preview.gif","width":"249","height":"140","size":"49584"},"480w_still":{"url":"hkdKLmIgB3ane\/480w_s.jpg","width":"480","height":"270"}},"title":"animation
68
- cartoon hangover GIF by Bee and Puppycat","image_original_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.gif","image_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.gif","image_mp4_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/giphy.mp4","image_frames":"112","image_width":"400","image_height":"225","fixed_height_downsampled_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200_d.gif","fixed_height_downsampled_width":"356","fixed_height_downsampled_height":"200","fixed_width_downsampled_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/200w_d.gif","fixed_width_downsampled_width":"200","fixed_width_downsampled_height":"113","fixed_height_small_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100.gif","fixed_height_small_still_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100_s.gif","fixed_height_small_width":"178","fixed_height_small_height":"100","fixed_width_small_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w.gif","fixed_width_small_still_url":"https:\/\/media3.giphy.com\/media\/hkdKLmIgB3ane\/100w_s.gif","fixed_width_small_width":"100","fixed_width_small_height":"56","caption":""},"meta":{"status":200,"msg":"OK","response_id":"5aec508574684177590570c1"}}'
69
- http_version:
70
- recorded_at: Fri, 04 May 2018 12:22:30 GMT
71
- recorded_with: VCR 3.0.3