Skip to content
View taghosts
#!/usr/bin/env ruby
require 'optparse'
ACTIVE_SERVERS = '/l/local/active-servers'
def alltags
alltags = [] do |line|
tokens = line.split(/\s+/)
View marc_html.rb
# encoding: UTF-8
require 'slim'
require 'marc'
# Get a record somehow. Here, I just nab the marc-in-json from the HT catalog and use that.
require 'json'
require 'open-uri'
rec = MARC::Record.new_from_hash(JSON.parse(open('').read))
View emtest.rb
require 'traject'
include Traject::Macros::Marc21
r =
r <<'001', '12345')
r <<'245', ' ', ' ', ['a', 'My Title'])
context =
View include.rb
module A
def hello
puts "Hello from A"
def goodbye
puts "Goodbye from A"
class B
View each_rescue.rb
class A
include Enumerable
def each
(1..10).each do |i|
raise"SIX") if i == 6
yield i
View marc-threadedreader.rb
require 'concurrent'
require 'thread'
require 'marc'
class MARC::ThreadedReader < MARC::Reader
include Enumerable
include Concurrent::Async
def initialize(file, options={})
View threaded_read.rb
require 'concurrent'
require 'thread'
require 'json'
require 'stringio'
require 'marc'
require 'benchmark'
# OK. Try to read in a line, and then have another thread transform it, and expose
# via #each.
View index.rb
require 'library_stdnums'
require 'traject/macros/marc21_semantics'
extend Traject::Macros::Marc21Semantics
require 'traject/macros/marc_format_classifier'
extend Traject::Macros::MarcFormats
require 'traject/solr_json_writer'
require 'traject/marc_reader'
View gist:7b8e60587e71c2009ced
require 'benchmark'
require 'benchmark/ips'
require 'marc'
require 'marc/fastxmlwriter'
record ='test/one.dat').first
View results.txt
jruby 1.7.18 (1.9.3p551) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.8.0-b132 +jit [darwin-x86_64]
Rehearsal ------------------------------------------------
marc4j w/bin 19.640000 1.000000 20.640000 ( 8.313000)
ruby w/bin 22.470000 0.600000 23.070000 ( 14.930000)
marc4j w/xml 12.950000 1.130000 14.080000 ( 6.189000)
Something went wrong with that request. Please try again.