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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4443f2c498d95875a06c189f44eefc04e74ad2ca
4
- data.tar.gz: 226a295f130c9e097adee747b0815c87e05c8e8c
3
+ metadata.gz: 35fbab65ad9125b1cad33e43c8370bbb400733c0
4
+ data.tar.gz: 09f7ba7234ab6fa050d3f2ab2c58bea3dc1327d1
5
5
  SHA512:
6
- metadata.gz: 82e490c5500edc5961223e59737cd361c61d1e550fc2417b76e245bcc3cc9c46df3dce5c49d34aad23e820d30c6425d23f13a994c8d568b39830ce202e65955b
7
- data.tar.gz: 4462537653ad89d21257ddc1ab13dc6dc2c74e7bffe7e88564c18010ae9b88ee4a662bc0846f0f37ebec4fd7c0e504d5af9bf2d8c9e73bbbf2c4e97d2cd2dcbb
6
+ metadata.gz: fe16631db70132133296650d746e668497f09149c16d441a07710a4cff3df6a2c721fe5e6bd40e5e10fc8b55e0db1ae79a0c78bb8472b7a508d2fda6a6bb6dc2
7
+ data.tar.gz: 648ff435f67db2dad6b01ddf73b28f25a9ac7e901165a7ab4a04970f563cec9338603087364d85cf93971e34c6c011e9be4b8fd91db015cc28050e2d8dd52f60
data/.gitignore CHANGED
@@ -1,2 +1,16 @@
1
1
  .idea
2
2
  *.gem
3
+ /.bundle/
4
+ /.yardoc
5
+ /Gemfile.lock
6
+ /_yardoc/
7
+ /coverage/
8
+ /doc/
9
+ /pkg/
10
+ /spec/reports/
11
+ /tmp/
12
+ *.bundle
13
+ *.so
14
+ *.o
15
+ *.a
16
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.0.0"
4
+ - "2.2.0"
5
+ - "2.2.2"
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
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
+ [![Build Status](https://travis-ci.org/kciter/simple-slack-bot.svg?branch=master)](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
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ task :default => :spec
7
+ RSpec::Core::RakeTask.new
Binary file
@@ -16,6 +16,16 @@ module SlackBot
16
16
 
17
17
  attr_accessor(*Config::ATTRIBUTES)
18
18
  end
19
+
20
+ class << self
21
+ def configure
22
+ block_given? ? yield(Config) : Config
23
+ end
24
+
25
+ def config
26
+ Config
27
+ end
28
+ end
19
29
  end
20
30
 
21
31
  SlackBot::Config.reset()
@@ -1,3 +1,3 @@
1
1
  module SlackBot
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -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
@@ -0,0 +1,2 @@
1
+
2
+ # TODO
@@ -0,0 +1,2 @@
1
+
2
+ # TODO
@@ -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
@@ -0,0 +1,13 @@
1
+ require 'bundler/setup'
2
+ Bundler.setup
3
+
4
+ require 'simple-slack-bot'
5
+
6
+ RSpec.configure do |config|
7
+ end
8
+
9
+ SlackBot.configure do |config|
10
+ config.join_message = 'Hello!'
11
+ config.debug = true
12
+ config.token = ENV['SLACK_API_TOKEN']
13
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe SlackBot do
4
+ it 'has a version' do
5
+ expect(SlackBot::VERSION).to_not be nil
6
+ end
7
+ end
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.0
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-16 00:00:00.000000000 Z
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