fake_go_up 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fake_go_up.gemspec +1 -1
- data/lib/fake_go_up/version.rb +1 -1
- data/lib/fake_go_up.rb +7 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cca1ff6ff1accf77506aa08deb0f82bbf79d96ec
|
4
|
+
data.tar.gz: 32d4c79f084a4363a821312ccc86d2bfc850e4a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 527a08987cde9dfdd43e8c09cc2c67e3c27c4e1710d4a56d3fd6b9e3e1f26b9a0872ce88c25b5ce0abf694ff9eeb7b4df6a3780c1622566cfbe5e921194651b4
|
7
|
+
data.tar.gz: 337bfda306f64d4c52ab4c7adb4b4658fdc350defb6c91509d10266b56534195eaf5f5949133e9ff28fe13c0752a81e2ac62c75f9829fcb41df64a6068ab1cc0
|
data/fake_go_up.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_dependency "pid_lock", "~> 0.
|
24
|
+
spec.add_dependency "pid_lock", "~> 0.1"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.10"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/fake_go_up/version.rb
CHANGED
data/lib/fake_go_up.rb
CHANGED
@@ -1,23 +1,28 @@
|
|
1
1
|
require "fake_go_up/version"
|
2
2
|
require "fake_go_up/task"
|
3
3
|
require "pid_lock"
|
4
|
+
Dir["lib/voters/*.rb"].each {|file| load file }
|
4
5
|
|
5
6
|
module FakeGoUp
|
6
7
|
@@redis = nil
|
8
|
+
DEFAULT_PID_NAME = "FakeGoUp"
|
7
9
|
|
8
10
|
class << self
|
9
11
|
def redis=(conn)
|
10
12
|
@@redis = conn
|
11
13
|
end
|
12
14
|
|
13
|
-
def run
|
14
|
-
pid_name = "FakeGoUp"
|
15
|
+
def run(pid_name = DEFAULT_PID_NAME)
|
15
16
|
return if PidLock.locked?(pid_name)
|
16
17
|
PidLock.lock(pid_name)
|
17
18
|
_run
|
18
19
|
PidLock.unlock(pid_name)
|
19
20
|
end
|
20
21
|
|
22
|
+
def stop(pid_name = DEFAULT_PID_NAME)
|
23
|
+
PidLock.stop(pid_name)
|
24
|
+
end
|
25
|
+
|
21
26
|
def _run
|
22
27
|
tasks = FakeGoUp::Task.subclasses.map(&:new)
|
23
28
|
while true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_go_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xuxiangyang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pid_lock
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|