forked from premailer/css_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile.rb
56 lines (50 loc) · 1.62 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
$:.unshift File.expand_path('../lib', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'fileutils'
require '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