ruboty 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +48 -0
- data/README.md +28 -18
- data/lib/ruboty/command_builder.rb +3 -0
- data/lib/ruboty/robot.rb +14 -0
- data/lib/ruboty/version.rb +1 -1
- data/ruboty.gemspec +2 -1
- data/spec/spec_helper.rb +0 -5
- metadata +4 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10e8aca745957633ec85637a57ea122f1153095
|
4
|
+
data.tar.gz: 2475d3d2cbb95728760937683203e4277e4d46ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbd1d4b688c3af3237e8972f6f301bd8c8aaaab23f635aa4656173c896cfbee5db828b87399a8fc777b55ed8ced5ddfb75a6c0e4ecc613b171e8ec48f82e3279
|
7
|
+
data.tar.gz: ee168a5e6a60c2f0e1268eff17a16a22b662f663be4760ed37e4a1e0c5a608446663815eeb1b706703326aa4bb166c80375675b871eba89a0180bf176ca66fa8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,133 +1,181 @@
|
|
1
|
+
## 1.3.0
|
2
|
+
|
3
|
+
- Add --daemonize option
|
4
|
+
- Add --pid option
|
5
|
+
- Require Ruby 2.2.2 or later for ActiveSupport
|
6
|
+
|
1
7
|
## 1.2.4
|
8
|
+
|
2
9
|
- Improve help command output (thx @k0kubun)
|
3
10
|
|
4
11
|
## 1.2.3
|
12
|
+
|
5
13
|
- User default Logger class (thx @eagletmt)
|
6
14
|
|
7
15
|
## 1.2.2
|
16
|
+
|
8
17
|
- Support ^D on shell adapter (thx @suu-g)
|
9
18
|
|
10
19
|
## 1.2.1
|
20
|
+
|
11
21
|
- Refer Bundler from top-level
|
12
22
|
|
13
23
|
## 1.2.0
|
24
|
+
|
14
25
|
- Add DISABLE_DEFAULT_HANDLERS env
|
15
26
|
- Get away from help message indentation
|
16
27
|
- Support filter query on help handler (e.g. `@ruboty help ping`)
|
17
28
|
|
18
29
|
## 1.1.9
|
30
|
+
|
19
31
|
- Support slop both version 3 and 4
|
20
32
|
|
21
33
|
## 1.1.8
|
34
|
+
|
22
35
|
- Fix shell adapter
|
23
36
|
|
24
37
|
## 1.1.7
|
38
|
+
|
25
39
|
- Enable sync option of stdout to prevent buffering
|
26
40
|
|
27
41
|
## 1.1.6
|
42
|
+
|
28
43
|
- Add LOG_LEVEL env
|
29
44
|
|
30
45
|
## 1.1.5
|
46
|
+
|
31
47
|
- Use slop version 4 or higher
|
32
48
|
- Fix --load option (thx @amacou)
|
33
49
|
|
34
50
|
## 1.1.4
|
51
|
+
|
35
52
|
- Support slop version 4
|
36
53
|
|
37
54
|
## 1.1.3
|
55
|
+
|
38
56
|
- Fix slop version (thx @parroty)
|
39
57
|
|
40
58
|
## 1.1.2
|
59
|
+
|
41
60
|
- Fix message matching pattern so that "rubotyping" is not responded
|
42
61
|
|
43
62
|
## 1.1.1
|
63
|
+
|
44
64
|
- Use action's returned-value to check if :missing action is invoked or not
|
45
65
|
|
46
66
|
## 1.1.0
|
67
|
+
|
47
68
|
- Add :missing option for handler to respond with messages that didn't match any handlers
|
48
69
|
|
49
70
|
## 1.0.4
|
71
|
+
|
50
72
|
- Support RUBOTY_NAME and obsolete ROBOT_NAME
|
51
73
|
|
52
74
|
## 1.0.3
|
75
|
+
|
53
76
|
- Fix help handler
|
54
77
|
|
55
78
|
## 1.0.2
|
79
|
+
|
56
80
|
- Add RUBOTY_ENV to change bundled gems with environment
|
57
81
|
|
58
82
|
## 1.0.1
|
83
|
+
|
59
84
|
- Ignore if no Gemfile found in current directory or given path
|
60
85
|
|
61
86
|
## 1.0.0
|
87
|
+
|
62
88
|
- Rename: Ellen -> Ruboty
|
63
89
|
|
64
90
|
## 0.2.8
|
91
|
+
|
65
92
|
- Use Ruboty::Message#from_name in whoami action
|
66
93
|
|
67
94
|
## 0.2.7
|
95
|
+
|
68
96
|
- Add Ruboty::Message#from_name for rich chat service
|
69
97
|
|
70
98
|
## 0.2.6
|
99
|
+
|
71
100
|
- Add `who am i?` handler
|
72
101
|
- Sort commands in help message
|
73
102
|
|
74
103
|
## 0.2.5
|
104
|
+
|
75
105
|
- Hide action defined with `:hidden` option in Help message
|
76
106
|
|
77
107
|
## 0.2.4
|
108
|
+
|
78
109
|
- Reveal message prefix pattern as a class method
|
79
110
|
|
80
111
|
## 0.2.3
|
112
|
+
|
81
113
|
- Help message is formatted if adapter supported
|
82
114
|
|
83
115
|
## 0.2.2
|
116
|
+
|
84
117
|
- Now `Ruboty::Robot#say(message)` can use `message[:original]`
|
85
118
|
|
86
119
|
## 0.2.1
|
120
|
+
|
87
121
|
- Store shell history in ~/.ruboty_history
|
88
122
|
|
89
123
|
## 0.2.0
|
124
|
+
|
90
125
|
- Change adapter & message interface
|
91
126
|
|
92
127
|
## 0.1.3
|
128
|
+
|
93
129
|
- Change Ruboty::Message interface
|
94
130
|
|
95
131
|
## 0.1.2
|
132
|
+
|
96
133
|
- Make Handler validatable
|
97
134
|
|
98
135
|
## 0.1.1
|
136
|
+
|
99
137
|
- Improve Brain interface
|
100
138
|
|
101
139
|
## 0.1.0
|
140
|
+
|
102
141
|
- Deprecate --adapter option
|
103
142
|
|
104
143
|
## 0.0.9
|
144
|
+
|
105
145
|
- Adapt mention name to `@<name>: <text>` format
|
106
146
|
|
107
147
|
## 0.0.8
|
148
|
+
|
108
149
|
- Mount Brain
|
109
150
|
- Change handler interface
|
110
151
|
|
111
152
|
## 0.0.7
|
153
|
+
|
112
154
|
- Add PING handler
|
113
155
|
|
114
156
|
## 0.0.6
|
157
|
+
|
115
158
|
- `ruboty help` to show actions list
|
116
159
|
|
117
160
|
## 0.0.5
|
161
|
+
|
118
162
|
- Now Action can access to MatchData object via Message
|
119
163
|
- ENV["ROBOT_NAME"] or "ruboty" is default name
|
120
164
|
- Robot only responds to mention unless :all option specified
|
121
165
|
|
122
166
|
## 0.0.4
|
167
|
+
|
123
168
|
- Add --dotenv option to load .env before running
|
124
169
|
|
125
170
|
## 0.0.3
|
171
|
+
|
126
172
|
- Add env DSL to define adapter
|
127
173
|
|
128
174
|
## 0.0.2
|
175
|
+
|
129
176
|
- Add Handler DSL Syntax
|
130
177
|
- Add --load option to load a ruby file before running
|
131
178
|
|
132
179
|
## 0.0.1
|
180
|
+
|
133
181
|
- 1st release
|
data/README.md
CHANGED
@@ -1,41 +1,49 @@
|
|
1
|
-
# Ruboty
|
1
|
+
# Ruboty
|
2
|
+
|
3
|
+
[[![Gem](https://img.shields.io/gem/v/formatador.svg)]()](https://rubygems.org/gems/ruboty)
|
4
|
+
[![Build Status](https://travis-ci.org/r7kamura/ruboty.png)](https://travis-ci.org/r7kamura/ruboty)
|
2
5
|
|
3
6
|
Ruby + Bot = Ruboty.
|
4
7
|
|
5
8
|
## Dependencies
|
6
|
-
|
9
|
+
|
10
|
+
- Ruby 2.2.2
|
7
11
|
|
8
12
|
## Adapter
|
13
|
+
|
9
14
|
Adapter hooks up ruboty to chat services.
|
10
15
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
- [ruboty-slack](https://github.com/r7kamura/ruboty-slack)
|
17
|
+
- [ruboty-twitter](https://github.com/r7kamura/ruboty-twitter)
|
18
|
+
- [ruboty-hipchat](https://github.com/r7kamura/ruboty-hipchat)
|
19
|
+
- [ruboty-idobata](https://github.com/hanachin/ruboty-idobata)
|
20
|
+
- [ruboty-chatwork](https://github.com/mhag/ruboty-chatwork)
|
16
21
|
|
17
22
|
## Brain
|
23
|
+
|
18
24
|
Brain persists memories.
|
19
25
|
|
20
|
-
|
21
|
-
|
26
|
+
- [ruboty-leveldb](https://github.com/nownabe/ruboty-leveldb)
|
27
|
+
- [ruboty-redis](https://github.com/r7kamura/ruboty-redis)
|
22
28
|
|
23
29
|
## Handler
|
30
|
+
|
24
31
|
Handler provides various behaviors.
|
25
32
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
- [ruboty-alias](https://github.com/r7kamura/ruboty-alias)
|
34
|
+
- [ruboty-cron](https://github.com/r7kamura/ruboty-cron)
|
35
|
+
- [ruboty-echo](https://github.com/taiki45/ruboty-echo)
|
36
|
+
- [ruboty-github](https://github.com/r7kamura/ruboty-github)
|
37
|
+
- [ruboty-google_image](https://github.com/r7kamura/ruboty-google_image)
|
38
|
+
- [ruboty-kokodeikku](https://github.com/r7kamura/ruboty-kokodeikku)
|
39
|
+
- [ruboty-lgtm](https://github.com/negipo/ruboty-lgtm)
|
40
|
+
- [ruboty-syoboi_calendar](https://github.com/r7kamura/ruboty-syoboi_calendar)
|
41
|
+
- [ruboty-talk](https://github.com/r7kamura/ruboty-talk)
|
35
42
|
|
36
43
|
[Other plugins are hosted on Rubygems.](https://rubygems.org/search?utf8=%E2%9C%93&query=ruboty-)
|
37
44
|
|
38
45
|
## Configuration
|
46
|
+
|
39
47
|
Store configuration value in envorinment variables.
|
40
48
|
They are easy to change between deploys without changing any code.
|
41
49
|
We recommend to put `.env` and run with `ruboty --dotenv` option to manage them .
|
@@ -52,6 +60,7 @@ gem "ruboty-slack"
|
|
52
60
|
```
|
53
61
|
|
54
62
|
## ENV
|
63
|
+
|
55
64
|
```
|
56
65
|
DISABLE_DEFAULT_HANDLERS - Pass 1 to disable default handlers (default: nil)
|
57
66
|
LOG_LEVEL - Log level for debug (default: 3)
|
@@ -60,6 +69,7 @@ RUBOTY_NAME - Name to respond to mention (default: ruboty)
|
|
60
69
|
```
|
61
70
|
|
62
71
|
## Deploy
|
72
|
+
|
63
73
|
See [r7kamura/ruboty-template](https://github.com/r7kamura/ruboty-template) for example.
|
64
74
|
|
65
75
|
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/r7kamura/ruboty-template)
|
@@ -27,13 +27,16 @@ module Ruboty
|
|
27
27
|
|
28
28
|
def options
|
29
29
|
Slop.parse(arguments) do |options|
|
30
|
+
options.on("--daemon", "Run as a daemon.")
|
30
31
|
options.on("--dotenv", "Load .env before running.")
|
31
32
|
options.on("-g", "--generate", "Generate a new chatterbot with ./ruboty/ directory if specified.")
|
32
33
|
options.on("-h", "--help", "Display this help message.")
|
33
34
|
if Slop::VERSION >= "4.0.0"
|
34
35
|
options.string("-l", "--load", "Load a ruby file before running.")
|
36
|
+
options.string("--pid", "Write the PID to a file.")
|
35
37
|
else
|
36
38
|
options.on("-l", "--load=", "Load a ruby file before running.")
|
39
|
+
options.on("--pid=", "Write the PID to a file.")
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
data/lib/ruboty/robot.rb
CHANGED
@@ -14,9 +14,11 @@ module Ruboty
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def run
|
17
|
+
daemon
|
17
18
|
dotenv
|
18
19
|
bundle
|
19
20
|
setup
|
21
|
+
pid
|
20
22
|
remember
|
21
23
|
handle
|
22
24
|
adapt
|
@@ -69,6 +71,10 @@ module Ruboty
|
|
69
71
|
end
|
70
72
|
memoize :env
|
71
73
|
|
74
|
+
def daemon
|
75
|
+
Process.daemon(true, false) if options[:daemon]
|
76
|
+
end
|
77
|
+
|
72
78
|
def dotenv
|
73
79
|
Dotenv.load if options[:dotenv]
|
74
80
|
end
|
@@ -89,5 +95,13 @@ module Ruboty
|
|
89
95
|
def handle
|
90
96
|
handlers
|
91
97
|
end
|
98
|
+
|
99
|
+
def pid
|
100
|
+
path = options[:pid]
|
101
|
+
if path
|
102
|
+
File.open(path, "w") { |f| f.write(Process.pid) }
|
103
|
+
at_exit { File.unlink(path) }
|
104
|
+
end
|
105
|
+
end
|
92
106
|
end
|
93
107
|
end
|
data/lib/ruboty/version.rb
CHANGED
data/ruboty.gemspec
CHANGED
@@ -16,12 +16,13 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.required_ruby_version = ">= 2.2.2"
|
20
|
+
|
19
21
|
spec.add_dependency "activesupport"
|
20
22
|
spec.add_dependency "bundler"
|
21
23
|
spec.add_dependency "dotenv"
|
22
24
|
spec.add_dependency "mem"
|
23
25
|
spec.add_dependency "slop"
|
24
|
-
spec.add_development_dependency "codeclimate-test-reporter", ">= 0.3.0"
|
25
26
|
spec.add_development_dependency "rake"
|
26
27
|
spec.add_development_dependency "rspec", "3.4.0"
|
27
28
|
spec.add_development_dependency "simplecov"
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: codeclimate-test-reporter
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.3.0
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.3.0
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
190
|
requirements:
|
205
191
|
- - ">="
|
206
192
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
193
|
+
version: 2.2.2
|
208
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
195
|
requirements:
|
210
196
|
- - ">="
|
@@ -212,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
198
|
version: '0'
|
213
199
|
requirements: []
|
214
200
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.4.5
|
201
|
+
rubygems_version: 2.4.5.1
|
216
202
|
signing_key:
|
217
203
|
specification_version: 4
|
218
204
|
summary: Ruby + Bot = Ruboty
|
@@ -228,4 +214,3 @@ test_files:
|
|
228
214
|
- spec/ruboty/handlers/whoami_spec.rb
|
229
215
|
- spec/ruboty/robot_spec.rb
|
230
216
|
- spec/spec_helper.rb
|
231
|
-
has_rdoc:
|