1 #!/usr/local/bin/ruby -w
4 require "highline/import"
12 say("\nYou can even build shells...")
16 help_n = "Next Z39.50 server/group of zservers.\n> n"
18 help_num = "View that record by typing in the index number\n> 16." # this represents the '#'
20 help_p = "Pick the record at that index position into the result set to work on and save."
22 help_s = "Select sort. Hit 's' to get a menu of sort possibilities. Possible sorts will include: relevancy, title, author, date, date_fixed, subfield (in form of 245a)...\n> s5"
24 #help_v = "View the record. Shows the full MARC record."
26 help_r = "Remove the record from the result set. This is a way to narrow the result set.\n> r4\nRemoves record 4 from the result set."
28 help_c = "Compare two records. Compares the records line by line. Lines with an 'm' match each other. Lines with a plus sign are in the first record but not the second. Lines with a minus sign '-'"
30 help_l = "Lint the record."
32 help_d = "Done selecting records. If at least one record has been selected you continue on. If no records have been selected you are presented with a search prompt again."
34 help_f = "Forwards through the result set"
35 help_b = "backwards through the result set"
36 help_all = "Select all the records in the result set to work on and save."
40 take_how_many = 'multi' #'one' # 'multi'
45 menu.layout = :one_line
48 menu.prompt = "Enter "
49 menu.select_by = :name
52 menu.choice('#', help_num) do |command, details|
56 menu.hidden(:"#{x}") {|cmd, details| puts cmd}
60 unless take_how_many == 'one'
61 menu.choice(:n, "Go to the next Z39.50 server.") do |command, details|
62 say("next: #{details}...")
66 menu.choice('s#', help_s) do |command, details|
67 ask("Which record number do you want?")
69 menu.hidden(:s, help_s){|c,d| puts help_s}
71 menu.hidden(:"s#{x}") {|cmd, details| puts cmd}
75 menu.choice('c#-#', help_c) do |command, details|
81 # possibilities << "cx-y" unless y == x
85 menu.hidden(:"c#{x}") {|cmd, details| puts cmd}
89 menu.choice('l#', help_l) do |command, details|
91 ask("Which record do you want to lint? ")
94 menu.hidden(:"l#{x}") {|cmd, details| puts cmd}
98 unless take_how_many == 'one'
99 menu.choice(:d, "Lint.") do |command, details|
100 say("Saving file with options: #{details}...")
104 # none -- only for final record taking
107 menu.choice(:quit, "Exit program.") { exit }