-
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Rakefile
78 lines (64 loc) · 1.86 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
# frozen_string_literal: true
require 'bundler/gem_tasks'
begin
require 'rspec'
require 'rspec/core'
require 'rspec/core/rake_task'
require 'octorelease' unless ENV['CI']
require 'parallel'
require 'rubocop/rake_task'
rescue LoadError
end
require 'awspec'
types = Awspec::Helper::Type::TYPES.map do |type|
"spec:#{type}"
end
if defined?(RSpec)
task spec: 'spec:all'
namespace :spec do
task :parallel do
Parallel.each(types.concat([
'spec:account',
'spec:core',
'spec:generator_spec',
'spec:generator_doc',
'spec:helper'
])) do |t|
puts ''
Rake::Task[t].execute
end
end
task all: ['spec:type',
'spec:account',
'spec:core',
'spec:generator_spec',
'spec:generator_doc',
'spec:helper']
task type: types
Awspec::Helper::Type::TYPES.map do |type|
RSpec::Core::RakeTask.new(type) do |t|
t.pattern = "spec/type/#{type}_spec.rb"
end
end
RSpec::Core::RakeTask.new(:account) do |t|
t.pattern = 'spec/type/account_spec.rb'
end
RSpec::Core::RakeTask.new(:core) do |t|
t.pattern = 'spec/core/*_spec.rb'
end
RSpec::Core::RakeTask.new(:generator_spec) do |t|
t.pattern = 'spec/generator/spec/*_spec.rb'
end
RSpec::Core::RakeTask.new(:generator_doc) do |t|
t.pattern = 'spec/generator/doc/*_spec.rb'
end
RSpec::Core::RakeTask.new(:helper) do |t|
t.pattern = 'spec/lib/awspec/helper/*_spec.rb'
end
RuboCop::RakeTask.new
end
end
task :generate_docs do
docs = Awspec::Generator::Doc::Type.generate_doc
File.write('doc/resource_types.md', "#{docs}\n")
end