-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
43 lines (32 loc) · 1.04 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
require "rake"
require "rake/clean"
CLEAN.include ["rack-unreloader-*.gem", "rdoc", "coverage"]
desc "Build rack-unreloader gem"
task :package=>[:clean] do |p|
sh %{#{FileUtils::RUBY} -S gem build rack-unreloader.gemspec}
end
### Specs
desc "Run specs"
task :spec do
sh "#{FileUtils::RUBY} #{'-w' if RUBY_VERSION >= '3'} #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} spec/unreloader_spec.rb"
end
desc "Run specs with coverage"
task :spec_cov do
ENV['COVERAGE'] = '1'
sh "#{FileUtils::RUBY} spec/unreloader_spec.rb"
end
task :default => :spec
### RDoc
RDOC_DEFAULT_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', 'Rack::Unreloader: Reload application when files change, unloading constants first']
begin
gem 'hanna'
RDOC_DEFAULT_OPTS.concat(['-f', 'hanna'])
rescue Gem::LoadError
end
require "rdoc/task"
RDOC_OPTS = RDOC_DEFAULT_OPTS + ['--main', 'README.rdoc']
RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.options += RDOC_OPTS
rdoc.rdoc_files.add %w"README.rdoc CHANGELOG MIT-LICENSE lib/**/*.rb"
end