/usr/share/doc/libeb-ruby1.8/examples/test.rb is in libeb-ruby1.8 2.6-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #!/bin/env ruby -Ke
require "eb"
if $KCODE!="EUC" then
raise RuntimeError,"lib eb requires EUC coding system"
end
b=EB::Book.new
WORD1="¤¸¤·¤ç"
WORD2="¤Á¤·¤"
print "\n****** Initial Test\n"
b.bind("/cdrom")
p b.disktype
p b.bound?
p b.path
p b.charcode
p b.subbook_count
p b.subbook_list
print "\n****** Sub Books\n"
0.upto(b.subbook_count-1) do |i|
print "===============\n"
p b.title(i), b.directory(i)
end
print "\n****** Sub Book Test\n"
b.subbook=0
p b.subbook
p b.search_available?
p b.exactsearch_available?
p b.endsearch_available?
print "\n****** Search Test\n"
items=b.exactsearch( WORD1 )
print "Hit :", items.size,"\n"
items.each do |item|
print "====================\n"
print "== ",item[0],"\n"
print "\n",item[1],"\n"
end
b.exactsearch( WORD2 ) do |item|
print "====================\n"
print "== ",item[0],"\n"
print "\n",item[1],"\n"
# EB::Cancel # yield will be stopped
end
|