dorsal 1.1 → 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b142bf4c6b5a14321f07c27e1de317bbe7bec8e
4
- data.tar.gz: 31bbcd213f7c18aac8671d0041c00b6d7657e499
3
+ metadata.gz: 4e82d933806e0255c66968fe5f2fe7f701a02a0d
4
+ data.tar.gz: a27db6a906a821a5e9533b114da2033333c24b9b
5
5
  SHA512:
6
- metadata.gz: 6dead18e0122a5999e7d6276e709ec05492e3a7abcea00759ab6851bc8bdc1d2f58190225e830e1bbfa5e82a9ce0ac18de4bc8a9e011f270cc715b757a6cde63
7
- data.tar.gz: da7218d7a318d41d98ccd3dc814c7f90c0a6f5c4d8f755dbbd703c0150a17684518b8762343f425ccf25e548ec43d8d3a5ec21d01e18171a93ab814b1b5c6b06
6
+ metadata.gz: daeb92cb458fcb8e3a8f9e81a5ebcf508b35b06927653c922bc9064f3811bfb0bcae597f33bb29eb96b8a2d8d97e5203a7aaef45e59bffa6dfd7b72f0ec37028
7
+ data.tar.gz: 291620ac39e58b59f991599c4bc91c73a18b1997101626162b3094ffa31776078bc853d6d366d1a180b9d187bf84075a700890bff9ebcc50c3ce0df937c4a8f6
@@ -72,7 +72,7 @@ module Dorsal
72
72
  def bind_to_ring
73
73
  if ring_server_status then
74
74
  DRb.start_service
75
- return DRbObject.new nil, @options[:uri]
75
+ return DRbObject.new_with_uri @options[:uri]
76
76
  else
77
77
  return nil
78
78
  end
@@ -9,5 +9,5 @@
9
9
  # the Dorsal Namespace
10
10
  module Dorsal
11
11
  # Exception class override from servers errors
12
- class ServerError < Exception; end
12
+ class RingServerError < Exception; end
13
13
  end
@@ -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 ruby|grep -v grep |grep '#{options[:description]}'`.empty?
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 ruby|grep -v grep |grep '#{options[:description]}'|awk '{ print $2}'`
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
@@ -10,5 +10,5 @@
10
10
  module Dorsal
11
11
 
12
12
  # global version of Dorsal
13
- VERSION = "1.1"
13
+ VERSION = "1.2"
14
14
  end
@@ -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/dorsal_ringserver.pid') if File::exist?('/tmp/dorsal_ringserver.pid')
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 ruby|grep -v grep |grep 'Dorsal Ring Server'|awk '{ print $2}'`.chomp
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.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: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: methodic