forked from jimmoffitt/pt-dm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdm_common.rb
More file actions
40 lines (29 loc) · 795 Bytes
/
dm_common.rb
File metadata and controls
40 lines (29 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class DM_Common
def os
@os ||= (
host_os = RbConfig::CONFIG['host_os']
case host_os
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
:windows
when /darwin|mac os/
:macosx
when /linux/
:linux
when /solaris|bsd/
:unix
else
raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
end
)
end
def count_local_files(data_dir, job_uuid)
local_files = 0
Dir.foreach(data_dir) do |f|
#if job_uuid in filename, increment
if f.include?(job_uuid)
local_files = local_files + 1
end
end
return local_files
end
end