slack-ruby-bot 0.5.0 → 0.5.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: b416684447c6fb8687ce155f3c86527b82f8e007
4
- data.tar.gz: d7d4d84f063816712410b913187089d6fda8a62f
3
+ metadata.gz: 692c967d9fd9953f4279e4596fb01bd43b280914
4
+ data.tar.gz: 8c24ae4ccdee5c0667e97094ac527d3f28c75a25
5
5
  SHA512:
6
- metadata.gz: eed29c1effba3bc4d3c27a1dada0665cddf57fe785487c45c418f7e7ce3cc2af7c9b4b78ae4a2ac2f1f70875c73f7a6ebf27ccd9249d0f8c2c5674828c687e8e
7
- data.tar.gz: cbbc3f361dc13b115a348d2817f62b9702baeac5888398e799b300875d45124d248c2fac142730363fc5011ce48e78f1dd093c538a159157c7d062ace6a6391b
6
+ metadata.gz: 25b5ad5e407f6cb817dae5e9f6516cec650d0feb34397d17e05b2ec2ed6291d7321968dad1b44f330efb1ddc47f4e995d7bb5100be6f5acd4713055e507963c6
7
+ data.tar.gz: 2e545f8960023ae2b79874a400083eb3601bcbea361776177da09ebdd16acf2281e831fa64ac3610e14a577eafab11fa1f790a57ade80b5fb5d62c04e1b133ca
@@ -1,3 +1,8 @@
1
+ ### 0.5.1 (12/23/2015)
2
+
3
+ * Fix: restart sync vs. async - [@dblock](https://github.com/dblock).
4
+ * [#33](https://github.com/dblock/slack-ruby-bot/pull/33): `SlackRubyBot::App.instance` now creates an instance of the class on which it is called - [@dmvt](https://github.com/dmvt).
5
+
1
6
  ### 0.5.0 (12/7/2015)
2
7
 
3
8
  * Disable animated GIFs via `SlackRubyBot::Config.send_gifs` or ENV['SLACK_RUBY_BOT_SEND_GIFS'] - [@dblock](https://github.com/dblock).
@@ -58,4 +63,3 @@
58
63
  ### 0.1.0 (6/2/2015)
59
64
 
60
65
  * Initial public release - [@dblock](https://github.com/dblock).
61
-
data/README.md CHANGED
@@ -9,9 +9,15 @@ A generic Slack bot framework written in Ruby on top of [slack-ruby-client](http
9
9
 
10
10
  ![](slack.png)
11
11
 
12
+ ## Useful to Me?
13
+
14
+ * If you are just trying to send messages to Slack, use [slack-ruby-client](https://github.com/dblock/slack-ruby-client), which this library is built on top of.
15
+ * If you're trying to roll out a full service with Slack button integration, check out [slack-bot-server](https://github.com/dblock/slack-bot-server), which uses this library.
16
+ * Otherwise, this piece of the puzzle will help you create a single bot instance for one team.
17
+
12
18
  ## Stable Release
13
19
 
14
- You're reading the documentation for the [stable release, v0.5.0](https://github.com/dblock/slack-ruby-bot/tree/v0.5.0).
20
+ You're reading the documentation for the **stable** release of slack-ruby-bot 0.5.1.
15
21
 
16
22
  ## Usage
17
23
 
@@ -95,6 +95,8 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
95
95
  require 'slack-mathbot'
96
96
  require 'web'
97
97
 
98
+ Thread.abort_on_exception = true
99
+
98
100
  Thread.new do
99
101
  begin
100
102
  SlackMathbot::App.instance.run
@@ -15,7 +15,7 @@ module SlackRubyBot
15
15
  end
16
16
 
17
17
  def self.instance
18
- @instance ||= SlackRubyBot::App.new
18
+ @instance ||= new
19
19
  end
20
20
 
21
21
  private
@@ -42,11 +42,13 @@ module SlackRubyBot
42
42
 
43
43
  def start!
44
44
  @stopping = false
45
+ @async = false
45
46
  client.start!
46
47
  end
47
48
 
48
49
  def start_async
49
50
  @stopping = false
51
+ @async = true
50
52
  client.start_async
51
53
  end
52
54
 
@@ -56,7 +58,11 @@ module SlackRubyBot
56
58
  end
57
59
 
58
60
  def restart!(wait = 1)
59
- start!
61
+ if @async
62
+ start_async
63
+ else
64
+ start!
65
+ end
60
66
  rescue StandardError => e
61
67
  sleep wait
62
68
  logger.error "#{e.message}, reconnecting in #{wait} second(s)."
@@ -1,3 +1,3 @@
1
1
  module SlackRubyBot
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
@@ -5,4 +5,11 @@ describe SlackRubyBot::App do
5
5
  SlackRubyBot::App.new
6
6
  end
7
7
  it_behaves_like 'a slack ruby bot'
8
+
9
+ describe '.instance' do
10
+ it 'creates an instance of the App subclass' do
11
+ klass = Class.new(SlackRubyBot::App)
12
+ expect(klass.instance.class).to be klass
13
+ end
14
+ end
8
15
  end
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.5.0
4
+ version: 0.5.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-12-07 00:00:00.000000000 Z
11
+ date: 2015-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie