Class: Bootprint::Configuration
- Inherits:
-
Object
- Object
- Bootprint::Configuration
- Defined in:
- lib/bootprint/configuration.rb
Constant Summary collapse
- DEFAULT_ENV_PATTERNS =
[ /\A(?:DATABASE|REDIS|RAILS|RACK|BUNDLE|SECRET_KEY_BASE|RAILS_MASTER_KEY)(?:_|\z)/, /_URL\z/, /_HOST\z/, /_PORT\z/ ].freeze
Instance Attribute Summary collapse
-
#environment_names ⇒ Object
Returns the value of attribute environment_names.
-
#environment_patterns ⇒ Object
Returns the value of attribute environment_patterns.
-
#expected_platforms ⇒ Object
Returns the value of attribute expected_platforms.
-
#ignored_environment_names ⇒ Object
Returns the value of attribute ignored_environment_names.
-
#optional_environment_names ⇒ Object
Returns the value of attribute optional_environment_names.
-
#plugin_strict ⇒ Object
Returns the value of attribute plugin_strict.
-
#privacy ⇒ Object
Returns the value of attribute privacy.
-
#profile_boot ⇒ Object
Returns the value of attribute profile_boot.
-
#redaction_patterns ⇒ Object
Returns the value of attribute redaction_patterns.
-
#redaction_safe_list ⇒ Object
Returns the value of attribute redaction_safe_list.
-
#required_environment_names ⇒ Object
Returns the value of attribute required_environment_names.
-
#slow_initializer_threshold_ms ⇒ Object
Returns the value of attribute slow_initializer_threshold_ms.
Instance Method Summary collapse
- #capture_environment?(name) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/bootprint/configuration.rb', line 17 def initialize @environment_patterns = DEFAULT_ENV_PATTERNS.dup @environment_names = [] @ignored_environment_names = [] @required_environment_names = [] @optional_environment_names = [] @privacy = :standard @slow_initializer_threshold_ms = 500.0 @profile_boot = ENV["BOOTPRINT_PROFILE_BOOT"] == "1" @plugin_strict = false @redaction_patterns = %w[TOKEN SECRET PASSWORD PRIVATE_KEY AUTHORIZATION COOKIE] @redaction_safe_list = %w[checksum sha256 digest] @expected_platforms = [] end |
Instance Attribute Details
#environment_names ⇒ Object
Returns the value of attribute environment_names.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def environment_names @environment_names end |
#environment_patterns ⇒ Object
Returns the value of attribute environment_patterns.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def environment_patterns @environment_patterns end |
#expected_platforms ⇒ Object
Returns the value of attribute expected_platforms.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def expected_platforms @expected_platforms end |
#ignored_environment_names ⇒ Object
Returns the value of attribute ignored_environment_names.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def ignored_environment_names @ignored_environment_names end |
#optional_environment_names ⇒ Object
Returns the value of attribute optional_environment_names.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def optional_environment_names @optional_environment_names end |
#plugin_strict ⇒ Object
Returns the value of attribute plugin_strict.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def plugin_strict @plugin_strict end |
#privacy ⇒ Object
Returns the value of attribute privacy.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def privacy @privacy end |
#profile_boot ⇒ Object
Returns the value of attribute profile_boot.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def profile_boot @profile_boot end |
#redaction_patterns ⇒ Object
Returns the value of attribute redaction_patterns.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def redaction_patterns @redaction_patterns end |
#redaction_safe_list ⇒ Object
Returns the value of attribute redaction_safe_list.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def redaction_safe_list @redaction_safe_list end |
#required_environment_names ⇒ Object
Returns the value of attribute required_environment_names.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def required_environment_names @required_environment_names end |
#slow_initializer_threshold_ms ⇒ Object
Returns the value of attribute slow_initializer_threshold_ms.
12 13 14 |
# File 'lib/bootprint/configuration.rb', line 12 def slow_initializer_threshold_ms @slow_initializer_threshold_ms end |
Instance Method Details
#capture_environment?(name) ⇒ Boolean
32 33 34 35 36 |
# File 'lib/bootprint/configuration.rb', line 32 def capture_environment?(name) return false if ignored_environment_names.include?(name) environment_names.include?(name) || environment_patterns.any? { |pattern| pattern.match?(name) } end |