ellen 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29ad3aa6bd8349d58077ff020f9bea37e7fca57b
4
- data.tar.gz: b37cbe10c8c7878b2b3a7b036b64b4307128c1c6
3
+ metadata.gz: 1257d785b8002b44123966764bc1fe93e87f854c
4
+ data.tar.gz: 94c83b8ab5999c51c3d4685824d345d58e2dce51
5
5
  SHA512:
6
- metadata.gz: 6ec91fd6d9acf7d972d68d4493f5cfb058671361a47e6eee34b7f909d2c489c546b4691b195a619f15f851cb2e03444eb9c4152bfebb7532123c5ab0299892dc
7
- data.tar.gz: ee94c91e91fc28f5188810ad31b35947c239f32445119dd7c91173976e05bbb005fcfbabfa3f95a3d674dd1b37bd4c4111ad6e981a9d94ddbfecf6ffd5028191
6
+ metadata.gz: 8096e060eb4f008cfb5d4c5d71f185c4db34f33488d98e9d0608054b00420038b3c78e92c6e1f9d96b29865f7ff3c4e4502574b995dfff9c7752511c0de107a2
7
+ data.tar.gz: 58a0ed4737904956f866ee1b6138cec656cdefe4f345ae9f349e4c08ad200b8b1686e540a1c5dd757295b978c2341fadf27ab25b7894c54912b6daa53376cc0d
@@ -1,3 +1,6 @@
1
+ ## 0.0.4
2
+ * Add --dotenv option to load .env before running
3
+
1
4
  ## 0.0.3
2
5
  * Add env DSL to define adapter
3
6
 
data/README.md CHANGED
@@ -7,11 +7,40 @@ A chatterbot framework, inspired by Hubot.
7
7
  ## Usage
8
8
  ```sh
9
9
  $ gem install ellen # Install `ellen` gem to your local machine
10
+ $ ellen --help # Show usage with --help
11
+ Usage: ellen [options]
12
+ -a, --adapter Take adapter name.
13
+ --dotenv Load .env before running.
14
+ -g, --generate Generate a new chatterbot with ./ellen/ directory if specified.
15
+ -l, --load Load a ruby file before running.
16
+ -h, --help Display this help message.
10
17
  $ ellen --generate # Generate your new chatterbot with ./ellen/ directory
11
- $ cd ellen # Changes to ./ellen/
12
- $ vi Gemfile # Adds your favorite plugin gems
18
+ $ cd ellen # Change to ./ellen/
19
+ $ vi Gemfile # Add your favorite plugin gems
13
20
  $ bundle exec ellen --adapter=shell # Run your chatterbot with specified adapter
14
21
  ```
15
22
 
16
- ## Adapters
17
- * [ellen-hipchat](https://github.com/r7kamura/ellen-hipchat)
23
+ ## Adapter
24
+ You can create your own favorite adapter from
25
+ [Ellen::Adpaters::Base](https://github.com/r7kamura/ellen/blob/master/lib/ellen/adapters/base.rb)
26
+ class with #run method. Please see the following real examples for more details.
27
+
28
+ * [Ellen::Adapters::Hipchat](https://github.com/r7kamura/ellen-hipchat/blob/master/lib/ellen/adapters/hipchat.rb)
29
+ * [Ellen::Adapters::Shell](https://github.com/r7kamura/ellen/blob/master/lib/ellen/adapters/shell.rb)
30
+
31
+ ## Handler
32
+ You can create your own handlers to add new behaviors from
33
+ [Ellen::Handlers::Base](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/base.rb) DSL.
34
+
35
+ * [Ellen::Handlers::Help](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/help.rb)
36
+
37
+ ## Bundler
38
+ All you need to use your favorite plugins is to write their names into Gemfile.
39
+ Ellen will load them before running.
40
+
41
+ ```ruby
42
+ # Gemfile
43
+ gem "ellen-foo"
44
+ gem "ellen-bar"
45
+ gem "ellen-baz"
46
+ ```
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_dependency "activesupport"
20
20
  spec.add_dependency "bundler"
21
+ spec.add_dependency "dotenv"
21
22
  spec.add_dependency "mem"
22
23
  spec.add_dependency "slop"
23
24
  spec.add_development_dependency "pry"
@@ -1,6 +1,7 @@
1
1
  require "active_support/core_ext/module/delegation"
2
2
  require "active_support/core_ext/string/inflections"
3
3
  require "bundler"
4
+ require "dotenv"
4
5
  require "mem"
5
6
  require "slop"
6
7
 
@@ -21,6 +21,7 @@ module Ellen
21
21
  def options
22
22
  Slop.parse!(arguments, help: true) do
23
23
  on("a", "adapter=", "Take adapter name.")
24
+ on("dotenv", "Load .env before running.")
24
25
  on("g", "generate", "Generate a new chatterbot with ./ellen/ directory if specified.")
25
26
  on("l", "load=", "Load a ruby file before running.")
26
27
  end.to_hash
@@ -11,6 +11,7 @@ module Ellen
11
11
  end
12
12
 
13
13
  def run
14
+ dotenv
14
15
  bundle
15
16
  setup
16
17
  validate
@@ -39,6 +40,10 @@ module Ellen
39
40
  Bundler.require
40
41
  end
41
42
 
43
+ def dotenv
44
+ Dotenv.load if options[:dotenv]
45
+ end
46
+
42
47
  def setup
43
48
  load(options[:load]) if options[:load]
44
49
  end
@@ -1,3 +1,3 @@
1
1
  module Ellen
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ellen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dotenv
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: mem
43
57
  requirement: !ruby/object:Gem::Requirement