forked from tomafro/recap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
34 lines (30 loc) · 1015 Bytes
/
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
require 'bundler/gem_tasks'
require 'rocco/tasks'
require 'rspec/core/rake_task'
desc 'build docs'
task :doc do
FileUtils.cd('lib') do
files = Dir['**/*.rb']
files.each do |source_file|
rocco = Rocco.new(source_file, files.to_a, {:stylesheet => "http://gofreerange.com/stylesheets/rocco.css"})
dest_file = '../doc/' + source_file.sub(Regexp.new("#{File.extname(source_file)}$"), '.html')
FileUtils.mkdir_p(File.dirname(dest_file))
File.open(dest_file, 'wb') { |fd| fd.write(rocco.to_html) }
end
end
File.open('doc/index.html', 'w') do |f|
f.write <<-EOS
<html><meta http-equiv="refresh" content="0; url=recap.html">
EOS
end
end
desc 'publish docs'
task :publish do
path = "/home/freerange/docs/recap"
system %{ssh gofreerange.com "sudo rm -fr #{path} && mkdir -p #{path}" && scp -r doc/* gofreerange.com:#{path}}
end
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts = "-fn --color"
end
task :default => :spec