Skip to content

Commit 880eb02

Browse files
Dominik M. Kwiatekcoderobe
authored andcommitted
Upgrade Cocaine to Terrapin (#19)
sad, liked the name
1 parent 884c981 commit 880eb02

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "https://rubygems.org"
44

55
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
66

7-
gem "cocaine"
7+
gem "terrapin"
88

99

1010
# Added at 2017-12-24 10:16:46 +0100 by coderobe:

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
climate_control (0.2.0)
5-
cocaine (0.5.8)
6-
climate_control (>= 0.0.3, < 1.0)
75
coderay (1.1.2)
86
colorize (0.8.1)
97
method_source (0.9.0)
108
posix-spawn (0.3.13)
119
pry (0.11.3)
1210
coderay (~> 1.1.0)
1311
method_source (~> 0.9.0)
12+
terrapin (0.6.0)
13+
climate_control (>= 0.0.3, < 1.0)
1414
thor (0.20.0)
1515

1616
PLATFORMS
1717
ruby
1818

1919
DEPENDENCIES
20-
cocaine
2120
colorize (~> 0.8.1)
2221
posix-spawn (~> 0.3.13)
2322
pry (~> 0.11.3)
23+
terrapin
2424
thor (~> 0.20.0)
2525

2626
BUNDLED WITH
27-
1.16.1
27+
1.17.3

src/cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require "./src/methods"
66
require "./src/utils"
77

8-
#Cocaine::CommandLine.logger = Logger.new(STDOUT)
8+
#Terrapin::CommandLine.logger = Logger.new(STDOUT)
99

1010
module VBiosFinder
1111
@@wd

src/extract-7z.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
require "cocaine"
1+
require "terrapin"
22

33
module VBiosFinder
44
class Extract
55
def self.p7zip file
66
begin
7-
line = Cocaine::CommandLine.new("7z", "x :file")
7+
line = Terrapin::CommandLine.new("7z", "x :file")
88
line.run(file: file)
9-
rescue Cocaine::ExitStatusError => e
9+
rescue Terrapin::ExitStatusError => e
1010
puts e.message
1111
return
1212
end
@@ -15,10 +15,10 @@ def self.p7zip file
1515
class Test
1616
def self.p7zip file
1717
begin
18-
line = Cocaine::CommandLine.new("7z", "l :file | grep 'Type = 7z'")
18+
line = Terrapin::CommandLine.new("7z", "l :file | grep 'Type = 7z'")
1919
line.run(file: file)
2020
true
21-
rescue Cocaine::ExitStatusError => e
21+
rescue Terrapin::ExitStatusError => e
2222
false
2323
end
2424
end

src/extract-innosetup.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
require "cocaine"
1+
require "terrapin"
22

33
module VBiosFinder
44
class Extract
55
def self.innosetup file
66
begin
7-
line = Cocaine::CommandLine.new("innoextract", ":file")
7+
line = Terrapin::CommandLine.new("innoextract", ":file")
88
puts line.run(file: file)
9-
rescue Cocaine::ExitStatusError => e
9+
rescue Terrapin::ExitStatusError => e
1010
puts e.message
1111
return
1212
end
@@ -15,10 +15,10 @@ def self.innosetup file
1515
class Test
1616
def self.innosetup file
1717
begin
18-
line = Cocaine::CommandLine.new("innoextract", "-t :file")
18+
line = Terrapin::CommandLine.new("innoextract", "-t :file")
1919
line.run(file: file)
2020
true
21-
rescue Cocaine::ExitStatusError => e
21+
rescue Terrapin::ExitStatusError => e
2222
false
2323
end
2424
end

src/extract-uefi.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
require "cocaine"
1+
require "terrapin"
22

33
module VBiosFinder
44
class Extract
55
def self.uefi file
66
begin
7-
line = Cocaine::CommandLine.new("UEFIExtract", ":file all")
7+
line = Terrapin::CommandLine.new("UEFIExtract", ":file all")
88
line.run(file: file)
9-
rescue Cocaine::ExitStatusError => e
9+
rescue Terrapin::ExitStatusError => e
1010
# TODO: fix Test::uefi before uncommenting this
1111
puts e.message
1212
return
@@ -16,10 +16,10 @@ def self.uefi file
1616
class Test
1717
def self.uefi file
1818
begin
19-
line = Cocaine::CommandLine.new("UEFIExtract", ":file report")
19+
line = Terrapin::CommandLine.new("UEFIExtract", ":file report")
2020
line.run(file: file)
2121
true
22-
rescue Cocaine::ExitStatusError => e
22+
rescue Terrapin::ExitStatusError => e
2323
false
2424
end
2525
end

src/extract-upx.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
require "cocaine"
1+
require "terrapin"
22

33
module VBiosFinder
44
class Extract
55
def self.upx file
66
begin
7-
line = Cocaine::CommandLine.new("upx", "-d :file -o :outfile")
7+
line = Terrapin::CommandLine.new("upx", "-d :file -o :outfile")
88
line.run(file: file, outfile: "upx-#{file}")
9-
rescue Cocaine::ExitStatusError => e
9+
rescue Terrapin::ExitStatusError => e
1010
puts e.message
1111
return
1212
end
@@ -15,10 +15,10 @@ def self.upx file
1515
class Test
1616
def self.upx file
1717
begin
18-
line = Cocaine::CommandLine.new("upx", "-t :file")
18+
line = Terrapin::CommandLine.new("upx", "-t :file")
1919
line.run(file: file)
2020
true
21-
rescue Cocaine::ExitStatusError => e
21+
rescue Terrapin::ExitStatusError => e
2222
false
2323
end
2424
end

src/methods.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "cocaine"
1+
require "terrapin"
22
require "find"
33
require "colorize"
44
require "./src/extraction"
@@ -52,13 +52,13 @@ def self.run file
5252
uefibins = Find.find(".").reject{|e| File.directory? e}.select{|e| e.end_with? ".bin"}
5353
puts "got #{uefibins.length} modules".colorize(:blue)
5454
puts "finding vbios".colorize(:blue)
55-
line = Cocaine::CommandLine.new("file", "-b :file")
55+
line = Terrapin::CommandLine.new("file", "-b :file")
5656
modules = uefibins.select{|e| line.run(file: e).include? "Video"}
5757
if modules.length > 0
5858
puts "#{modules.length} possible candidates".colorize(:green)
5959
if Utils::installed?("rom-parser", "required for proper rom naming & higher accuracy")
6060
modules.each do |mod|
61-
rom_parser = Cocaine::CommandLine.new("rom-parser", ":file")
61+
rom_parser = Terrapin::CommandLine.new("rom-parser", ":file")
6262
begin
6363
romdata = rom_parser.run(file: mod)
6464
romdata = romdata.split("\n")[1].split(", ").map{|e| e.split(": ")}.to_h rescue nil
@@ -67,7 +67,7 @@ def self.run file
6767
new_filename = "vbios_#{romdata['vendor']}_#{romdata['device']}.rom"
6868
FileUtils.cp(mod, "#{outpath}/#{new_filename}")
6969
end
70-
rescue Cocaine::ExitStatusError => e
70+
rescue Terrapin::ExitStatusError => e
7171
puts "can't determine vbios type of #{File.basename(mod)}, saving as 'vbios_unknown_#{File.basename(mod)}'"
7272
FileUtils.cp(mod, "#{outpath}/vbios_unknown_#{File.basename(mod)}")
7373
end

src/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "cocaine"
1+
require "terrapin"
22
require "mkmf"
33
require "find"
44

0 commit comments

Comments
 (0)