forked from slim-template/slim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
86 lines (72 loc) · 2.03 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
begin
require 'bundler'
Bundler::GemHelper.install_tasks
rescue Exception
end
require 'rake/testtask'
desc 'Run Slim benchmarks! (default parameters slow=false iterations=1000)'
task :bench, :iterations, :slow do
ruby('benchmarks/run-benchmarks.rb')
end
task 'test' => %w(test:core_and_plugins)
namespace 'test' do
task 'core_and_plugins' => %w(core literate logic_less translator)
Rake::TestTask.new('core') do |t|
t.libs << 'lib' << 'test/core'
t.test_files = FileList['test/core/test_*.rb']
t.verbose = true
#t.ruby_opts << '-w' << '-v'
end
Rake::TestTask.new('literate') do |t|
t.libs << 'lib' << 'test/literate'
t.test_files = FileList['test/literate/run.rb']
t.verbose = true
end
Rake::TestTask.new('logic_less') do |t|
t.libs << 'lib' << 'test/core'
t.test_files = FileList['test/logic_less/test_*.rb']
t.verbose = true
end
Rake::TestTask.new('translator') do |t|
t.libs << 'lib' << 'test/core'
t.test_files = FileList['test/translator/test_*.rb']
t.verbose = true
end
Rake::TestTask.new('rails') do |t|
t.libs << 'lib'
t.test_files = FileList['test/rails/test/test_*.rb']
t.verbose = true
end
begin
require 'rubygems'
require 'sinatra'
spec = Gem::Specification.find_by_name('sinatra')
Rake::TestTask.new('sinatra') do |t|
# FIXME: Rename deprecated attribute
file = "#{spec.gem_dir}/test/slim_test.rb"
code = File.read(file)
code.gsub!('attr_wrapper', 'attr_quote')
File.open(file, 'w') {|out| out.write(code) }
# Run Slim integration test in Sinatra
t.test_files = FileList[file]
t.verbose = true
end
rescue LoadError
task :sinatra do
abort 'Sinatra is not available'
end
end
end
begin
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = %w(lib/**/*.rb)
end
rescue LoadError
task :yard do
abort 'YARD is not available. In order to run yard, you must: gem install yard'
end
end
desc "Generate Documentation"
task :doc => :yard
task :default => 'test'