Skip to content

Commit

Permalink
Minor format detection updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Feb 6, 2012
1 parent 112aac7 commit 09fdfa9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/rdf/n3/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ module RDF::N3
#
# @see http://www.w3.org/TR/rdf-testcases/#ntriples
class Format < RDF::Format
content_type 'text/n3', :extension => :n3
content_type 'text/rdf+n3', :extension => :n3
content_type 'application/rdf+n3', :extension => :n3
content_type 'text/n3', :extension => :n3, :aliases => %w(text/rdf+n3 application/rdf+n3)
content_encoding 'utf-8'

reader { RDF::N3::Reader }
Expand Down Expand Up @@ -60,6 +58,9 @@ def self.detect(sample)
# RDF::Format.for(:ttl).reader #=> RDF::N3::Reader
# RDF::Format.for(:ttl).writer #=> RDF::N3::Writer
class Notation3 < RDF::Format
content_type 'text/n3', :extension => :n3
content_encoding 'utf-8'

reader { RDF::N3::Reader }
writer { RDF::N3::Writer }
end
Expand Down
2 changes: 1 addition & 1 deletion rdf-n3.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'rdf', '>= 0.3.4'
gem.add_development_dependency 'open-uri-cached', '>= 0.0.4'
gem.add_development_dependency 'spira', '>= 0.0.12'
gem.add_development_dependency 'rspec', '>= 2.5.0'
gem.add_development_dependency 'rspec', '>= 2.8.0'
gem.add_development_dependency 'rdf-spec', '>= 0.3.4'
gem.add_development_dependency 'rdf-rdfxml', '>= 0.3.3'
gem.add_development_dependency 'rdf-turtle', '>= 0.1.0'
Expand Down
3 changes: 0 additions & 3 deletions spec/format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
end

{
:ntriples => "<a> <b> <c> .",
:literal => '<a> <b> "literal" .',
:multi_line => '<a>\n <b>\n "literal"\n .',
:turtle => "@prefix foo: <bar> .\n foo:a foo:b <c> .",
:n3 => "@prefix foo: <bar> .\nfoo:bar = {<a> <b> <c>} .",
:default_prefix => ':a :b :c .',
Expand Down

0 comments on commit 09fdfa9

Please sign in to comment.