sponges 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,7 +13,7 @@ Internally, `sponges` strongly relies on Unix signals.
13
13
 
14
14
  ## Production ready ?
15
15
 
16
- Not yet, but soon.
16
+ Not yet, but soon. Beware, api can change in 0.0.x.
17
17
 
18
18
  ## Installation
19
19
 
@@ -3,8 +3,8 @@ require 'boson/runner'
3
3
  require 'socket'
4
4
  require 'logger'
5
5
  require 'nest'
6
+ require 'machine'
6
7
  require_relative 'sponges/configuration'
7
- require_relative 'sponges/cpu_infos'
8
8
  require_relative 'sponges/worker_builder'
9
9
  require_relative 'sponges/supervisor'
10
10
  require_relative 'sponges/runner'
@@ -38,7 +38,7 @@ module Sponges
38
38
 
39
39
  def default_options
40
40
  {
41
- size: CpuInfo.cores_size
41
+ size: Machine::Info::Cpu.cores_size
42
42
  }
43
43
  end
44
44
 
@@ -101,8 +101,8 @@ module Sponges
101
101
 
102
102
  def kill_one(pid, signal)
103
103
  begin
104
- Process.kill signal, pid.to_i
105
104
  @pids.srem pid
105
+ Process.kill signal, pid.to_i
106
106
  Sponges.logger.info "Child #{pid} receive a #{signal} signal."
107
107
  rescue Errno::ESRCH => e
108
108
  # Don't panic
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Sponges
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sponges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,37 +44,37 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
- name: rspec
47
+ name: machine
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ~>
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.10.0
54
- type: :development
53
+ version: '0'
54
+ type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.10.0
61
+ version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: sys-proctable
63
+ name: rspec
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 2.10.0
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 2.10.0
78
78
  description: When I build some worker, I want them to be like an army of spongebob,
79
79
  always stressed and eager to work. sponges helps you to build this army of sponge,
80
80
  to control them, and, well, kill them gracefully.
@@ -90,7 +90,6 @@ files:
90
90
  - lib/sponges/cli.rb
91
91
  - lib/sponges/commander.rb
92
92
  - lib/sponges/configuration.rb
93
- - lib/sponges/cpu_infos.rb
94
93
  - lib/sponges/runner.rb
95
94
  - lib/sponges/supervisor.rb
96
95
  - lib/sponges/version.rb
@@ -1,10 +0,0 @@
1
- # encoding: utf-8
2
- class CpuInfo
3
- # This class concern is to grab some informations about hardware.
4
- #
5
- class << self
6
- def cores_size
7
- `grep -c processor /proc/cpuinfo`.to_i
8
- end
9
- end
10
- end