class Work < ActiveFedora::Base
has_metadata "descMetadata", type: ArticleMetadataDatastream
section :required_information, label: "Required Information" do |section|
section.attribute :title, datastream: :descMetadata, required: true
end
section :secondary_information, label: "Secondary Information" do |section|
section.attribute :contributor, datastream: :descMetadata
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
module ApplicationHelper | |
def curation_concern_collection_path(asset) | |
collection_path(asset) | |
end | |
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
Hydra::Ezid.configure do | |
register(DescendantOfActiveFedora) do |config| | |
store_doi at: :descMetadata | |
store_ark at: :properties, in: :some_ark | |
find_creator at: :descMetadata, in: :author | |
find_title at: :properties | |
find_publisher at: :properties | |
find_publication_year at: :descMetadata, in: :pubYear | |
end | |
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
class GenericWork < ActiveFedora::Base | |
begin # include CurationConcern::Model | |
def self.human_readable_type | |
name.demodulize.titleize | |
end | |
begin # include Sufia::ModelMethods | |
begin # include Hydra::ModelMethods |
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
RSpec.configure do |config| | |
config.before(:each) do | |
require 'active_fedora/in_memory' | |
ActiveFedora::InMemory.cleanup! | |
end | |
config.before(:suite) do | |
require 'active_fedora/in_memory' | |
ActiveFedora::InMemory.begin! | |
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
#!/usr/bin/env sh | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch spec/dummy/spec/master.zip' --prune-empty --tag-name-filter cat -- --all | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch spec/dummy/spec/curate-without-xacml-alterations.zip' --prune-empty --tag-name-filter cat -- --all | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch jetty' --prune-empty --tag-name-filter cat -- --all | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch spec/dummy/spec/jetty' --prune-empty --tag-name-filter cat -- --all | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --prune=now |
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
alias kill-jetty='ps ax | grep jetty | grep -v grep | sed "s/^ *//g" | cut -f1 -d " " | xargs kill -9' |
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
git_joined_committers_caption() { | |
authors=`git log --no-merges --format='%aN' | sort -u` | |
OLD_IFS=$IFS | |
IFS=$(echo -en "\n\b") | |
author_list="" | |
for author in $authors; do | |
author_first_commit=`git log --author="${author}" --pretty=format:%H|tail -1` | |
author_list+="$(git log -1 --format='%ct|%an started comitting' $author_first_commit)\n" | |
done | |
IFS=$OLD_IFS |
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
I've begun the process of migrating some of our content in Curate. I have encountered an ever pleasant character encoding error (see Best way to lose a day of productivity). The issue, I believe is that prior to RDF 1.0.10 character encoding was less strictly acted on. With 1.0.10, encoding is being more strictly applied. Long story short, I've submitted a pull request for fixing this in the RDF gem. | |
https://github.com/ruby-rdf/rdf/pull/133 | |
Ultimately the character encoding of RDF 1.0.10 is a good thing, because I noticed we were persisting the following (bold added for calling out the confusing text): | |
<info:fedora/und:cv43nv93h01> <http://purl.org/dc/terms/title> \"Procreation Metaphors in S\xC3\xA9an \xC3\x93 R\xC3\xADord\xC3\xA1in's Poetry\" ." | |
When what I really wanted was: |
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
# rails runner script/migrations/person-migrator.rb | |
module Migrator | |
module_function | |
def call | |
@successes = [] | |
@silent_failures = [] | |
@failures = [] | |
ActiveFedora::Base.send(:connections).each do |connection| | |
connection.search('pid~und:*').each do |rubydora_object| |