Sha256: 74d98e34b89fcebdb54121a617de723078d1c1e1c5de98429912c000f071f9ae

Contents?: true

Size: 658 Bytes

Versions: 7

Compression:

Stored size: 658 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, @path)
          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

7 entries across 7 versions & 1 rubygems

Version Path
r10k-2.3.1 lib/r10k/action/puppetfile/check.rb
r10k-2.3.0 lib/r10k/action/puppetfile/check.rb
r10k-2.2.2 lib/r10k/action/puppetfile/check.rb
r10k-2.2.1 lib/r10k/action/puppetfile/check.rb
r10k-2.2.0 lib/r10k/action/puppetfile/check.rb
r10k-2.1.1 lib/r10k/action/puppetfile/check.rb
r10k-2.1.0 lib/r10k/action/puppetfile/check.rb