Module: ProconBypassMan::Configuration::ClassMethods

Included in:
ProconBypassMan
Defined in:
lib/procon_bypass_man/configuration.rb

Instance Method Summary collapse

Instance Method Details

#cacheObject



33
34
35
# File 'lib/procon_bypass_man/configuration.rb', line 33

def cache
  @@cache_table ||= ProconBypassMan::OnMemoryCache.new
end

#device_idString

Returns:

  • (String)


43
44
45
# File 'lib/procon_bypass_man/configuration.rb', line 43

def device_id
  ENV["DEBUG_DEVICE_ID"] || ProconBypassMan::WriteDeviceIdCommand.execute
end

#digest_pathObject



29
30
31
# File 'lib/procon_bypass_man/configuration.rb', line 29

def digest_path
  config.digest_path
end

#error_loggerObject



14
15
16
# File 'lib/procon_bypass_man/configuration.rb', line 14

def error_logger
  config.error_logger
end

#fallback_setting_pathObject



52
53
54
# File 'lib/procon_bypass_man/configuration.rb', line 52

def fallback_setting_path
  "/tmp/procon_bypass_man_fallback_setting.yaml"
end

#loggerObject



10
11
12
# File 'lib/procon_bypass_man/configuration.rb', line 10

def logger
  config.logger
end

#never_exit_accidentallyBoolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/procon_bypass_man/configuration.rb', line 48

def never_exit_accidentally
  config.never_exit_accidentally
end

#pidInteger?

Returns:

  • (Integer, nil)


23
24
25
26
27
# File 'lib/procon_bypass_man/configuration.rb', line 23

def pid
  File.read(pid_path).to_i
rescue Errno::ENOENT
  nil
end

#pid_pathObject



18
19
20
# File 'lib/procon_bypass_man/configuration.rb', line 18

def pid_path
  @@pid_path ||= File.expand_path("#{root}/pbm_pid", __dir__).freeze
end

#rootObject



6
7
8
# File 'lib/procon_bypass_man/configuration.rb', line 6

def root
  config.root
end

#session_idString

Returns:

  • (String)


38
39
40
# File 'lib/procon_bypass_man/configuration.rb', line 38

def session_id
  ProconBypassMan::WriteSessionIdCommand.execute
end