-
Notifications
You must be signed in to change notification settings - Fork 10
/
Rakefile
73 lines (64 loc) · 1.81 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
# Omega Project Rakefile
#
# Copyright (C) 2010-2012 Mohammed Morsi <[email protected]>
# Licensed under the AGPLv3+ http://www.gnu.org/licenses/agpl.txt
require "rake/packagetask"
Rake::PackageTask.new("omega", "0.8.2") do |p|
p.need_tar = true
p.package_files.include("bin/**/*","examples/**/*", "lib/**/*",
"site/**/*", "spec/**/*", "vendor/**/*",
"tests/**/*", "omega.yml", "Rakefile",
"COPYING", "LICENSE", "README.md")
p.package_files.exclude("lib/rjr*", "site/build/**/*")
end
begin
require 'parallel_tests'
desc "Run all specs"
task :specs do |task, args|
require 'parallel_tests/tasks'
Rake::Task['parallel:spec'].invoke
end
rescue LoadError => e
begin
require "rspec/core/rake_task"
desc "Run all specs"
RSpec::Core::RakeTask.new(:specs) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rspec_opts = ['--backtrace', '-fd', '-c']
end
rescue LoadError => e
end
end
begin
require "yard"
YARD::Rake::YardocTask.new do |t|
end
rescue LoadError => e
end
desc 'Print the RJR accessible api'
task 'rjr_api' do
puts "RJR API: "
Dir.glob('lib/*/rjr/*.rb').each { |f|
File.open(f).read.split("\n").
select { |l| ! l.scan(/^([a-zA-Z_])* = proc/).empty? }.
collect { |l| l.gsub(/ = proc/, '') }.
each { |m|
puts "#{f.split('/')[1]}::#{m}"
}
}
end
# TODO task to output api callback methods client can handle
namespace :site do
desc 'Preview the site'
task 'preview' do
puts "Starting middleman at http://localhost:4567"
Dir.chdir 'site'
exec("middleman server -p 4567 --verbose")
end
desc 'Build the site'
task 'build' do
Dir.chdir 'site'
exec("middleman build")
end
# FIXME doc, package, and test tasks for site
end