Class: RakeAudit::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_audit/configuration.rb

Overview

Holds all tunable settings for RakeAudit.

An instance is created lazily by config and mutated through configure. All attributes carry sane defaults so that the gem is safe to load even when nothing has been configured.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



37
38
39
40
41
42
43
44
45
46
# File 'lib/rake_audit/configuration.rb', line 37

def initialize
  @adapter = nil
  @logger = default_logger
  @capture_hostname = true
  @capture_pid = true
  @capture_ruby_version = true
  @capture_rails_env = true
  @web_ui_enabled = true
  @authenticate_with = nil
end

Instance Attribute Details

#adapterObject?

Returns storage adapter instance responding to #save(record). When nil, recording is a no-op.

Returns:

  • (Object, nil)

    storage adapter instance responding to #save(record). When nil, recording is a no-op.



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

def adapter
  @adapter
end

#authenticate_withProc?

Returns callable used to authenticate Web UI requests.

Returns:

  • (Proc, nil)

    callable used to authenticate Web UI requests.



35
36
37
# File 'lib/rake_audit/configuration.rb', line 35

def authenticate_with
  @authenticate_with
end

#capture_hostnameBoolean

Returns whether to capture the machine hostname.

Returns:

  • (Boolean)

    whether to capture the machine hostname.



20
21
22
# File 'lib/rake_audit/configuration.rb', line 20

def capture_hostname
  @capture_hostname
end

#capture_pidBoolean

Returns whether to capture the process id.

Returns:

  • (Boolean)

    whether to capture the process id.



23
24
25
# File 'lib/rake_audit/configuration.rb', line 23

def capture_pid
  @capture_pid
end

#capture_rails_envBoolean

Returns whether to capture the Rails environment.

Returns:

  • (Boolean)

    whether to capture the Rails environment.



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

def capture_rails_env
  @capture_rails_env
end

#capture_ruby_versionBoolean

Returns whether to capture the Ruby version.

Returns:

  • (Boolean)

    whether to capture the Ruby version.



26
27
28
# File 'lib/rake_audit/configuration.rb', line 26

def capture_ruby_version
  @capture_ruby_version
end

#loggerLogger

Returns logger used to report adapter save failures.

Returns:

  • (Logger)

    logger used to report adapter save failures.



17
18
19
# File 'lib/rake_audit/configuration.rb', line 17

def logger
  @logger
end

#web_ui_enabledBoolean

Returns whether the bundled Web UI is enabled.

Returns:

  • (Boolean)

    whether the bundled Web UI is enabled.



32
33
34
# File 'lib/rake_audit/configuration.rb', line 32

def web_ui_enabled
  @web_ui_enabled
end