dorsal 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dorsal/controller.rb +1 -1
- data/lib/dorsal/exceptions.rb +1 -1
- data/lib/dorsal/privates.rb +2 -2
- data/lib/dorsal/version.rb +1 -1
- data/spec/dorsal_spec.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e82d933806e0255c66968fe5f2fe7f701a02a0d
|
4
|
+
data.tar.gz: a27db6a906a821a5e9533b114da2033333c24b9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daeb92cb458fcb8e3a8f9e81a5ebcf508b35b06927653c922bc9064f3811bfb0bcae597f33bb29eb96b8a2d8d97e5203a7aaef45e59bffa6dfd7b72f0ec37028
|
7
|
+
data.tar.gz: 291620ac39e58b59f991599c4bc91c73a18b1997101626162b3094ffa31776078bc853d6d366d1a180b9d187bf84075a700890bff9ebcc50c3ce0df937c4a8f6
|
data/lib/dorsal/controller.rb
CHANGED
data/lib/dorsal/exceptions.rb
CHANGED
data/lib/dorsal/privates.rb
CHANGED
@@ -120,7 +120,7 @@ module Dorsal
|
|
120
120
|
options.specify_presences_of :description, :pid_file
|
121
121
|
options.validate
|
122
122
|
raise Dorsal::RingServerError::new('already running, pid file exist') if File::exist?(options[:pid_file])
|
123
|
-
raise Dorsal::RingServerError::new('already running') unless `ps aux|grep
|
123
|
+
raise Dorsal::RingServerError::new('already running, process found') unless `ps aux|grep -v grep |grep '#{options[:description]}'`.empty?
|
124
124
|
return daemonize(options) do
|
125
125
|
yield
|
126
126
|
end
|
@@ -171,7 +171,7 @@ module Dorsal
|
|
171
171
|
options = Methodic::get_options(_options)
|
172
172
|
options.specify_presences_of :description, :pid_file
|
173
173
|
options.validate
|
174
|
-
pid = `COLUMNS=160 ps aux|grep
|
174
|
+
pid = `COLUMNS=160 ps aux|grep -v grep |grep '#{options[:description]}'|awk '{ print $2}'`
|
175
175
|
if pid.empty? then
|
176
176
|
return false
|
177
177
|
else
|
data/lib/dorsal/version.rb
CHANGED
data/spec/dorsal_spec.rb
CHANGED
@@ -15,12 +15,19 @@ RSpec.configure do |config|
|
|
15
15
|
config.mock_with :rspec do |c|
|
16
16
|
c.syntax = :should
|
17
17
|
end
|
18
|
+
|
19
|
+
if $stdout.isatty then
|
20
|
+
config.color = true
|
21
|
+
config.tty = true
|
22
|
+
end
|
23
|
+
config.formatter = :documentation # :progress, :html, :textmate
|
18
24
|
end
|
19
25
|
|
20
26
|
|
27
|
+
|
21
28
|
describe "Dorsal" do
|
22
29
|
before :all do
|
23
|
-
File::unlink('/tmp/
|
30
|
+
File::unlink('/tmp/dorsal/ringserver.pid') if File::exist?('/tmp/dorsal/ringserver.pid')
|
24
31
|
pid = `ps aux|grep ruby|grep -v grep |grep 'Dorsal Ring Server'|awk '{ print $2}'`
|
25
32
|
unless pid.empty? then
|
26
33
|
res = `kill -TERM #{pid.chomp}`
|
@@ -53,10 +60,11 @@ describe "Dorsal" do
|
|
53
60
|
it { should respond_to :start_ring_server }
|
54
61
|
it { subject.start_ring_server.should be_an_instance_of Fixnum }
|
55
62
|
it "should return false if try to start twice" do
|
63
|
+
# lambda { subject.start_ring_server}.should raise_error Dorsal::RingServerError
|
56
64
|
subject.start_ring_server.should be false
|
57
65
|
end
|
58
66
|
it "should exist an instance process of the Ring server" do
|
59
|
-
pid = `ps aux|grep
|
67
|
+
pid = `ps aux|grep -v grep |grep 'Dorsal Ring Server'|awk '{ print $2}'`.chomp
|
60
68
|
pid.should_not be_empty
|
61
69
|
end
|
62
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorsal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Romain GEORGES
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: methodic
|