simple-slack-bot 0.1.0 → 0.1.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 +4 -4
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +65 -0
- data/Rakefile +7 -0
- data/images/preview.gif +0 -0
- data/lib/simple_slack_bot/config.rb +10 -0
- data/lib/simple_slack_bot/version.rb +1 -1
- data/simple-slack-bot.gemspec +5 -0
- data/spec/client_spec.rb +2 -0
- data/spec/command_spec.rb +2 -0
- data/spec/config_spec.rb +17 -0
- data/spec/spec_helper.rb +13 -0
- data/spec/version_spec.rb +7 -0
- metadata +56 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35fbab65ad9125b1cad33e43c8370bbb400733c0
|
4
|
+
data.tar.gz: 09f7ba7234ab6fa050d3f2ab2c58bea3dc1327d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe16631db70132133296650d746e668497f09149c16d441a07710a4cff3df6a2c721fe5e6bd40e5e10fc8b55e0db1ae79a0c78bb8472b7a508d2fda6a6bb6dc2
|
7
|
+
data.tar.gz: 648ff435f67db2dad6b01ddf73b28f25a9ac7e901165a7ab4a04970f563cec9338603087364d85cf93971e34c6c011e9be4b8fd91db015cc28050e2d8dd52f60
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Lee Sun-Hyoup
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# SimpleSlackBot
|
2
|
+
[](https://travis-ci.org/kciter/simple-slack-bot)
|
3
|
+
|
4
|
+
This library wrapping [slack-ruby-client](https://github.com/dblock/slack-ruby-client) library
|
5
|
+
|
6
|
+
## Preview
|
7
|
+
<img src="https://github.com/kciter/simple-slack-bot/raw/master/images/preview.gif" alt="Preview gif">
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
```ruby
|
12
|
+
gem 'simple-slack-bot'
|
13
|
+
```
|
14
|
+
And then execute:
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
Or install it yourself as:
|
19
|
+
```
|
20
|
+
$ gem install simple-slack-bot
|
21
|
+
```
|
22
|
+
|
23
|
+
## Simple Usage
|
24
|
+
This is simple!
|
25
|
+
```ruby
|
26
|
+
require 'simple-slack-bot'
|
27
|
+
|
28
|
+
bot = SlackBot::Client.new
|
29
|
+
|
30
|
+
bot.configure do |config|
|
31
|
+
config.join_message = 'Hello!'
|
32
|
+
config.debug = true #
|
33
|
+
config.token = 'YOUR SLACK BOT TOKEN'
|
34
|
+
end
|
35
|
+
|
36
|
+
bot.add_command /Hello/ do |data|
|
37
|
+
bot.message(data['channel'], "Hello. <@#{data['user']}>!")
|
38
|
+
end
|
39
|
+
|
40
|
+
bot.start!
|
41
|
+
```
|
42
|
+
Refer to the Slack event message for [data](https://api.slack.com/events/message)
|
43
|
+
|
44
|
+
## License
|
45
|
+
The MIT License (MIT)
|
46
|
+
|
47
|
+
Copyright (c) 2016 Lee Sun-Hyoup
|
48
|
+
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
50
|
+
of this software and associated documentation files (the "Software"), to deal
|
51
|
+
in the Software without restriction, including without limitation the rights
|
52
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
53
|
+
copies of the Software, and to permit persons to whom the Software is
|
54
|
+
furnished to do so, subject to the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be included in all
|
57
|
+
copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
60
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
61
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
62
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
63
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
64
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
65
|
+
SOFTWARE.
|
data/Rakefile
ADDED
data/images/preview.gif
ADDED
Binary file
|
data/simple-slack-bot.gemspec
CHANGED
@@ -16,4 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency 'slack-ruby-client', '~> 0.5.3'
|
17
17
|
s.add_dependency 'eventmachine', '~> 1.0', '>= 1.0.9'
|
18
18
|
s.add_dependency 'faye-websocket', '~> 0.10.2'
|
19
|
+
# s.add_dependency 'rufus-scheduler', '~> 3.2.0'
|
20
|
+
|
21
|
+
s.add_development_dependency 'bundler'
|
22
|
+
s.add_development_dependency 'rake'
|
23
|
+
s.add_development_dependency 'rspec'
|
19
24
|
end
|
data/spec/client_spec.rb
ADDED
data/spec/config_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SlackBot::Config do
|
4
|
+
before do
|
5
|
+
SlackBot.configure do |config|
|
6
|
+
config.join_message = 'Hi!'
|
7
|
+
config.debug = true
|
8
|
+
config.token = 'TOKEN'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'sets config' do
|
13
|
+
expect(SlackBot.config.join_message).to eq 'Hi!'
|
14
|
+
expect(SlackBot.config.debug).to eq true
|
15
|
+
expect(SlackBot.config.token).to eq 'TOKEN'
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-slack-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Sun-Hyoup
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slack-ruby-client
|
@@ -58,6 +58,48 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 0.10.2
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: bundler
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
61
103
|
description: You can easily make Slack Bot!!!
|
62
104
|
email:
|
63
105
|
- kciter@naver.com
|
@@ -66,12 +108,24 @@ extensions: []
|
|
66
108
|
extra_rdoc_files: []
|
67
109
|
files:
|
68
110
|
- ".gitignore"
|
111
|
+
- ".rspec"
|
112
|
+
- ".travis.yml"
|
113
|
+
- Gemfile
|
114
|
+
- LICENSE
|
115
|
+
- README.md
|
116
|
+
- Rakefile
|
117
|
+
- images/preview.gif
|
69
118
|
- lib/simple-slack-bot.rb
|
70
119
|
- lib/simple_slack_bot/client.rb
|
71
120
|
- lib/simple_slack_bot/command.rb
|
72
121
|
- lib/simple_slack_bot/config.rb
|
73
122
|
- lib/simple_slack_bot/version.rb
|
74
123
|
- simple-slack-bot.gemspec
|
124
|
+
- spec/client_spec.rb
|
125
|
+
- spec/command_spec.rb
|
126
|
+
- spec/config_spec.rb
|
127
|
+
- spec/spec_helper.rb
|
128
|
+
- spec/version_spec.rb
|
75
129
|
homepage: http://github.com/kciter/simple-slack-bot
|
76
130
|
licenses:
|
77
131
|
- MIT
|