forked from ikayzo/SDL.rb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
95 lines (83 loc) · 2.81 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/gempackagetask'
require 'rake/packagetask'
require 'rubygems'
lib_dir = File.expand_path('lib')
test_dir = File.expand_path('test')
# Use Hanna as the documentation template if installated,
# otherwise generate with the default RDoc generator.
if USING_HANNA = Gem.required_location("hanna", "hanna/rdoctask.rb")
require 'hanna/rdoctask'
else
require 'rake/rdoctask'
end
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.summary = "Simple Declarative Language for Ruby library"
s.name = 'sdl4r'
require File.dirname(__FILE__) + "/lib/sdl4r/sdl4r_version.rb"
s.version = SDL4R::VERSION
s.requirements << 'none'
s.require_path = 'lib'
s.authors = ['Philippe Vosges', 'Daniel Leuck']
s.email = '[email protected]'
s.rubyforge_project = 'sdl4r'
s.homepage = 'http://sdl4r.rubyforge.org/'
s.files = FileList['lib/sdl4r.rb', 'lib/sdl4r/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*', 'doc/**/*'].to_a
s.test_files = FileList[ 'test/**/*test.rb' ].to_a
s.description = <<-EOF
The Simple Declarative Language provides an easy way to describe lists, maps,
and trees of typed data in a compact, easy to read representation.
For property files, configuration files, logs, and simple serialization
requirements, SDL provides a compelling alternative to XML and Properties
files.
EOF
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
Rake::RDocTask.new do |rd|
files = ['README', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc']
rd.main = 'README'
rd.rdoc_files.include(files)
rd.rdoc_files.exclude("lib/scratchpad.rb")
rd.rdoc_dir = "doc"
rd.title = "RDoc: Simple Declarative Language for Ruby"
rd.options << '--charset' << 'utf-8'
rd.options << '--line-numbers'
rd.options << '--inline-source'
end
if Gem.required_location("yard", "yard.rb")
require 'yard'
YARD::Rake::YardocTask.new do |t|
files = FileList.new('README', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc')
files.exclude("lib/scratchpad.rb")
t.files = files.to_ary
end
end
Rake::TestTask.new do |t|
t.test_files = FileList['test/**/*test.rb']
t.verbose = true
t.libs = [lib_dir, test_dir]
t.warning = true
end
# Generates the SDL4R site with Nanoc.
nanoc_compile = task :nanoc_compile do
puts "The Nanoc tasks might work better from the command line." if ENV["NB_EXEC_EXTEXECUTION_PROCESS_UUID"]
Dir.chdir("nanoc") {
system("nanoc", "compile")
}
end
nanoc_compile.comment = "Builds the site with Nanoc"
if Gem.required_location("ruby-prof", "ruby-prof/task.rb")
require 'ruby-prof/task'
RubyProf::ProfileTask.new do |t|
t.test_files = FileList['test/**/*_prof.rb']
t.output_dir = "."
t.printer = :graph_html
t.min_percent = 1
end
end