Class: R10K::Action::Puppetfile::Check
- Inherits:
-
Object
- Object
- R10K::Action::Puppetfile::Check
- Includes:
- Logging, Util::Setopts
- Defined in:
- lib/r10k/action/puppetfile/check.rb
Constant Summary
Constants included from Logging
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(opts, argv) ⇒ Check
constructor
A new instance of Check.
Methods included from Logging
debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level
Constructor Details
#initialize(opts, argv) ⇒ Check
Returns a new instance of Check.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/r10k/action/puppetfile/check.rb', line 13 def initialize(opts, argv) @opts = opts @argv = argv setopts(opts, { :root => :self, :moduledir => :self, :puppetfile => :path, :trace => :self, }) end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/r10k/action/puppetfile/check.rb', line 25 def call pf = R10K::Puppetfile.new(@root, @moduledir, @path) begin pf.load! $stderr.puts "Syntax OK" true rescue => e $stderr.puts R10K::Errors::Formatting.format_exception(e, @trace) false end end |