mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

[ruby-list:44111] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
27 lines
578 B
Ruby
Executable file
27 lines
578 B
Ruby
Executable file
#!./miniruby -s
|
|
|
|
$name = $library = $description = nil
|
|
|
|
SYM = {}
|
|
STDIN.reopen(open("nul"))
|
|
ARGV.each do |obj|
|
|
IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
|
|
next unless /(?:PUBDEF|PUBD32)/ =~ l
|
|
SYM[$1] = true if /'(.*?)'/ =~ l
|
|
end
|
|
end
|
|
|
|
exports = []
|
|
if $name
|
|
exports << "Name " + $name
|
|
elsif $library
|
|
exports << "Library " + $library
|
|
end
|
|
exports << "Description " + $description.dump if $description
|
|
exports << "EXPORTS" << SYM.keys.sort
|
|
|
|
if $output
|
|
open($output, 'w') {|f| f.puts exports.join("\n")}
|
|
else
|
|
puts exports.join("\n")
|
|
end
|