Sha256: 65845638d243d92ae9fc8d163160786f68398cf7daff8d4a135952ef36a3009e

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

#!/usr/bin/env ruby -s
require 'rubygems'
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), "..", 'lib'))
require 'rdf_context'
require 'spec/rdfa_helper'
require 'getoptlong'

def run_tc(tc)
  puts "run #{tc.name}"
  graph = RdfContext::RdfaParser.parse(tc.input, tc.informationResourceInput, :strict => $strict, :version => tc.version)
  puts graph.serialize(:format => $format.to_sym, :base => tc.informationResourceInput) unless $quiet
end

$verbose = false
$format = :ntriples
$strict = false
suite = "xhtml"
opts = GetoptLong.new(
  ["--debug", GetoptLong::NO_ARGUMENT],
  ["--verbose", GetoptLong::NO_ARGUMENT],
  ["--quiet", GetoptLong::NO_ARGUMENT],
  ["--suite", GetoptLong::OPTIONAL_ARGUMENT],
  ["--strict", GetoptLong::NO_ARGUMENT],
  ["--format", GetoptLong::REQUIRED_ARGUMENT]
)
opts.each do |opt, arg|
  case opt
  when '--verbose' then $verbose = true
  when '--quiet' then $quiet = true
  when '--debug' then ::RdfContext::debug = true
  when '--format' then $format = arg
  when '--suite' then suite = arg
  when '--strict' then $strict = true
  end
end

test_cases = RdfaHelper::TestCase.test_cases(suite)

puts test_cases.length

test_cases = test_cases.detect do |tc|
  next unless ARGV.empty? || ARGV.any? {|n| tc.name.match(/#{n}/)}
  run_tc(tc)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdf_context-0.5.8.2 script/tc
rdf_context-0.5.8.1 script/tc