sad 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +1 -7
  2. data/VERSION +1 -1
  3. data/lib/sad/config.rb +3 -16
  4. data/sad.gemspec +1 -1
  5. metadata +2 -2
data/README.md CHANGED
@@ -60,13 +60,7 @@ require "sad/tasks"
60
60
  配置redis:
61
61
 
62
62
  ```ruby
63
- opts = {
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.0
1
+ 1.2.0
@@ -9,25 +9,12 @@ module Sad
9
9
  @_namespace || 'SadQueue'
10
10
  end
11
11
 
12
- def default_rds_opts(inopts={})
13
- opts = {
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 || EM::Hiredis.connect
17
+ @_redis ||= EM::Hiredis.connect
31
18
  end
32
19
  end
33
20
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sad"
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["\u{5d14}\u{5ce5}"]
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.1.0
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: -705114699202338873
135
+ hash: 3356041191321636741
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements: