-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
61 lines (53 loc) · 1.54 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
require "rake/rdoctask"
require "yaml"
GEM_NAME = "smart_tuple"
begin
require "jeweler"
Jeweler::Tasks.new do |gem|
gem.name = GEM_NAME
gem.summary = "A Simple Yet Smart SQL Conditions Builder"
gem.description = "A Simple Yet Smart SQL Conditions Builder"
gem.email = "alex.r@askit.org"
gem.homepage = "http://github.com/dadooda/smart_tuple"
gem.authors = ["Alex Fortuna"]
gem.files = FileList[
"[A-Z]*",
"*.gemspec",
"init.rb",
"lib/**/*.rb",
"spec/**/*.rb",
]
end
rescue LoadError
STDERR.puts "This gem requires Jeweler to be built"
end
desc "Rebuild gemspec and package"
task :rebuild => [:gemspec, :build]
desc "Push (publish) gem to RubyGems.org"
task :push do
# NOTE: Yet found no way to ask Jeweler forge a complete version string for us.
vh = YAML.load(File.read("VERSION.yml"))
version = [vh[:major], vh[:minor], vh[:patch], vh[:build]].compact.join(".")
pkgfile = File.join("pkg", "#{GEM_NAME}-#{version}.gem")
Kernel.system("gem", "push", pkgfile)
end
desc "Generate RDoc documentation"
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = "doc"
rdoc.title = "SmartTuple"
#rdoc.options << "--line-numbers"
#rdoc.options << "--inline-source"
rdoc.rdoc_files.include("lib/**/*.rb")
end
desc "Compile README preview"
task :readme do
require "kramdown"
doc = Kramdown::Document.new(File.read "README.md")
fn = "README.html"
puts "Writing '#{fn}'..."
File.open(fn, "w") do |f|
f.write(File.read "dev/head.html")
f.write(doc.to_html)
end
puts ": ok"
end