ruboty 1.0.1 → 1.0.2

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: a038fffc4592b923af64cc66d79d9920dc2ec408
4
- data.tar.gz: c4d0de62fdf86a964aecacf4e43bafe60bc6dfb9
3
+ metadata.gz: 9e6320c42e2a7e8bbdc0ce9b8e5ac491c5f06769
4
+ data.tar.gz: 7183e2a4318890db1b0e2267061208a575513e94
5
5
  SHA512:
6
- metadata.gz: 207e465a1581eb2ef59684c889e9a53318793da68b3ba81f891033a32f94d6e1bae38f880c3dc0e7d3467ffae9c924d5f7663a794cde17378ad136523167f159
7
- data.tar.gz: 23ca966528eed7cd2ec7352db7ff8b7abea4c32cdd9750a13147954ca67776d568b8da2f6423c151207ad438be68edb133276365df8658443db0c83f17272d5e
6
+ metadata.gz: 825ab8fc29e11b4bc6a1ac3cb7e5c6623378b99d9700978c7254803d155eb065b2b4653e40392bc9dbe703342c0c9e376b402aa1d498d04bc942aede679c4c3f
7
+ data.tar.gz: 024ca628947aaefb36af48191524d6a3a32ce1ef6614b5d8fe95985d78f8ca40f1d5188ede016fea8fe806a1bcc64de34dd0419b9ea526a314fe7e4f7619f9f2
@@ -1,3 +1,6 @@
1
+ ## 1.0.2
2
+ * Add RUBOTY_ENV to change bundled gems with environment
3
+
1
4
  ## 1.0.1
2
5
  * Ignore if no Gemfile found in current directory or given path
3
6
 
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://rubygesm.org"' >> Gemfile
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ruboty
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-01 00:00:00.000000000 Z
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport