-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRakefile
61 lines (50 loc) · 1.53 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'rubygems'
require 'rubygems'
require 'yard'
require 'rspec/core/rake_task'
namespace :gem do
desc "Build the rdf-rdfxml-#{File.read('VERSION').chomp}.gem file"
task :build do
sh "gem build rdf-rdfxml.gemspec && mv rdf-rdfxml-#{File.read('VERSION').chomp}.gem pkg/"
end
desc "Release the rdf-rdfxml-#{File.read('VERSION').chomp}.gem file"
task :release do
sh "gem push pkg/rdf-rdfxml-#{File.read('VERSION').chomp}.gem"
end
end
RSpec::Core::RakeTask.new(:spec)
desc "Run specs through RCov"
RSpec::Core::RakeTask.new("spec:rcov") do |spec|
spec.rcov = true
spec.rcov_opts = %q[--exclude "spec"]
end
namespace :doc do
YARD::Rake::YardocTask.new
desc "Generate HTML report specs"
RSpec::Core::RakeTask.new("spec") do |spec|
spec.rspec_opts = ["--format", "html", "-o", "doc/spec.html"]
end
end
desc "Generate RDF Core Manifest.yml"
namespace :spec do
task :prepare do
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'rdf/rdfxml'
require 'spec/rdf_helper'
require 'fileutils'
yaml = File.join(RDFCORE_DIR, "Manifest.yml")
FileUtils.rm_f(yaml)
RdfHelper::TestCase.to_yaml(RDFCORE_TEST, RDFCORE_DIR, yaml)
end
end
task specs: :spec
task default: :spec
desc "Generate etc/doap.{nt,ttl} from etc/doap.html."
task :doap do
require 'rdf/rdfxml'
require 'rdf/turtle'
require 'rdf/ntriples'
g = RDF::Graph.load("etc/doap.rdf")
RDF::NTriples::Writer.open("etc/doap.nt") {|w| w <<g }
RDF::Turtle::Writer.open("etc/doap.ttl", standard_prefixes: true) {|w| w <<g }
end