forked from flavorjones/loofah
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
75 lines (63 loc) · 2.1 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
64
65
66
67
68
69
70
71
72
73
74
75
require 'rubygems'
gem 'hoe', '>= 2.3.0'
require 'hoe'
Hoe.plugin :git
Hoe.spec "loofah" do
developer "Mike Dalessio", "mike.dalessio@gmail.com"
developer "Bryan Helmkamp", "bryan@brynary.com"
self.extra_rdoc_files = FileList["*.rdoc"]
self.history_file = "CHANGELOG.rdoc"
self.readme_file = "README.rdoc"
extra_deps << ["nokogiri", ">= 1.3.3"]
extra_dev_deps << ["mocha", ">=0.9"]
extra_dev_deps << ["thoughtbot-shoulda", ">=2.10"]
extra_dev_deps << ["acts_as_fu", ">=0.0.5"]
# note: .hoerc should have the following line to omit rails tests and tmp
# exclude: !ruby/regexp /\/tmp\/|\/rails_tests\/|CVS|TAGS|\.(svn|git|DS_Store)/
end
if File.exist?("rails_test/Rakefile")
load "rails_test/Rakefile"
else
task :test do
puts "----------"
puts "-- NOTE: An additional Rails regression test suite is available in source repository"
puts "----------"
end
end
task :redocs => :fix_css
task :docs => :fix_css
task :fix_css do
better_css = <<-EOT
.method-description pre {
margin : 1em 0 ;
}
.method-description ul {
padding : .5em 0 .5em 2em ;
}
.method-description p {
margin-top : .5em ;
}
#main ul, div#documentation ul {
list-style-type : disc ! IMPORTANT ;
list-style-position : inside ! IMPORTANT ;
}
h2 + ul {
margin-top : 1em;
}
EOT
puts "* fixing css"
File.open("doc/rdoc.css", "a") { |f| f.write better_css }
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "loofah"
gemspec.summary = "Transforming HTML/XML documents and fragments"
gemspec.description = "Loofah is a general library for manipulating and transforming HTML/XML documents and fragments. It’s built on top of Nokogiri and libxml2, so it’s fast and has a nice API. "
gemspec.email = "frenski@gmail.com.com"
gemspec.homepage = "git://github.com/frenski/loofah.git"
gemspec.authors = ["Mike Dalessio"]
end
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end