Sha256: 5e426d94d9cee79b34334530b241d000a33568d7ade9cf4c8e795aa948a5efd5

Contents?: true

Size: 770 Bytes

Versions: 5

Compression:

Stored size: 770 Bytes

Contents

require 'r10k/puppetfile'
require 'r10k/action/base'
require 'r10k/errors/formatting'

module R10K
  module Action
    module Puppetfile
      class Check < R10K::Action::Base

        def call
          pf = R10K::Puppetfile.new(@root,
                                    {moduledir: @moduledir,
                                     puppetfile_path: @puppetfile})
          begin
            pf.load!
            $stderr.puts _("Syntax OK")
            true
          rescue => e
            $stderr.puts R10K::Errors::Formatting.format_exception(e, @trace)
            false
          end
        end

        private

        def allowed_initialize_opts
          super.merge(root: :self, puppetfile: :self, moduledir: :self)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
r10k-3.11.0 lib/r10k/action/puppetfile/check.rb
r10k-3.10.0 lib/r10k/action/puppetfile/check.rb
r10k-3.9.3 lib/r10k/action/puppetfile/check.rb
r10k-3.9.2 lib/r10k/action/puppetfile/check.rb
r10k-3.9.1 lib/r10k/action/puppetfile/check.rb