forked from tmatilai/vagrant-proxyconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
62 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
62
require 'bundler/gem_tasks'
require 'cane/rake_task'
require 'rspec/core/rake_task'
require 'tailor/rake_task'
task :default => [:test, :quality]
# Remove 'install' task as the gem is installed to Vagrant, not to system
Rake::Task[:install].clear
namespace :test do
RSpec::Core::RakeTask.new('unit') do |task|
task.pattern = 'spec/unit/**/*_spec.rb'
end
end
desc "Run all tests"
task :test => ['test:unit']
task :spec => :test
Tailor::RakeTask.new do |task|
task.file_set('lib/**/*.rb', 'code') do |style|
style.allow_unnecessary_double_quotes false, level: :off
style.max_line_length 100, level: :warn
style.max_line_length 140, level: :error
end
task.file_set('spec/**/*.rb', 'tests') do |style|
style.allow_unnecessary_double_quotes false, level: :off
style.max_line_length 120, level: :warn
# allow vertical alignment of `let(:foo) { block }` blocks
style.spaces_before_lbrace 1, level: :off
style.indentation_spaces 2, level: :off
end
end
Cane::RakeTask.new(:cane) do |task|
task.abc_max = 16
task.style_measure = 140
task.options[:color] = true
end
desc 'Run all quality tasks'
task :quality => [:cane, :tailor]
desc "Update gh-pages"
task 'gh-pages' do
require 'tmpdir'
rev = `git rev-parse HEAD`.chomp
Dir.mktmpdir do |clone|
sh %Q{git clone --branch gh-pages "#{File.expand_path('..', __FILE__)}" "#{clone}"}
Dir.chdir(clone) do
sh %Q{_bin/update "#{rev}"}
end
end
end
begin
require 'yard'
YARD::Rake::YardocTask.new
rescue LoadError
# gem not installed on the CI server
end