worker_scoreboard 0.0.3 → 0.0.4

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: 97bae84d1b5c2d98ecc13fe7babd2414b06534a8
4
- data.tar.gz: 1b770230a1a052d3bc6d4c9a40544c5b24d8a969
3
+ metadata.gz: 0f29ecafa714a3e969c3537b3b204b12b72bb652
4
+ data.tar.gz: 44b354d486856a4aabfcd7f5a14ea801da0a87cc
5
5
  SHA512:
6
- metadata.gz: 98a517d540b02b8d11bca78424537d74568dc9fa74b6060149e84286d14bd48c0d0229fafc7e4f01226f3dbd7eae0bd4d07b86365d65d70f010737dba2eaf452
7
- data.tar.gz: caddb30a3d7bbbe5e177914f2a91ec6e4c9d53b58a495eebe0a18ce2c7e1637ed29e1b25c82bbd13984b79a7dd45dd92ddb2c91689a01fc8a37b202e238d8e11
6
+ metadata.gz: 4cf322b8fe1561725c8b6fa3fa330468ad7fcd9ac54cd8d0b5f927e5c37f696e19d2088e37289e13df0b3e3b6ade07a1a0a80cea012ee101bb131b741c68b8e2
7
+ data.tar.gz: 8f8875afaf9c9ec290ddc7779e8cd96a852e01e80c549a910e4bc8e8e4192b789140cce661c2dbdb6cd40a1e83616fb278aa4394eae45ae6d301ca2ec2e1589e
data/README.md CHANGED
@@ -22,9 +22,13 @@ Or install it yourself as:
22
22
 
23
23
  TODO: Write usage instructions here
24
24
 
25
+ ## See Also
26
+
27
+ https://github.com/SpringMT/rack-server_status
28
+
25
29
  ## Contributing
26
30
 
27
- 1. Fork it ( https://github.com/[my-github-username]/worker_scoreboard/fork )
31
+ 1. Fork it ( https://github.com/SpringMT/worker_scoreboard/fork )
28
32
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
33
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
34
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,3 +1,3 @@
1
1
  class WorkerScoreboard
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require "worker_scoreboard/version"
2
2
  require 'digest/md5'
3
+ require 'fileutils'
3
4
 
4
5
  class WorkerScoreboard
5
6
  def initialize(base_dir)
@@ -15,7 +16,7 @@ class WorkerScoreboard
15
16
  ObjectSpace.define_finalizer(self, @clean_proc)
16
17
 
17
18
  unless Dir.exist? @base_dir
18
- Dir.mkdir @base_dir or fail "failed to create directory:#{@base_dir}:#{$!}"
19
+ FileUtils.mkdir_p @base_dir or fail "failed to create directory:#{@base_dir}:#{$!}"
19
20
  end
20
21
  begin
21
22
  File.unlink build_filename
@@ -34,8 +35,8 @@ class WorkerScoreboard
34
35
  tmp_filename = "#{filename}.tmp"
35
36
  f = File.open(tmp_filename, 'wb')
36
37
  f.flush
37
- f.flock File::LOCK_EX or raise "failed to flock LOCK_EX file:#{@fn}.tmp:#{$!}"
38
- File.rename(tmp_filename, filename) or raise "failed to rename file:#{@fn.tmp} to #{@fn}:#{$!}"
38
+ f.flock File::LOCK_EX or raise "failed to flock LOCK_EX file:#{tmp_filename}:#{$!}"
39
+ File.rename(tmp_filename, filename) or raise "failed to rename file:#{tmp_filename} to #{filename}:#{$!}"
39
40
  @fh = f
40
41
  @id_for_fh = worker_id
41
42
  end
@@ -2,7 +2,17 @@ require 'spec_helper'
2
2
  require 'tmpdir'
3
3
 
4
4
  describe WorkerScoreboard do
5
- context do
5
+ describe '.new' do
6
+ context 'For nested directory' do
7
+ let(:base_dir) { File.join(Dir.tmpdir, 'level1', 'level2') }
8
+ subject { WorkerScoreboard.new(base_dir) }
9
+ example do
10
+ expect { subject }.not_to raise_error
11
+ end
12
+ end
13
+ end
14
+
15
+ describe '#update' do
6
16
  let(:base_dir) { Dir.tmpdir }
7
17
  subject { WorkerScoreboard.new(base_dir) }
8
18
  it do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker_scoreboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-21 00:00:00.000000000 Z
11
+ date: 2016-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,11 +92,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '2.0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.2.2
95
+ rubygems_version: 2.5.1
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: a scoreboard for monitoring status of many workers
99
99
  test_files:
100
100
  - spec/spec_helper.rb
101
101
  - spec/worker_scoreboard_spec.rb
102
- has_rdoc: