-
Notifications
You must be signed in to change notification settings - Fork 3
/
zork1.rb
35 lines (31 loc) · 993 Bytes
/
zork1.rb
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
require 'formula'
require 'find'
require 'fileutils'
class Zork1 < Formula
homepage 'http://www.infocom-if.org/downloads/downloads.html'
url 'http://www.infocom-if.org/downloads/zork1.zip'
version '1'
sha256 '645027fb189ba8fd30daecca609e68e2bf2337b76e7b4f925ccf58778f3eac40'
depends_on 'fizmo'
def install
def copy_without(source_path, target_path, exclude)
Find.find(source_path) do |source|
target = source.sub(/^#{source_path}/, target_path)
if File.directory? source
Find.prune if File.basename(source) == exclude
FileUtils.makedirs(target) unless File.exists? target
else
FileUtils.copy source, target
end
end
end
FileUtils.makedirs("./share/zork1")
copy_without('.', './share/zork1', 'share')
file = File.new("zork1", "w+", 0755)
file.write "#!/bin/bash
fizmo-console #{prefix}/share/zork1/DATA/ZORK1.DAT
"
bin.install "zork1"
share.install "share/zork1"
end
end