-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
49 lines (41 loc) · 1.3 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
require 'rubygems'
require 'yard'
require 'rspec/core/rake_task'
namespace :gem do
desc "Build the rdf-rdfa-#{File.read('VERSION').chomp}.gem file"
task :build do
sh "gem build rdf-rdfa.gemspec && mv rdf-rdfa-#{File.read('VERSION').chomp}.gem pkg/"
end
desc "Release the rdf-rdfa-#{File.read('VERSION').chomp}.gem file"
task :release do
sh "gem push pkg/rdf-rdfa-#{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
desc "Update RDFa Contexts"
task :update_contexts do
{
html: "http://www.w3.org/2011/rdfa-context/html-rdfa-1.1",
xhtml: "http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1",
xml: "http://www.w3.org/2011/rdfa-context/rdfa-1.1",
}.each do |v, uri|
puts "Build #{uri}"
vocab = File.expand_path(File.join(File.dirname(__FILE__), "lib", "rdf", "rdfa", "context", "#{v}.rb"))
FileUtils.rm_rf(vocab)
`./script/intern_context -o #{vocab} #{uri}`
end
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
task default: :spec
task specs: :spec