This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml.title( document.to_semantic_values[:title][0] || document[:id] ) | |
xml.link(catalog_url(document[:id])) | |
xml.author( document.to_semantic_values[:author][0] ) if document.to_semantic_values[:author][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./app <-- "your app directory" | |
./app/controllers | |
./app/helpers | |
./app/models | |
./app/views | |
./config | |
./config/environments | |
./config/initializers | |
./coverage | |
./db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rubydora' | |
require 'trollop' | |
opts = Trollop::options do | |
version "fedora-rewrite-map 0.0.1 (c) 2011 Chris Beer" | |
banner <<-EOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<requestHandler name="search" class="solr.SearchHandler" default="true" > | |
<lst name="defaults"> | |
[...] | |
<str name="sort">score desc, pub_date_sort desc, title_sort asc</str> | |
[...] | |
</lst> | |
</requestHandler> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'parslet' | |
require 'parslet/convenience' | |
class Duration < Parslet::Parser | |
rule(:integer) { match('[0-9]').repeat(1, 2) } | |
rule(:space) { match('\s').repeat(1) } | |
rule(:space?) { space.maybe } | |
rule(:q) { str('?') } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CatalogController < ... | |
include AmericanArchive::SolrHelper::Authz | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_record/identity_map' | |
module ActiveRecord | |
module IdentityMap | |
class << self | |
alias_method :add_without_exclude, :add | |
def exclusions | |
@exclusions ||= [] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'pairtree' | |
require 'find' | |
require 'fileutils' | |
pairtree = Pairtree.at('.', :create => true) | |
Find.find('data/objects') do |x| | |
next if File.directory? x | |
f = x.split("/").last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<blueprint | |
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation=" | |
http://www.osgi.org/xmlns/blueprint/v1.0.0 | |
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> | |
<camelContext xmlns="http://camel.apache.org/schema/blueprint" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:access="http://www.fedora.info/definitions/1/0/access/"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DOESN'T WORK FOR LARGE FILES | |
# gems/eventmachine-1.0.0.beta.4/lib/em/streamer.rb:88:in `get_chunk': integer 2147483648 too big to convert to `int' (RangeError) | |
require 'rubygems' | |
require 'rubydora' | |
require 'em-http-request' | |
Rubydora.repository = Rubydora.connect(:url => ENV['host'], :user => ENV['user'], :password => ENV['pass'], :timeout => 1200) |