ruboty 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +26 -1
- data/lib/ruboty/robot.rb +7 -1
- data/lib/ruboty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e6320c42e2a7e8bbdc0ce9b8e5ac491c5f06769
|
4
|
+
data.tar.gz: 7183e2a4318890db1b0e2267061208a575513e94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825ab8fc29e11b4bc6a1ac3cb7e5c6623378b99d9700978c7254803d155eb065b2b4653e40392bc9dbe703342c0c9e376b402aa1d498d04bc942aede679c4c3f
|
7
|
+
data.tar.gz: 024ca628947aaefb36af48191524d6a3a32ce1ef6614b5d8fe95985d78f8ca40f1d5188ede016fea8fe806a1bcc64de34dd0419b9ea526a314fe7e4f7619f9f2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,7 @@ Ruby + Bot = Ruboty.
|
|
9
9
|
Adapter hooks up your robot to chat services.
|
10
10
|
|
11
11
|
* [ruboty-hipchat](https://github.com/r7kamura/ruboty-hipchat)
|
12
|
+
* [ruboty-idobata](https://github.com/hanachin/ruboty-idobata)
|
12
13
|
* [ruboty-slack](https://github.com/r7kamura/ruboty-slack)
|
13
14
|
* [ruboty-twitter](https://github.com/r7kamura/ruboty-twitter)
|
14
15
|
|
@@ -24,6 +25,7 @@ Handler provides various behaviors to your robot.
|
|
24
25
|
* [ruboty-cron](https://github.com/r7kamura/ruboty-cron)
|
25
26
|
* [ruboty-github](https://github.com/r7kamura/ruboty-github)
|
26
27
|
* [ruboty-google_image](https://github.com/r7kamura/ruboty-google_image)
|
28
|
+
* [ruboty-lgtm](https://github.com/negipo/ruboty-lgtm)
|
27
29
|
* [ruboty-syoboi_calendar](https://github.com/r7kamura/ruboty-syoboi_calendar)
|
28
30
|
|
29
31
|
## Configuration
|
@@ -42,11 +44,34 @@ gem "ruboty-redis"
|
|
42
44
|
gem "ruboty-slack"
|
43
45
|
```
|
44
46
|
|
47
|
+
## Environment
|
48
|
+
Ruboty has global environment configuration like `Rails.env`.
|
49
|
+
You can specify Ruboty environment via environment variables:
|
50
|
+
|
51
|
+
```shell
|
52
|
+
RUBOTY_ENV=production bundle exec ruboty
|
53
|
+
```
|
54
|
+
|
55
|
+
Ruboty only loads dependent gems group by current environment.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
# Gemfile
|
59
|
+
group :development do
|
60
|
+
gem "ruboty" # For development shell console
|
61
|
+
end
|
62
|
+
|
63
|
+
group :production do
|
64
|
+
gem "ruboty-slack" # For production adapter
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
The default Ruboty environment is `development`.
|
69
|
+
|
45
70
|
## Deploy
|
46
71
|
Here is the smallest example to deploy a simple chatterbot to Heroku.
|
47
72
|
|
48
73
|
```sh
|
49
|
-
$ echo 'source "https://
|
74
|
+
$ echo 'source "https://rubygems.org"' >> Gemfile
|
50
75
|
$ echo 'gem "ruboty"' >> Gemfile
|
51
76
|
$ echo 'bot: bundle exec ruboty' >> Procfile
|
52
77
|
$ bundle install
|
data/lib/ruboty/robot.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Ruboty
|
2
2
|
class Robot
|
3
|
+
DEFAULT_ENV = "development"
|
3
4
|
DEFAULT_ROBOT_NAME = "ruboty"
|
4
5
|
|
5
6
|
include Mem
|
@@ -49,10 +50,15 @@ module Ruboty
|
|
49
50
|
memoize :adapter
|
50
51
|
|
51
52
|
def bundle
|
52
|
-
Bundler.require
|
53
|
+
Bundler.require(:default, env)
|
53
54
|
rescue Bundler::GemfileNotFound
|
54
55
|
end
|
55
56
|
|
57
|
+
def env
|
58
|
+
ENV["RUBOTY_ENV"] || DEFAULT_ENV
|
59
|
+
end
|
60
|
+
memoize :env
|
61
|
+
|
56
62
|
def dotenv
|
57
63
|
Dotenv.load if options[:dotenv]
|
58
64
|
end
|
data/lib/ruboty/version.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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|