Sha256: 9db16c0c1935dfac4b01bb1dd7fbb83c2a6dbb78ff32e70e59794b6050f1a4c7

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require_relative "mac/version"
require_relative "mac/xattr"

module Bundler
  module Mac
    def self.after_install_all(_)
      # Don't exclude "system" gems
      return unless Bundler.settings[:path]

      # Skip Spotlight indexing inside the bundle
      Bundler.bundle_path.join(".metadata_never_index").write("")

      # Tell Time Machine to skip backing up the bundle
      path = Bundler.bundle_path.to_s
      exclude_key = "com.apple.metadata:com_apple_backup_excludeItem"
      exclude_value = "bplist00_\x10\x11com.apple.backupd\b"
      Bundler.ui.debug "[time machine excluded] #{path}"
      Xattr.setxattr(path, exclude_key, exclude_value, exclude_value.size, 0, 0)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bundler-mac-0.1.0 lib/bundler/mac.rb