Class: TestProf::StackProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::StackProf::Configuration
- Defined in:
- lib/test_prof/stack_prof.rb
Overview
StackProf configuration
Constant Summary collapse
- FORMATS =
%w[html json].freeze
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #boot? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #raw? ⇒ Boolean
- #suite? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/test_prof/stack_prof.rb', line 31 def initialize @mode = ENV.fetch('TEST_STACK_PROF_MODE', :wall).to_sym @target = ENV['TEST_STACK_PROF'] == 'boot' ? :boot : :suite @raw = ENV['TEST_STACK_PROF_RAW'] != '0' @format = if FORMATS.include?(ENV['TEST_STACK_PROF_FORMAT']) ENV['TEST_STACK_PROF_FORMAT'] else 'html' end end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
29 30 31 |
# File 'lib/test_prof/stack_prof.rb', line 29 def format @format end |
#interval ⇒ Object
Returns the value of attribute interval.
29 30 31 |
# File 'lib/test_prof/stack_prof.rb', line 29 def interval @interval end |
#mode ⇒ Object
Returns the value of attribute mode.
29 30 31 |
# File 'lib/test_prof/stack_prof.rb', line 29 def mode @mode end |
#raw ⇒ Object
Returns the value of attribute raw.
29 30 31 |
# File 'lib/test_prof/stack_prof.rb', line 29 def raw @raw end |
#target ⇒ Object
Returns the value of attribute target.
29 30 31 |
# File 'lib/test_prof/stack_prof.rb', line 29 def target @target end |
Instance Method Details
#boot? ⇒ Boolean
47 48 49 |
# File 'lib/test_prof/stack_prof.rb', line 47 def boot? target == :boot end |
#raw? ⇒ Boolean
43 44 45 |
# File 'lib/test_prof/stack_prof.rb', line 43 def raw? @raw == true end |
#suite? ⇒ Boolean
51 52 53 |
# File 'lib/test_prof/stack_prof.rb', line 51 def suite? target == :suite end |