-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
60 lines (51 loc) · 1.52 KB
/
Rakefile
File metadata and controls
60 lines (51 loc) · 1.52 KB
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
require 'rake/clean'
require 'rake/testtask'
require 'rubygems/tasks'
require 'yard'
require 'rdoc/task'
require 'archive/zip'
require 'epub/maker'
require "tmpdir"
task :default => :test
task :test => 'test:default'
namespace :test do
task :default => [:build, :test]
desc 'Build test fixture EPUB file'
task :build => [:clean, "test/fixtures/book.epub"]
file "test/fixtures/book.epub" => "test/fixtures/book" do |task|
EPUB::Maker.archive task.source
# We cannot include "CASE-SENSITIVE.xhtml" in Git repository because
# macOS remove it or case-sensitive.xhtml from file system.
small_file = File.read("#{task.source}/OPS/case-sensitive.xhtml")
Dir.mktmpdir do |dir|
upcase_file_path = File.join(dir, "CASE-SENSITIVE.xhtml")
File.write upcase_file_path, small_file.sub('small file name', 'LARGE FILE NAME')
Archive::Zip.archive task.name, upcase_file_path, path_prefix: "OPS"
end
end
CLEAN.include "test/fixtures/book.epub"
Rake::TestTask.new do |task|
task.test_files = FileList['test/**/test_*.rb']
task.warning = true
task.options = '--no-show-detail-immediately --verbose'
end
end
task :doc => 'doc:default'
namespace :doc do
task :default => [:yard, :rdoc]
YARD::Rake::YardocTask.new
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include %w[
lib/**/*.rb
README.adoc
CHANGELOG.adoc
MIT-LICENSE
docs/**/*.adoc
docs/**/*.md
]
end
end
Gem::Tasks.new do |tasks|
tasks.console.command = 'pry'
end
task :build => :clean