-
Notifications
You must be signed in to change notification settings - Fork 70
/
Rakefile
98 lines (86 loc) · 2.68 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
96
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rdoc/task'
require 'rspec/core/rake_task'
require './lib/timeline_setter'
desc "generate templates and minified JS. Stash them in public/javascripts"
task :jammit do
%x{
cd #{TimelineSetter::ROOT} &&
jammit &&
mv public/assets/templates.js public/javascripts/templates.js &&
mv public/assets/main.js public/javascripts/timeline-setter.min.js
rm -rf public/assets
}
end
desc "build docs"
task :docs do
require 'rdiscount'
require 'erb'
version = TimelineSetter::VERSION
license = File.open('LICENSE.txt','r').read
mdown = RDiscount.new(ERB.new(File.open('doc/doc.markdown','r').read).result(binding), :smart).to_html
wrapper = File.open('doc/doc_wrapper.erb','r').read
mdown = File.open('index.html','w+') do |f|
f.write ERB.new(wrapper).result(binding)
end
end
desc "generate gh-pages"
task :gh_pages do
`rake docs`
`rake yard`
`rake docco`
`git branch` =~ /^\* (.+)?\n/
current_branch = $1
`git commit -am "docs"`
`git push github #{current_branch}`
`git checkout gh-pages`
`git merge #{current_branch}`
`git push -f github gh-pages`
`git checkout #{current_branch}`
end
desc "generate docco"
task :docco do
`docco ./public/javascripts/*.js`
`cp -R ./docs/* ./doc`
`rm -R docs`
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "timeline_setter"
gem.summary = %Q{TimelineSetter is a tool to create HTML timelines from spreadsheets of events.}
gem.description = %Q{TimelineSetter is a tool to create HTML timelines from spreadsheets of events.}
gem.email = "[email protected]"
gem.homepage = "http://github.com/propublica/timeline-setter"
gem.authors = ["Al Shaw", "Jeff Larson"]
gem.executables = "timeline-setter"
gem.require_paths = ['lib']
gem.add_dependency "json"
gem.add_dependency "table_fu"
gem.add_dependency "kompress", ">= 0.0.2"
gem.add_dependency "jammit"
gem.add_development_dependency "rspec", ">= 2.0.0"
gem.version = TimelineSetter::VERSION
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "TimelineSetter #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
# run tests with `rake spec`
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = 'spec/*_spec.rb'
spec.rspec_opts = ['--color', '--format nested']
end
desc "generate yard docs"
task :yard do
`yard -o ./documentation`
end