-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathRakefile
64 lines (55 loc) · 1.94 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
62
63
require 'rubygems'
require 'bundler/setup'
$: << File.expand_path(File.dirname(__FILE__))
$: << File.expand_path(File.dirname(__FILE__)) + '/test'
require 'rake'
require 'rdoc/task'
require 'rake/testtask'
require 'lib/w3c_validators'
require 'fileutils'
include W3CValidators
desc 'Run the unit tests.'
Rake::TestTask.new do |t|
t.libs << 'lib'
t.libs << 'lib/test'
t.test_files = FileList['test/test*.rb'].exclude('test_helper.rb')
t.verbose = true
end
desc 'Generate documentation for W3C Validators.'
RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'Ruby W3C Validators'
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('CHANGELOG')
rdoc.rdoc_files.include('lib/*.rb')
rdoc.rdoc_files.include('lib/w3c_validators/*.rb')
end
desc 'Create the gem spec'
task :create_gemspec do
File.open("w3c_validators.gemspec","w") do |file|
file.puts <<-EOH
# Auto-generated gemspec
# Run 'rake generate_gemspec' to re-generate
Gem::Specification.new do |s|
s.name = "w3c_validators"
s.platform = Gem::Platform::RUBY
s.version = "1.1.1"
s.date = "2010-10-20"
s.summary = "Wrapper for the World Wide Web Consortium's online validation services."
s.email = "[email protected]"
s.homepage = "http://code.dunae.ca/w3c_validators"
s.description = "W3C Validators is a Ruby wrapper for the World Wide Web Consortium's online validation services."
s.has_rdoc = true
s.author = "Alex Dunae"
s.add_dependency('nokogiri', 'json')
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG', 'LICENSE']
s.rdoc_options << '--all' << '--inline-source' << '--line-numbers' << '--charset' << 'utf-8'
EOH
file.puts " s.test_files = ['" + Dir.glob('test/test_*.rb').join("','") + "']"
file.puts " s.files = ['" + FileList["{lib}/**/*"].join("','") + "']"
file.puts 'end'
end
end
task :default => :test