Module: IOCheck
- Defined in:
- lib/iocheck/test.rb,
lib/iocheck/policy.rb,
lib/iocheck/tester.rb
Defined Under Namespace
Classes: Policy, Test, Tester
Constant Summary
collapse
- Env =
{}
Class Method Summary
collapse
Class Method Details
.include?(name, dir) ⇒ Boolean
35
36
37
38
39
40
|
# File 'lib/iocheck/test.rb', line 35
def self.include?(name, dir)
Dir.open(dir).each do |f|
return true if f == name
end
return false
end
|
.name(cmd) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/iocheck/test.rb', line 6
def self.name(cmd)
cn = cmd.clone
if cn.start_with?( "./" )
cn[0..1] = "dotslash"
end
cn.split(" ").join("_")
end
|
.readfile(name) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/iocheck/test.rb', line 18
def self.readfile(name)
dir = ::IOCheck::Env["dir"]
if self.include?(name, "#{dir}/lock")
x = "#{dir}/lock/#{name}"
elsif self.include?(name, "#{dir}/unlock")
x = "#{dir}/unlock/#{name}"
else
raise ArgumentError, "readfile not found."
end
x
end
|
.strip(bytes) ⇒ Object
14
15
16
|
# File 'lib/iocheck/test.rb', line 14
def self.strip(bytes)
bytes.strip
end
|
.writefile(name) ⇒ Object
30
31
32
33
|
# File 'lib/iocheck/test.rb', line 30
def self.writefile(name)
dir = ::IOCheck::Env["dir"]
"#{dir}/unlock/#{name}"
end
|