slackbot_frd 0.2.6 → 0.2.7

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: 2ea34ae19d44e102d85572f5047d4c6e75cca914
4
- data.tar.gz: 3bc04597f27bb93bb6b7eae91e2cd8c8eedcb758
3
+ metadata.gz: 828155070b6129663a3fa92d8f19b8903bc83fdf
4
+ data.tar.gz: 76973f5f596a474dc178cbb16ae69d7908f42837
5
5
  SHA512:
6
- metadata.gz: 1b462425254baf94e0ae5720a2cf562e5379415711b8ea2306110d5d6a936dfaa61cec70cdf63fd1423a9b61e23eb7d77a28df5223c267f378f9e95a7dc1577f
7
- data.tar.gz: df9f9716ab50dabe50149e8e541fa264ee2582b625757ec24c693ec496001732b19dc034f78211a4ad4ac4b2edf9e3aba38e405bb2f113faa5bd7980eecacf27
6
+ metadata.gz: 66c669cbc4621f46755238074583c3f57dc2896a2c968dee6cdb00a77a9609601fc0f9195d890b32f07e267802f6c3f8bc254c7e9c5e3084b688fd0651629826
7
+ data.tar.gz: e3f26adbb0686bde416860efb222b0a521e8932fa9d9ec1dc2e48f2ab0bf81cadd2ee836f1db28d19467737e3f2ea6e6669a6bd9682d0b03a5b5fd693fc9c421
data/bin/slackbot-frd CHANGED
@@ -126,7 +126,10 @@ class SlackbotFrdBin < Thor
126
126
 
127
127
  daemonize = false
128
128
  daemonize = $slackbotfrd_conf['daemonize'] if $slackbotfrd_conf['daemonize']
129
- daemonize = ENV['SLACKBOT_FRD_DAEMONIZE'] if ENV['SLACKBOT_FRD_DAEMONIZE']
129
+ if ENV['SLACKBOT_FRD_DAEMONIZE']
130
+ daemonize = ENV['SLACKBOT_FRD_DAEMONIZE']
131
+ daemonize = daemonize == 'true' || daemonize == '1'
132
+ end
130
133
  daemonize = options[:daemonize] if options[:daemonize]
131
134
 
132
135
  botdir = Dir.pwd
@@ -1,4 +1,4 @@
1
1
  module SlackbotFrd
2
- VERSION = '0.2.6'
3
- DATE = '2016-07-15'
2
+ VERSION = '0.2.7'
3
+ DATE = '2016-07-19'
4
4
  end
@@ -20,6 +20,7 @@ module SlackbotFrd
20
20
 
21
21
  def connect
22
22
  @response = JSON.parse(self.class.post('', :body => { token: @token, channel: @channel } ).body)
23
+ ValidateSlack.response(@response)
23
24
  self
24
25
  end
25
26
 
@@ -28,6 +28,7 @@ module SlackbotFrd
28
28
  }
29
29
  ).body
30
30
  )
31
+ ValidateSlack.response(@response)
31
32
  @response
32
33
  end
33
34
  end
@@ -15,6 +15,7 @@ module SlackbotFrd
15
15
 
16
16
  def connect
17
17
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
18
+ ValidateSlack.response(@response)
18
19
  self
19
20
  end
20
21
 
@@ -26,6 +26,7 @@ module SlackbotFrd
26
26
  }
27
27
 
28
28
  @response = self.class.post('', :body => body)
29
+ ValidateSlack.response(@response)
29
30
  @response
30
31
  end
31
32
  end
@@ -52,6 +52,7 @@ module SlackbotFrd
52
52
  body.merge!(parse: @parse) if @parse
53
53
 
54
54
  @response = self.class.post('', :body => body)
55
+ ValidateSlack.response(@response)
55
56
  @response
56
57
  end
57
58
  end
@@ -15,6 +15,7 @@ module SlackbotFrd
15
15
 
16
16
  def connect
17
17
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
18
+ ValidateSlack.response(@response)
18
19
  self
19
20
  end
20
21
 
@@ -15,6 +15,7 @@ module SlackbotFrd
15
15
 
16
16
  def connect
17
17
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
18
+ ValidateSlack.response(@response)
18
19
  self
19
20
  end
20
21
 
@@ -27,6 +27,7 @@ module SlackbotFrd
27
27
  }
28
28
 
29
29
  @response = self.class.post('', :body => body)
30
+ ValidateSlack.response(@response)
30
31
  @response.body
31
32
  end
32
33
  end
@@ -33,6 +33,7 @@ module SlackbotFrd
33
33
  end
34
34
 
35
35
  @response = self.class.post('', :body => body)
36
+ ValidateSlack.response(@response)
36
37
  @response
37
38
  end
38
39
  end
@@ -19,6 +19,7 @@ module SlackbotFrd
19
19
 
20
20
  def connect
21
21
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
22
+ ValidateSlack.response(@response)
22
23
  @response
23
24
  end
24
25
 
@@ -20,6 +20,7 @@ module SlackbotFrd
20
20
 
21
21
  def connect
22
22
  @response = JSON.parse(self.class.post('', :body => { token: @token, user: @user_id } ).body)
23
+ ValidateSlack.response(@response)
23
24
  self
24
25
  end
25
26
 
@@ -15,6 +15,7 @@ module SlackbotFrd
15
15
 
16
16
  def connect
17
17
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
18
+ ValidateSlack.response(@response)
18
19
  self
19
20
  end
20
21
 
@@ -0,0 +1,21 @@
1
+ require 'httparty'
2
+ require 'json'
3
+
4
+ module SlackbotFrd
5
+ module SlackMethods
6
+ module ValidateSlack
7
+ def self.response(response)
8
+ if response['ok']
9
+ response
10
+ else
11
+ msg = if response['error']
12
+ response['error']
13
+ else
14
+ 'Slack returned an error'
15
+ end
16
+ raise AuthenticationFailedError.new("#{msg} - response: #{response}")
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackbot_frd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-15 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -185,6 +185,7 @@ files:
185
185
  - lib/slackbot_frd/slack_methods/rtm_start.rb
186
186
  - lib/slackbot_frd/slack_methods/users_info.rb
187
187
  - lib/slackbot_frd/slack_methods/users_list.rb
188
+ - lib/slackbot_frd/slack_methods/validate_slack.rb
188
189
  homepage: https://github.com/FreedomBen/slackbot_frd
189
190
  licenses:
190
191
  - MIT
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
206
  version: '0'
206
207
  requirements: []
207
208
  rubyforge_project:
208
- rubygems_version: 2.2.5
209
+ rubygems_version: 2.4.8
209
210
  signing_key:
210
211
  specification_version: 4
211
212
  summary: slackbot_frd provides a dirt-simple framework for implementing one or more