forked from premailer/css_parser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rakefile.rb
58 lines (49 loc) · 1.59 KB
/
rakefile.rb
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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'fileutils'
require 'lib/css_parser'
class File
# find a file in the load path or raise an exception if the file can
# not be found.
def File.find_file_in_path(filename)
$:.each do |path|
puts "Trying #{path}"
file_with_path = path+'/'+filename
return file_with_path if file?(file_with_path)
end
raise ArgumentError, "Can't find file #{filename} in Ruby library path"
end
end
include CssParser
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 = false
end
desc 'Generate documentation.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'Ruby CSS Parser'
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('CHANGELOG')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('lib/*.rb')
rdoc.rdoc_files.include('lib/css_parser/*.rb')
end
desc 'Generate fancy documentation.'
Rake::RDocTask.new(:fancy) do |rdoc|
rdoc.rdoc_dir = 'fdoc'
rdoc.title = 'Ruby CSS Parser'
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('CHANGELOG')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('lib/*.rb')
rdoc.rdoc_files.include('lib/css_parser/*.rb')
rdoc.template = File.expand_path(File.dirname(__FILE__) + '/doc-template.rb')
end