Class: RRRSpec::Configuration
- Inherits:
-
Object
- Object
- RRRSpec::Configuration
show all
- Defined in:
- lib/rrrspec/configuration.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#loaded ⇒ Object
Returns the value of attribute loaded.
3
4
5
|
# File 'lib/rrrspec/configuration.rb', line 3
def loaded
@loaded
end
|
#type ⇒ Object
Returns the value of attribute type.
4
5
6
|
# File 'lib/rrrspec/configuration.rb', line 4
def type
@type
end
|
Instance Method Details
#check_validity ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/rrrspec/configuration.rb', line 18
def check_validity
validity = true
unless @redis_value
$stderr.puts("Redis configuration is empty")
validity = false
end
validity
end
|
#load_files(files) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/rrrspec/configuration.rb', line 29
def load_files(files)
loaded = []
files.each do |filepath|
filepath = File.absolute_path(filepath)
next unless File.exists?(filepath)
$stderr.puts("Loading: #{filepath}")
load filepath
loaded << filepath
end
RRRSpec.configuration.loaded = loaded
end
|
#redis ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/rrrspec/configuration.rb', line 10
def redis
case @redis_value
when Hash then Redis.new(@redis_value)
when Proc then @redis_value.call
else @redis_value
end
end
|
#redis=(arg) ⇒ Object
6
7
8
|
# File 'lib/rrrspec/configuration.rb', line 6
def redis=(arg)
@redis_value = arg
end
|