Sha256: e155e3798d0375127b377c4e85a0c9d4fe84c80f4860b95b83f3f36b80ca8631

Contents?: true

Size: 295 Bytes

Versions: 65

Compression:

Stored size: 295 Bytes

Contents

module PEBuild
  module Idempotent

    # @param fpath [String]
    # @param desc [String, nil]
    def idempotent(fpath, desc = nil, &block)
      desc ||= fpath

      if File.exist? fpath
        @logger.info "#{desc} is already present."
      else
        yield
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
vagrant-pe_build-0.19.2 lib/pe_build/idempotent.rb
vagrant-pe_build-0.19.1 lib/pe_build/idempotent.rb
vagrant-pe_build-0.19.0 lib/pe_build/idempotent.rb
vagrant-pe_build-0.18.2 lib/pe_build/idempotent.rb
vagrant-pe_build-0.18.1 lib/pe_build/idempotent.rb
vagrant-pe_build-0.18.0 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.14 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.13 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.12 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.11 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.10 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.9 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.8 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.7 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.6 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.5 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.4 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.3 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.2 lib/pe_build/idempotent.rb
vagrant-pe_build-0.17.1 lib/pe_build/idempotent.rb