Class: RedisRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/redis-store/testing/runners.rb

Direct Known Subclasses

NodeOneRedisRunner, NodeTwoRedisRunner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ RedisRunner

Returns a new instance of RedisRunner.



6
7
8
# File 'lib/redis-store/testing/runners.rb', line 6

def initialize(dir)
  @dir = dir
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



4
5
6
# File 'lib/redis-store/testing/runners.rb', line 4

def dir
  @dir
end

Instance Method Details

#redisdirObject



10
11
12
# File 'lib/redis-store/testing/runners.rb', line 10

def redisdir
  dir.join 'vendor/redis'
end

#startObject



14
15
16
# File 'lib/redis-store/testing/runners.rb', line 14

def start
  system %(redis-server #{configuration})
end

#stopObject



18
19
20
21
22
23
24
# File 'lib/redis-store/testing/runners.rb', line 18

def stop
  begin
    Process.kill('SIGTERM', pid)
  rescue
    # Suppress exceptions for Travis CI
  end
end