travis-ci
4284 of 4505 relevant lines covered (95.09%)
155.15 hits per line
1 |
class DynamoDBLocal |
4 all except jruby-head ✔ |
2 |
DIST_DIR = File.join(File.dirname(__FILE__), 'DynamoDBLocal-latest') |
4 all except jruby-head ✔ |
3 |
PIDFILE = "#{DIST_DIR}/dynamodb.pid" |
5 all except jruby-head ✔ |
4 |
|
|
5 |
def self.ensure_is_running! |
4 all except jruby-head ✔ |
6 |
if File.exists? PIDFILE |
977 all except jruby-head ✔ |
7 |
begin
|
977 all except jruby-head ✔ |
8 |
pid = File.read(PIDFILE).gsub(/\n/,'').to_i |
977 all except jruby-head ✔ |
9 |
Process.kill(0, pid) |
977 all except jruby-head ✔ |
10 |
rescue Errno::ESRCH |
× |
11 |
STDERR.puts "The #{PIDFILE} exist but the process was not running" |
× |
12 |
self.start!
|
× |
13 |
end
|
|
14 |
end
|
|
15 |
end
|
|
16 |
|
|
17 |
def self.start! |
4 all except jruby-head ✔ |
18 |
raise 'DynamoDBLocal requires JAVA_HOME to be set' unless ENV.has_key?('JAVA_HOME') |
× |
19 |
output = `sh bin/start_dynamodblocal`
|
× |
20 |
STDERR.puts output
|
× |
21 |
end
|
|
22 |
|
|
23 |
def self.stop! |
4 all except jruby-head ✔ |
24 |
output = `sh bin/stop_dynamodblocal`
|
× |
25 |
STDERR.puts output
|
× |
26 |
end
|
|
27 |
end
|