nutcracker 0.2.4.11 → 0.2.4.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjdhMzQwMTk4ZjkyODliOTQ3MTVkOGY5YTZhNjM0NWJlNzAzYzA1Yw==
4
+ YjMwZTc4ZGQ3NmQ1MTk5YzViYTAwMDJkZWJmOWU4YWE5NTQ4MWQ1OQ==
5
5
  data.tar.gz: !binary |-
6
- NTkyNDQ1ZjJlOWFmNTA3YTNkYjllN2EwOTE0Mjk2MjY3NTA2ZGIxYw==
6
+ NjJmMWRiODY4YWRhN2I2NjdlMjk1MjBhMGRmMGVjNGNhZWRmYWY0Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODAwNTgzYWFkMzZkMjhlYWU4YjBlZmIwOTUyMjE3ODU5NzA4YTYwMWI3YjIw
10
- ODFmMzBlYzBhNmYzNjIxYWY2MDAzNjdiMDUzNTM2M2ZjMmZkNzllYjY1YzMx
11
- ODRjODUyZmIwMDc0N2I2ZWQ1MjI2ZWNhZTVjNTAxNDU4N2U1YWU=
9
+ YjRkNDE0MTZmMmRlNmYyNWQxYmEyNjExNmU5Y2M1ODkwZGYwYmVjMWE0NTU3
10
+ MTI5OGVmODRkNGU2MjY1Zjg0ZmZiYTg5ZGE1Mzg1MDczODA4OTJkMGIzYzcw
11
+ NjQzNzAyODczYjdhOTkwOGM3YmFkMmU3NWFmY2MxODE4ZjdkN2U=
12
12
  data.tar.gz: !binary |-
13
- NDY2ZmZlOWQzYTdiMTA5ZGM4ZGJiYjRjZjdkYWQwYjUzMWQzOWVlZDJjMzVk
14
- N2JkNGZjMTEwM2E5ODA3ODliNWU3YzE0NTA0YTU1NGM2ZjY1M2VhN2UwYjJm
15
- NWYyY2YwOWI5NzQ5YTY2OWJhZWZlNmZjZWUxNGEyYmQ3MWU5MGU=
13
+ NDY2MWExOThjZjQxYTM0ZjBhZmMwMjI5YzI1NzViMTlkNmRiNjNhY2VlN2Ri
14
+ MGFmMWQ3ZGVhZDM3Mjg3MWY3ZDYwYjUwZGYzMTJiMjRjMzY3NTgzZjg5OTg1
15
+ MTViODBjN2JhMjJmNDFjYzUxZGNiMzNjYjU5MTJjMTZiNDViNGE=
@@ -48,14 +48,16 @@ module Nutcracker
48
48
  def start *args
49
49
  return self if attached? or running?
50
50
  @pid = ::Process.spawn Nutcracker.executable, *command
51
- timeout(5) { sleep 0.1 until running? }
51
+ Process.detach(@pid)
52
+ sleep 2
53
+ abort "Nutcracker failed to start" unless running?
52
54
  Kernel.at_exit { kill if running? }
53
55
  self
54
56
  end
55
57
 
56
58
  # Returns the current running status
57
59
  def running?
58
- stats.any?
60
+ attached? ? stats.any? : !!(pid and ::Process.getpgid pid rescue nil)
59
61
  end
60
62
 
61
63
  # Returns true if the current instance was initialize with the attached flag
@@ -75,7 +77,7 @@ module Nutcracker
75
77
 
76
78
  # Wait for the process to exit
77
79
  def join
78
- attached? ? sleep : (running! and ::Process.waitpid2 pid)
80
+ attached? ? sleep : (running! and ::Process.waitpid2 pid rescue nil)
79
81
  end
80
82
 
81
83
  # Returns Nutcracker's configuration hash
@@ -1,3 +1,3 @@
1
1
  module Nutcracker
2
- VERSION = "0.2.4.11"
2
+ VERSION = "0.2.4.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutcracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.11
4
+ version: 0.2.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eran Barak Levi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-07 00:00:00.000000000 Z
11
+ date: 2013-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -213,8 +213,7 @@ homepage: http://www.kontera.com
213
213
  licenses: []
214
214
  metadata: {}
215
215
  post_install_message:
216
- rdoc_options:
217
- - --no-private --protected lib/**/*.rb - README.md
216
+ rdoc_options: []
218
217
  require_paths:
219
218
  - lib
220
219
  required_ruby_version: !ruby/object:Gem::Requirement