Sha256: 51c2edb0f655e0dc3058da769a73425d1714eed62350d8e6f005e85867d4a502

Contents?: true

Size: 801 Bytes

Versions: 7

Compression:

Stored size: 801 Bytes

Contents

require 'r10k/puppetfile'
require 'r10k/util/setopts'
require 'r10k/errors/formatting'
require 'r10k/logging'

module R10K
  module Action
    module Puppetfile
      class Purge
        include R10K::Logging
        include R10K::Util::Setopts

        def initialize(opts, argv)
          @opts = opts
          @argv = argv

          setopts(opts, {
            :root       => :self,
            :moduledir  => :self,
            :puppetfile => :path,
            :trace      => :self,
          })
        end

        def call
          pf = R10K::Puppetfile.new(@root, @moduledir, @path)
          pf.load!
          pf.purge!
          true
        rescue => e
          logger.error R10K::Errors::Formatting.format_exception(e, @trace)
          false
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
r10k-2.0.3 lib/r10k/action/puppetfile/purge.rb
r10k-2.0.2 lib/r10k/action/puppetfile/purge.rb
r10k-2.0.1 lib/r10k/action/puppetfile/purge.rb
r10k-2.0.0 lib/r10k/action/puppetfile/purge.rb
r10k-1.5.1 lib/r10k/action/puppetfile/purge.rb
r10k-1.4.2 lib/r10k/action/puppetfile/purge.rb
r10k-1.4.1 lib/r10k/action/puppetfile/purge.rb