Class: Agent::Sessions::Audit

Inherits:
Object
  • Object
show all
Includes:
HomeExpansion
Defined in:
lib/agent/sessions/audit.rb

Overview

Answers: are these plaintext transcripts inside anything that syncs? Needs only Layer 1. Time Machine exclusion status is a planned addition.

Defined Under Namespace

Classes: Finding

Constant Summary collapse

SYNC_ROOTS =
{
  dropbox: ["~/Dropbox"],
  icloud: ["~/Library/Mobile Documents"],
  cloud_storage: ["~/Library/CloudStorage"],
  onedrive: ["~/OneDrive"],
  google_drive: ["~/Google Drive"]
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(stores, env: ENV) ⇒ Audit

Returns a new instance of Audit.



20
21
22
23
# File 'lib/agent/sessions/audit.rb', line 20

def initialize(stores, env: ENV)
  @stores = stores
  @env = env
end

Instance Method Details

#reportObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/agent/sessions/audit.rb', line 25

def report
  @stores.flat_map do |store|
    store.layers.select(&:exists?).map do |location|
      Finding.new(
        agent: store.agent,
        kind: location.kind,
        path: location.path,
        bytes: bytes_under(location.path),
        synced_to: sync_services_for(location.path)
      )
    end
  end
end