forked from riak-ripple/ripple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
98 lines (84 loc) · 2.27 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
97
98
require 'rubygems'
require 'rake'
require 'rake/clean'
PROJECTS = %w{riak-client ripple riak-sessions}
begin
require 'yard'
desc "Generate YARD documentation."
YARD::Rake::YardocTask.new do |yard|
docfiles = FileList['{riak-client,ripple,riak-sessions}/lib/**/*.rb']
docfiles.exclude '**/generators/**/templates/*'
yard.files = docfiles.to_a + ['-','RELEASE_NOTES.textile']
yard.options = ["--no-private"]
end
desc "Generate YARD documentation into a repo on the gh-pages branch."
task :doc => :yard do
original_dir = Dir.pwd
docs_dir = File.expand_path(File.join(original_dir, "..", "ripple-docs"))
rm_rf File.join(docs_dir, "*")
cp_r File.join(original_dir, "doc", "."), docs_dir
touch File.join(docs_dir, '.nojekyll')
end
rescue LoadError, NameError
end
namespace :spec do
PROJECTS.each do |dir|
desc "Run specs for sub-project #{dir}."
task dir do
Dir.chdir(dir) do
system 'rake spec'
end
end
end
desc "Run integration specs for all sub-projects."
task :integration do
%w{riak-client ripple}.each do |dir|
Dir.chdir(dir) do
system 'rake spec:integration'
end
end
end
end
desc "Regenerate all gemspecs."
task :gemspecs do
PROJECTS.each do |dir|
Dir.chdir(dir) do
system "rake gemspec"
end
end
end
desc "Release all gems to Rubygems.org."
task :release do
PROJECTS.each do |dir|
Dir.chdir(dir) do
system "rake release"
end
end
end
desc "Cleans up white space for each project"
task :clean_whitespace do
PROJECTS.each do |dir|
Dir.chdir(dir) do
no_file_cleaned = true
puts
puts ("=" * 20) + " #{dir} " + ("=" * 20)
Dir["**/*.rb"].each do |file|
contents = File.read(file)
cleaned_contents = contents.gsub(/([ \t]+)$/, '')
unless cleaned_contents == contents
no_file_cleaned = false
puts " - Cleaned #{file}"
File.open(file, 'w') { |f| f.write(cleaned_contents) }
end
end
if no_file_cleaned
puts "No files with trailing whitespace found"
end
end
end
end
desc "Run all sub-project specs."
task :spec => ["spec:riak-client", "spec:ripple", "spec:riak-sessions"]
task :default => :spec
CLOBBER.include(".yardoc")
CLOBBER.include("doc")