Class: Aspera::Products::Connect

Inherits:
Object
  • Object
show all
Defined in:
lib/aspera/products/connect.rb

Constant Summary collapse

APP_NAME =
'IBM Aspera Connect'

Class Method Summary collapse

Class Method Details

.locationsObject

standard folder locations



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/aspera/products/connect.rb', line 11

def locations
  case Aspera::Environment.os
  when Aspera::Environment::OS_WINDOWS then [{
    app_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Programs', 'Aspera', 'Aspera Connect'),
    log_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect', 'var', 'log'),
    run_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect')
  }]
  when Aspera::Environment::OS_MACOS then [{
    app_root: File.join(Dir.home, 'Applications', 'Aspera Connect.app'),
    log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
    run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
    sub_bin:  File.join('Contents', 'Resources')
  }, {
    app_root: File.join('', 'Applications', 'Aspera Connect.app'),
    log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
    run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
    sub_bin:  File.join('Contents', 'Resources')
  }, {
    app_root: File.join(Dir.home, 'Applications', 'IBM Aspera Connect.app'),
    log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
    run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
    sub_bin:  File.join('Contents', 'Resources')
  }, {
    app_root: File.join('', 'Applications', 'IBM Aspera Connect.app'),
    log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
    run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
    sub_bin:  File.join('Contents', 'Resources')
  }]
  else [{ # other: Linux and Unix family
    app_root: File.join(Dir.home, '.aspera', 'connect'),
    run_root: File.join(Dir.home, '.aspera', 'connect')
  }]
  end.map { |i| i.merge({ expected: APP_NAME }) }
end