Skip to content

Instantly share code, notes, and snippets.

View awead's full-sized avatar
🏠
Working from home

Adam Wead awead

🏠
Working from home
View GitHub Profile
add to spec/lib/integration_spec.rb
it "should return a url for a datastream" do
obj = @repository.find_or_initialize('test:1')
@repository.datastream_url('test:1', 'Test').should == 'objects/test%3A1/datastreams/Test'
end
@awead
awead / gist:c1ac825eed499efb2d81
Created June 16, 2014 14:34
cap rbenv update
awead@pooh:~/Projects/Github/psu-stewardship/scholarsphere$ bundle exec cap qa rbenv:update
triggering load callbacks
* 2014-06-16 10:32:43 executing `qa'
triggering start callbacks for `rbenv:update'
* 2014-06-16 10:32:43 executing `multistage:ensure'
triggering after callbacks for `multistage:ensure'
* 2014-06-16 10:32:43 executing `rbenv:setup_default_environment'
* executing "echo \"$HOME/.rbenv\""
servers: ["ss1qa.dlt.psu.edu"]
Enter passphrase for /Users/awead/.ssh/id_deploy_rsa:
No context on this server matched or handled this request.
Contexts known to this server are:
/fedora ---> o.e.j.w.WebAppContext{/fedora,[file:/private/var/folders/_f/4p7cfv3j7jz6l3twxs1wtvnc0000gp/T/jetty-0.0.0.0-8983-fedora.war-_fedora-any-/webapp/, jar:file:/private/var/folders/_f/4p7cfv3j7jz6l3twxs1wtvnc0000gp/T/jetty-0.0.0.0-8983-fedora.war-_fedora-any-/webapp/WEB-INF/lib/fcrepo-server-3.8.0-SNAPSHOT.jar!/META-INF/resources/]},/Users/awead/Projects/Github/projecthydra/sufia/tmp/jetties/hydra-jetty-3.8.0-RC1/webapps/fedora.war
/solr ---> o.e.j.w.WebAppContext{/solr,file:/private/var/folders/_f/4p7cfv3j7jz6l3twxs1wtvnc0000gp/T/jetty-0.0.0.0-8983-solr.war-_solr-any-/webapp/},/Users/awead/Projects/Github/projecthydra/sufia/tmp/jetties/hydra-jetty-3.8.0-RC1/webapps/solr.war
/fedora-test ---> o.e.j.w.WebAppContext{/fedora-test,[file:/private/var/folders/_f/4p7cfv3j7jz6l3twxs1wtvnc0000gp/T/jetty-0.0.0.0-8983-fedora.war-_fedora-test-any-/webapp/, jar:file:/private/var/folders/_f/4p7cfv3j7jz6l3twxs1wtvnc0000gp/T/
irb(main):001:0> f = GenericFile.new
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lc_subjects' LIMIT 1
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lexvo_languages' LIMIT 1
LocalAuthority Load (0.1ms) SELECT "local_authorities".* FROM "local_authorities" WHERE "local_authorities"."name" = 'lc_genres' LIMIT 1
Using the default fedora.yml that comes with active-fedora. If you want to override this, pass the path to fedora.yml to ActiveFedora - ie. ActiveFedora.init(:fedora_config_path => '/path/to/fedora.yml') - or set Rails.root and put fedora.yml into #{Rails.root}/config.
ActiveFedora: loading fedora config from /Users/awead/.gem/ruby/2.1.1/bundler/gems/active_fedora-331a64092daf/config/fedora.yml
Using the default fedora.yml that comes with active-fedora. If you want to override this, pass the path to fedora.yml to ActiveFedora - ie. ActiveFedora.
> f.content.versions.count
=> 9
> f.content.versions.last
=> #<RDF::URI:0x3fe0d263fc5c URI:http://127.0.0.1:8983/fedora/rest/dev/p8/41/8w/01/p8418w01t/content/fcr:versions/87a0a8c317f1e71754f3c2-6da1-4288-b64f-930d12753452>
> f.content.versions.last.path.split("/").last
=> "87a0a8c317f1e71754f3c2-6da1-4288-b64f-930d12753452"
@awead
awead / gist:c8c0fd01261054eecf64
Created September 17, 2014 21:19
Fake PBCore namespace and RDF vocabs for PBCore
INSERT {
<http://www.pbcore.org/v2/> <http://purl.org/vocab/vann/preferredNamespacePrefix> "pbcore"
} WHERE {
}
/*
* This is not actual RDF for PBCore, but a test to see if you can assign PBCore elements as Fedora4 attributes
*/
[pbcore:elements] mixin
2014-09-22 11:14:52 -0400 (26874) Rendering 500 page due to exception: #<NoMethodError: undefined method `label' for nil:NilClass> - ["/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/blacklight-5.5.3/app/helpers/blacklight/configuration_helper_behavior.rb:85:in `facet_field_label'", "/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/blacklight-5.5.3/app/helpers/blacklight/render_constraints_helper_behavior.rb:72:in `block in render_filter_element'", "/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/blacklight-5.5.3/app/helpers/blacklight/render_constraints_helper_behavior.rb:70:in `map'", "/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/blacklight-5.5.3/app/helpers/blacklight/render_constraints_helper_behavior.rb:70:in `render_filter_element'", "/opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.1.0/gems/blacklight-5.5.3/app/helpers/blacklight/render_constraints_helper_behavior.rb:54:in `block in render_constraints_filters'", "/opt/heracles
@awead
awead / gist:e4aff26ad98465cf7593
Created September 22, 2014 17:01
Index failure
scholarsphere:sf268912r: #<RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request\nError: {'responseHeader'=>{'status'=>400,'QTime'=>1},'error'=>{'msg'=>'Illegal character ((CTRL-CHAR, code 11))\n at [row,col {unknown-source}]: [1,5795]','code'=>400}}\n\nRequest Data: \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><add><doc><field name=\\\"system_create_dtsi\\\">2014-04-02T20:41:01Z</field><field name=\\\"system_modified_dtsi\\\">2014-09-10T10:36:27Z</field><field name=\\\"object_state_ssi\\\">A</field><field name=\\\"active_fedora_model_ssi\\\">GenericFile</field><field name=\\\"id\\\">scholarsphere:sf268912r</field><field name=\\\"object_profile_ssm\\\">{\\\"datastreams\\\":{\\\"DC\\\":{\\\"dsLabel\\\":\\\"Dublin Core Record for this object\\\",\\\"dsVersionID\\\":\\\"DC1.0\\\",\\\"dsCreateDate\\\":\\\"2014-04-02T20:41:01Z\\\",\\\"dsState\\\":\\\"A\\\",\\\"dsMIME\\\":\\\"text/xml\\\",\\\"dsFormatURI\\\":\\\"http://www.openarchives.org/OAI/2.0/oai_dc/\\\",\\\"dsControlGroup\\\":\\\"X\\\",\\\"dsSize\\\
/Users/awead/.gem/ruby/2.1.2/gems/actionpack-4.1.6/lib/action_controller/base.rb:164:in `<module:ActionController>': uninitialized constant ActionController::Metal (NameError)
from /Users/awead/.gem/ruby/2.1.2/gems/actionpack-4.1.6/lib/action_controller/base.rb:5:in `<top (required)>'
from /Users/awead/.gem/ruby/2.1.2/gems/responders-1.1.1/lib/responders.rb:1:in `<top (required)>'
from /Users/awead/.gem/ruby/2.1.2/gems/devise-3.4.0/lib/devise.rb:7:in `<top (required)>'
from /Users/awead/Projects/Github/projecthydra/sufia/spec/spec_helper.rb:6:in `require'
from /Users/awead/Projects/Github/projecthydra/sufia/spec/spec_helper.rb:6:in `<top (required)>'
from /Users/awead/Projects/Github/projecthydra/sufia/spec/actors/generic_file/actor_spec.rb:1:in `require'
from /Users/awead/Projects/Github/projecthydra/sufia/spec/actors/generic_file/actor_spec.rb:1:in `<top (required)>'
from /Users/awead/.gem/ruby/2.1.2/gems/rspec-core-3.1.6/lib/rspec/core/configuration.rb:1105:in `load'
from /Users/awead/.gem/ruby/2.
@awead
awead / gist:787bdd31c6182db77230
Created October 28, 2014 16:01
curl -H "Accept: text/turtle" http://localhost:8983/fedora/rest/test/4c/e0/ee/93/4ce0ee93-7bfb-4745-aaaa-62c7ce0cf7e5/fcr:versions
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix nt: <http://www.jcp.org/jcr/nt/1.0> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix fcrepo: <http://fedora.info/definitions/v4/repository#> .
@prefix ns001: <http://purl.org/dc/terms/> .
@prefix test: <info:fedora/test/> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@prefix image: <http://www.modeshape.org/images/1.0> .
@prefix xs: <http://www.w3.org/2001/XMLSchema> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .