ellen 0.2.0 → 0.2.1
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 +5 -4
- data/lib/ellen/adapters/shell.rb +26 -1
- data/lib/ellen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c8e55b016da34e8e4622037576cac6b5b0d49b7
|
4
|
+
data.tar.gz: e38187259a56eee39b424887ca70f3fd48f66796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdb3fafc81a45d22adfde66879951a963e448f6d5dbea8a20a6623eb4da9459a16b901dc091ae4af17b1a8f584bc7a7f118e0b41d2463dd2bec62fc4285b971f
|
7
|
+
data.tar.gz: 39a99e650063c1c41621f4591e13ba7bae05f7804300b5859a2dc45be520fed50d2ac08e31e5804e9b2e2d1ce4bdd8f3269590ebfea111fd9d2aaee099dbd7b6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,11 +8,11 @@ A chatterbot framework, inspired by Hubot.
|
|
8
8
|
## Adapter
|
9
9
|
Adapter hooks up your robot to chat services.
|
10
10
|
|
11
|
+
* [Ellen::Adapters::Hipchat](https://github.com/r7kamura/ellen-hipchat)
|
12
|
+
* [Ellen::Adapters::Idobata](https://github.com/hanachin/ellen-idobata)
|
11
13
|
* [Ellen::Adapters::Shell](https://github.com/r7kamura/ellen/blob/master/lib/ellen/adapters/shell.rb)
|
12
14
|
* [Ellen::Adapters::Slack](https://github.com/r7kamura/ellen-slack)
|
13
|
-
* [Ellen::Adapters::Hipchat](https://github.com/r7kamura/ellen-hipchat)
|
14
15
|
* [Ellen::Adapters::Twitter](https://github.com/r7kamura/ellen-twitter)
|
15
|
-
* [Ellen::Adapters::Idobata](https://github.com/hanachin/ellen-idobata)
|
16
16
|
|
17
17
|
## Brain
|
18
18
|
Brain persists your robot's memory.
|
@@ -23,10 +23,11 @@ Brain persists your robot's memory.
|
|
23
23
|
## Handler
|
24
24
|
Handler provides various behaviors to your robot.
|
25
25
|
|
26
|
-
* [Ellen::Handlers::Help](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/help.rb)
|
27
|
-
* [Ellen::Handlers::Ping](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/ping.rb)
|
28
26
|
* [Ellen::Handlers::Cron](https://github.com/r7kamura/ellen-cron)
|
27
|
+
* [Ellen::Handlers::Github](https://github.com/r7kamura/ellen-github)
|
29
28
|
* [Ellen::Handlers::GoogleImage](https://github.com/r7kamura/ellen-google_image)
|
29
|
+
* [Ellen::Handlers::Help](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/help.rb)
|
30
|
+
* [Ellen::Handlers::Ping](https://github.com/r7kamura/ellen/blob/master/lib/ellen/handlers/ping.rb)
|
30
31
|
|
31
32
|
## Configuration
|
32
33
|
Store configuration value in envorinment variables.
|
data/lib/ellen/adapters/shell.rb
CHANGED
@@ -11,6 +11,11 @@ module Ellen
|
|
11
11
|
|
12
12
|
attr_accessor :stopped
|
13
13
|
|
14
|
+
def initialize(*args)
|
15
|
+
super
|
16
|
+
remember
|
17
|
+
end
|
18
|
+
|
14
19
|
def run
|
15
20
|
explain
|
16
21
|
listen
|
@@ -27,7 +32,9 @@ module Ellen
|
|
27
32
|
end
|
28
33
|
|
29
34
|
def read
|
30
|
-
Readline.readline(PROMPT, true)
|
35
|
+
Readline.readline(PROMPT, true).tap do |line|
|
36
|
+
history_file.puts(line)
|
37
|
+
end
|
31
38
|
end
|
32
39
|
|
33
40
|
def listen
|
@@ -52,6 +59,24 @@ module Ellen
|
|
52
59
|
def stop
|
53
60
|
self.stopped = true
|
54
61
|
end
|
62
|
+
|
63
|
+
def remember
|
64
|
+
if history_pathname.exist?
|
65
|
+
history_pathname.each_line do |line|
|
66
|
+
Readline::HISTORY << line.rstrip
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def history_pathname
|
72
|
+
@history_pathname ||= Pathname.new("~/.ellen_history").expand_path
|
73
|
+
end
|
74
|
+
|
75
|
+
def history_file
|
76
|
+
@history_file ||= history_pathname.open("a").tap do |file|
|
77
|
+
file.sync = true
|
78
|
+
end
|
79
|
+
end
|
55
80
|
end
|
56
81
|
end
|
57
82
|
end
|
data/lib/ellen/version.rb
CHANGED