redis_test 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/redis_test/version.rb +1 -1
- data/lib/redis_test.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55ab6f31db17b027ebc1a37bc89197fd0a011a6e
|
4
|
+
data.tar.gz: a2ca84286badc1a3f94b3126fc24045914b82d63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fccb7e8a95651a16dbb71540c73854a493abc8d4767edaa61d9c7a6e2a74d0a2017fb63753ad79a083700e0ee3deb2905d61763598d5d793ead61f93c2735d5
|
7
|
+
data.tar.gz: d2ae3ef7109de80e154979e89a97751895f3c10b336ae44c8f80279906c95f6b936a2bd7c7843682f0e623233e899fe501149c7e29e82b27136ab74b48831a52
|
data/README.md
CHANGED
@@ -82,6 +82,11 @@ that use Redis
|
|
82
82
|
You can start multiple instances of redis in parallel by rotating
|
83
83
|
`ENV['TEST_REDIS_PORT']`
|
84
84
|
|
85
|
+
## Log information
|
86
|
+
All log will be available at log/redis.PORT.log
|
87
|
+
The default log level is `debug`, which will dump a lot of log.
|
88
|
+
Customize your loglevel by setting RedisTest.loglevel to `debug`, `verbose`,
|
89
|
+
`notice` or `warning`. See https://raw.githubusercontent.com/antirez/redis/2.8/redis.conf for explanation regarding redis log level
|
85
90
|
## Contributing
|
86
91
|
|
87
92
|
1. Fork it
|
data/lib/redis_test/version.rb
CHANGED
data/lib/redis_test.rb
CHANGED
@@ -22,6 +22,18 @@ module RedisTest
|
|
22
22
|
"#{pids_path}/redis-test-#{port}.pid"
|
23
23
|
end
|
24
24
|
|
25
|
+
def logfile
|
26
|
+
"#{Rails.root}/log/redis.#{port}.log"
|
27
|
+
end
|
28
|
+
|
29
|
+
def loglevel
|
30
|
+
@loglevel || "debug"
|
31
|
+
end
|
32
|
+
|
33
|
+
def loglevel=(level)
|
34
|
+
@loglevel = level
|
35
|
+
end
|
36
|
+
|
25
37
|
def start
|
26
38
|
FileUtils.mkdir_p cache_path
|
27
39
|
FileUtils.mkdir_p pids_path
|
@@ -29,15 +41,16 @@ module RedisTest
|
|
29
41
|
redis_options = {
|
30
42
|
"daemonize" => 'yes',
|
31
43
|
"pidfile" => pidfile,
|
44
|
+
"logfile" => logfile,
|
32
45
|
"port" => port,
|
33
46
|
"timeout" => 300,
|
34
47
|
"dbfilename" => db_filename,
|
35
48
|
"dir" => cache_path,
|
49
|
+
"loglevel" => loglevel,
|
36
50
|
"databases" => 16
|
37
51
|
}.map { |k, v| "#{k} #{v}" }.join('\n')
|
38
52
|
`echo '#{redis_options}' | redis-server -`
|
39
53
|
|
40
|
-
|
41
54
|
wait_time_remaining = 5
|
42
55
|
begin
|
43
56
|
socket = TCPSocket.open("localhost", port)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phuong Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|