ellen-redis 0.0.1 → 0.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: 8cd9c91e8568e0703999da543f8dab5660fe6dd0
4
- data.tar.gz: 6f66b0684c0151e34ea5a0e07eaf89036e8a9a8f
3
+ metadata.gz: 7f4bf8ec90a1d2d6af4231688e49b2c27012b600
4
+ data.tar.gz: 3f6aed1e0833cb70dc57f8462bb1f5e081ff7402
5
5
  SHA512:
6
- metadata.gz: 6d2b221ca98e278d6e53cc227cc4ed6049aa49866aafaca823dde9886a5cea7bc4adb3a45fef07e43ecba22a13a7756e023c72293d9bba2ea240694cfb060b9c
7
- data.tar.gz: 466f52e27e4e8faae9399588ee6f37b3079aa8a2e5cb5f97b1237c21efb7bb9fc4870d116777a7e552a953006dc51843c38fd0b9f75d380b5d23427340a2352f
6
+ metadata.gz: 03275c5e89dcaf93ec0b61773821c5f9c474277afb15c634115c32e08dd7e310e4a4cd49ed982153720540548d171145a1c14eb0a09e02cc1305089b09ba80ee
7
+ data.tar.gz: 2b99469cc849ea16c0cdc03af653284bf385792205394c0c094fb12ba79b775c3fbe0e146ba736cec7e791b2ba358eeb4cf25e4ca384f522d61b980057843f9c
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## 0.0.2
2
+ * Fix data import :bug:
3
+
4
+ ## 0.0.1
5
+ * 1st Release
data/README.md CHANGED
@@ -2,4 +2,7 @@
2
2
  Store Ellen's memory in Redis.
3
3
 
4
4
  ## ENV
5
- * REDIS_URL - URL to access redis server
5
+ ```
6
+ REDIS_URL - Redis URL (e.g. redis://foo:bar@example.com:6379/)
7
+ REDIS_SAVE_INTERVAL - Interval sec to push data to Redis (default: 5)
8
+ ```
@@ -11,22 +11,19 @@ module Ellen
11
11
 
12
12
  attr_reader :thread
13
13
 
14
- env :REDIS_URL, "Redis URL (e.g. redis://foo:bar@example.com:6379/"
14
+ env :REDIS_URL, "Redis URL (e.g. redis://foo:bar@example.com:6379/)"
15
15
  env :REDIS_SAVE_INTERVAL, "Interval sec to push data to Redis (default: 5)", optional: true
16
16
 
17
17
  def initialize
18
18
  super
19
19
  @thread = Thread.new { sync }
20
+ @thread.abort_on_exception = true
20
21
  end
21
22
 
22
23
  def data
23
24
  @data ||= pull || {}
24
25
  end
25
26
 
26
- def save
27
- push
28
- end
29
-
30
27
  private
31
28
 
32
29
  def push
@@ -34,15 +31,15 @@ module Ellen
34
31
  end
35
32
 
36
33
  def pull
37
- if value = client.get(KEY)
38
- JSON.parse(value)
34
+ if data = client.get(KEY)
35
+ JSON.parse(data)
39
36
  end
40
37
  end
41
38
 
42
39
  def sync
43
40
  loop do
44
41
  wait
45
- save
42
+ push
46
43
  end
47
44
  end
48
45
 
@@ -1,5 +1,5 @@
1
1
  module Ellen
2
2
  module Redis
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ellen-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
+ - CHANGELOG.md
91
92
  - Gemfile
92
93
  - LICENSE.txt
93
94
  - README.md