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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7632e618c8546962cbe7c6dc8bb6c8f1622a75e
4
- data.tar.gz: e0892a3d514bd92263803f65391c72b38a3cb6a0
3
+ metadata.gz: 9c8e55b016da34e8e4622037576cac6b5b0d49b7
4
+ data.tar.gz: e38187259a56eee39b424887ca70f3fd48f66796
5
5
  SHA512:
6
- metadata.gz: 3b1a73b5c3d1ea5faf6596b2cc24562982d86fbb82980cdbac95524f43af3efb1bdc996476d30c86d557e44f3ddb4ec57a42aba68345238747edefd566a2b92b
7
- data.tar.gz: 432256a6c72779709dd78553ad2991af954c152abafb064b9cdb108ded299104d1b8b3c21d4eecd76b3e4b5ea31b1fca4bf034b343ab0c0f575608a07837c37c
6
+ metadata.gz: cdb3fafc81a45d22adfde66879951a963e448f6d5dbea8a20a6623eb4da9459a16b901dc091ae4af17b1a8f584bc7a7f118e0b41d2463dd2bec62fc4285b971f
7
+ data.tar.gz: 39a99e650063c1c41621f4591e13ba7bae05f7804300b5859a2dc45be520fed50d2ac08e31e5804e9b2e2d1ce4bdd8f3269590ebfea111fd9d2aaee099dbd7b6
@@ -1,3 +1,6 @@
1
+ ## 0.2.1
2
+ * Store shell history in ~/.ellen_history
3
+
1
4
  ## 0.2.0
2
5
  * Change adapter & message interface
3
6
 
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.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ellen
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura