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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eec75dd6b070d58cfa23e23cd9965e123c639529
4
- data.tar.gz: 71dda2675ad971071222d38768b1ec93a73dbe01
3
+ metadata.gz: cca1ff6ff1accf77506aa08deb0f82bbf79d96ec
4
+ data.tar.gz: 32d4c79f084a4363a821312ccc86d2bfc850e4a3
5
5
  SHA512:
6
- metadata.gz: 5bd610db0b7eb06c5b4cee95c19b0dff163f0b6fd85b4d3879ab3b09250d59fccce8f5309dac6cbafa2e074fd443ea346db516d1598afae3372b263342357459
7
- data.tar.gz: 43225f0a9f0ba6e3d01e5efe6eed677cd1c95c815fa802ed0ac90d987cde20f7f937410c6d1e42ccab8e81072094291c02f496407406d30cf3fe73e5ae6e72b0
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.0.2"
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"
@@ -1,3 +1,3 @@
1
1
  module FakeGoUp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-20 00:00:00.000000000 Z
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.0.2
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.0.2
26
+ version: '0.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement