-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
49 lines (38 loc) · 1.17 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
#!/usr/bin/rake -T
require 'rubocop/rake_task'
require 'puppetlabs_spec_helper/rake_tasks'
# Lint Material
begin
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_variables_not_enclosed')
PuppetLint.configuration.send('disable_class_parameter_defaults')
rescue LoadError
puts 'WARNING: Can not run lint tests. Could not find puppet-lint gem'
end
RuboCop::RakeTask.new
desc <<-EOM
** Run the Type and Provider walkthrough **
## Arguments ##
:pry = Pass any value to have the code drop you into the Pry debugger at
relevant breakpoints
EOM
task :Run_Walkthrough, [:pry] do |_t, args|
args.with_defaults(
:pry => false
)
Dir.chdir(File.dirname(__FILE__)) do
module_dir = File.basename(Dir.pwd)
if module_dir != 'learning_custom_types'
fail "You must name your module 'learning_custom_types' instead of '#{module_dir}'"
end
ENV['PRY'] = 'true' if args.pry
begin
sh %(puppet apply --basemodulepath="#{Dir.pwd}/.." tests/init.pp)
rescue RuntimeError => e
puts e.message
exit 1
end
end
end
task :run, [:pry] => :Run_Walkthrough