Skip to content

Instantly share code, notes, and snippets.

View jcoyne's full-sized avatar

Justin Coyne jcoyne

  • Stanford University Libraries
  • Minneapolis, MN
View GitHub Profile
4 tests, 16 assertions, 0 failures, 0 errors
+----------------------------------------------------+-------+-------+--------+
| File | Lines | LOC | COV |
+----------------------------------------------------+-------+-------+--------+
|(__FORWARDABLE__) | 16 | 16 | 6.2% |
|(erb) | 1161 | 188 | 0.5% |
|<script> | 1 | 1 | 100.0% |
|app/models/java_inflater.rb | 35 | 30 | 23.3% |
|app/models/notifications.rb | 78 | 64 | 84.4% |
@jcoyne
jcoyne / gist:968640
Created May 12, 2011 14:46
justin's project
total 0
drwxr-xr-x 9 jcoyne staff 306 May 12 09:45 .
-rw-rw-r-- 1 jcoyne staff 0 May 12 09:45 gist.txt
drwxr-xr-x 19 jcoyne staff 646 May 11 16:03 ..
drwxr-xr-x 6 jcoyne staff 204 May 11 13:45 WEB-INF
drwxr-xr-x 4 jcoyne staff 136 May 9 09:51 css
drwxr-xr-x 34 jcoyne staff 1156 May 6 08:20 images
drwxr-xr-x 34 jcoyne staff 1156 Apr 20 16:35 fonts
drwxr-xr-x 2 jcoyne staff 68 Jan 28 15:32 META-INF
drwxr-xr-x 4 jcoyne staff 136 Dec 13 11:06 js
Justins-MacBook-Pro:narm-ingest justin$ spec spec/unit/processor_spec.rb
This application has Blacklight version 2.8.0 installed
./spec/unit/../../lib/narm/workflow_datastream.rb:23: warning: don't put space before argument parentheses
./spec/unit/../../lib/narm/workflow_datastream.rb:23: warning: don't put space before argument parentheses
Creating new catalog: narm:processor_test_fixture1
processing records
added record changeme:647
added record changeme:648
added record changeme:649
added record changeme:650
@jcoyne
jcoyne / gist:1358554
Created November 11, 2011 17:02
Stack
Extracting content from spec/fixtures/good_content.pdf
Unable to extract content:
Request: http://127.0.0.1:8983/solr/test/update/extract?defaultField=content&extractOnly=true
Response: org/apache/tika/exception/TikaException
java.lang.NoClassDefFoundError: org/apache/tika/exception/TikaException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:359)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:413)
def self.note_template(opts={})
options = {:text => ""}.merge(opts)
builder = Nokogiri::XML::Builder.new do
note options[:text], :date=>Time.now.iso8601
end
return builder.doc.root
end
def insert_note(opts={})
@jcoyne
jcoyne / gist:1635701
Created January 18, 2012 21:14
ActiveFedora::Model
module ActiveFedora
module Model
def classname_from_uri(uri)
super(map_model_name(uri))
end
def to_class_uri
map_model_name(super)
end
end
@jcoyne
jcoyne / gist:1643262
Created January 19, 2012 22:21
jruby postresql error
1.9.3p0 :003 > Metastore.find(304156028, 304654300, 304669715)
Metastore Load (280.2ms) SELECT "public"."metastore".* FROM "public"."metastore" WHERE "public"."metastore"."id" IN (304156028, 304654300, 304669715)
=> [#<Metastore id: 304156028, dedup: 181874021, doctype: 1, source: 2, xml: "<sf:art xmlns:xsi=\"http://www.w3.org/2001/XMLSchema...">, #<Metastore id: 304654300, dedup: 181874021, doctype: 1, source: 3, xml: "<sf:art xmlns:xsi=\"http://www.w3.org/2001/XMLSchema...">, #<Metastore id: 304669715, dedup: 181874021, doctype: 1, source: 11, xml: "<sf:art xmlns:xsi=\"http://www.w3.org/2001/XMLSchema...">]
jruby-1.6.5.1 :001 > Metastore.find(304156028, 304654300, 304669715)
PK and serial sequence (3.0ms) SELECT attr.attname, seq.relname
FROM pg_class seq,
Metastore.find(304156028)
Metastore Load (8.0ms) SELECT "metastore".* FROM "metastore" WHERE "metastore"."" = 304156028 LIMIT 1
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: ERROR: zero-length delimited identifier at or near """"
Position: 59: SELECT "metastore".* FROM "metastore" WHERE "metastore"."" = 304156028 LIMIT 1
from arjdbc/jdbc/RubyJdbcConnection.java:191:in `execute'
from /usr/local/rvm/gems/jruby-1.6.5.1/gems/activerecord-jdbc-adapter-1.2.1/lib/arjdbc/jdbc/adapter.rb:216:in `_execute'
from /usr/local/rvm/gems/jruby-1.6.5.1/gems/activerecord-jdbc-adapter-1.2.1/lib/arjdbc/jdbc/adapter.rb:208:in `execute'
from /usr/local/rvm/gems/jruby-1.6.5.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `log'
from /usr/local/rvm/gems/jruby-1.6.5.1/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
1) ActiveFedora::RDFXMLWriter should serialize graphs using the rdf:Description element despite the presence of rdf:type statements
Failure/Error: content.should be_equivalent_to @rdf_xml_with_type
expected:
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about='info:fedora/test:sample_pid'>
<isMemberOf rdf:resource='demo:10' xmlns='info:fedora/fedora-system:def/relations-external#'/>
<type rdf:resource='http://purl.org/dc/dcmitype/Collection' xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />
</rdf:Description>
</rdf:RDF>
bin/riak console
Exec: /Users/justin/workspace/riak-1.0.3/erts-5.8.4/bin/erlexec -boot /Users/justin/workspace/riak-1.0.3/releases/1.0.3/riak -embedded -config /Users/justin/workspace/riak-1.0.3/etc/app.config -pa ./lib/basho-patches -args_file /Users/justin/workspace/riak-1.0.3/etc/vm.args -- console
Root: /Users/justin/workspace/riak-1.0.3
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:64] [hipe] [kernel-poll:true]
16:09:46.869 [info] Application lager started on node 'riak@127.0.0.1'
16:09:46.894 [info] Application sasl started on node 'riak@127.0.0.1'
16:09:46.899 [info] Application cluster_info started on node 'riak@127.0.0.1'
16:09:46.912 [info] Application erlang_js started on node 'riak@127.0.0.1'
16:09:46.931 [info] Application os_mon started on node 'riak@127.0.0.1'