sad 1.1.0 → 1.2.0
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.
- data/README.md +1 -7
- data/VERSION +1 -1
- data/lib/sad/config.rb +3 -16
- data/sad.gemspec +1 -1
- metadata +2 -2
data/README.md
CHANGED
|
@@ -60,13 +60,7 @@ require "sad/tasks"
|
|
|
60
60
|
配置redis:
|
|
61
61
|
|
|
62
62
|
```ruby
|
|
63
|
-
|
|
64
|
-
:host => 'localhost',
|
|
65
|
-
:port => 6379,
|
|
66
|
-
:db => 0,
|
|
67
|
-
:password => '******'
|
|
68
|
-
}
|
|
69
|
-
Sad::Config.redis = opts
|
|
63
|
+
Sad::Config.redis = "redis://:secretpassword@example.com:9000/4"
|
|
70
64
|
Sad::Config.namespace = 'MyBackgroundJobQueue'
|
|
71
65
|
```
|
|
72
66
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.2.0
|
data/lib/sad/config.rb
CHANGED
|
@@ -9,25 +9,12 @@ module Sad
|
|
|
9
9
|
@_namespace || 'SadQueue'
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def
|
|
13
|
-
|
|
14
|
-
:host => 'localhost',
|
|
15
|
-
:port => 6379,
|
|
16
|
-
:db => 0
|
|
17
|
-
}.update inopts.dup
|
|
18
|
-
if opts[:password]
|
|
19
|
-
url = "redis://#{opts[:password]}@#{opts[:host]}:#{opts[:port]}/#{opts[:db]}"
|
|
20
|
-
else
|
|
21
|
-
url = "redis://#{opts[:host]}:#{opts[:port]}/#{opts[:db]}"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def redis=(opts={})
|
|
26
|
-
@_redis = EM::Hiredis.connect default_rds_opts(opts)
|
|
12
|
+
def redis=(uri)
|
|
13
|
+
@_redis = EM::Hiredis.connect uri
|
|
27
14
|
end
|
|
28
15
|
|
|
29
16
|
def redis
|
|
30
|
-
@_redis
|
|
17
|
+
@_redis ||= EM::Hiredis.connect
|
|
31
18
|
end
|
|
32
19
|
end
|
|
33
20
|
end
|
data/sad.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sad
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -132,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
132
132
|
version: '0'
|
|
133
133
|
segments:
|
|
134
134
|
- 0
|
|
135
|
-
hash:
|
|
135
|
+
hash: 3356041191321636741
|
|
136
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
none: false
|
|
138
138
|
requirements:
|