-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathextract-7z.rb
More file actions
34 lines (33 loc) · 825 Bytes
/
extract-7z.rb
File metadata and controls
34 lines (33 loc) · 825 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
require "terrapin"
module VBiosFinder
class Extract
def self.p7zip file
begin
line = Terrapin::CommandLine.new("7z", "x :file")
line.run(file: file)
rescue Terrapin::ExitStatusError => e
puts e.message
return
end
end
end
class Test
def self.p7zip file
begin
line = Terrapin::CommandLine.new("7z", "l :file | grep 'Type = 7z'")
line.run(file: file)
result_7Z = true
rescue Terrapin::ExitStatusError => e
result_7Z = false
end
begin
line = Terrapin::CommandLine.new("7z", "l :file | grep 'Type = Cab'")
line.run(file: file)
result_Cab = true
rescue Terrapin::ExitStatusError => e
result_Cab = false
end
return result_Cab || result_7Z
end
end
end