Class: TestProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::Configuration
- Defined in:
- lib/test_prof/core.rb
Overview
TestProf configuration
Instance Attribute Summary collapse
-
#color ⇒ Object
IO to write logs.
-
#output ⇒ Object
IO to write logs.
-
#output_dir ⇒ Object
IO to write logs.
-
#report_suffix ⇒ Object
IO to write logs.
-
#timestamps ⇒ Object
IO to write logs.
Instance Method Summary collapse
- #color? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #logger ⇒ Object
- #timestamps? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
174 175 176 177 178 179 180 |
# File 'lib/test_prof/core.rb', line 174 def initialize @output = $stdout @color = true @output_dir = "tmp/test_prof" @timestamps = false @report_suffix = ENV["TEST_PROF_REPORT"] end |
Instance Attribute Details
#color ⇒ Object
IO to write logs
168 169 170 |
# File 'lib/test_prof/core.rb', line 168 def color @color end |
#output ⇒ Object
IO to write logs
168 169 170 |
# File 'lib/test_prof/core.rb', line 168 def output @output end |
#output_dir ⇒ Object
IO to write logs
168 169 170 |
# File 'lib/test_prof/core.rb', line 168 def output_dir @output_dir end |
#report_suffix ⇒ Object
IO to write logs
168 169 170 |
# File 'lib/test_prof/core.rb', line 168 def report_suffix @report_suffix end |
#timestamps ⇒ Object
IO to write logs
168 169 170 |
# File 'lib/test_prof/core.rb', line 168 def @timestamps end |
Instance Method Details
#color? ⇒ Boolean
182 183 184 |
# File 'lib/test_prof/core.rb', line 182 def color? color == true && output.is_a?(IO) && output.tty? end |
#logger ⇒ Object
190 191 192 |
# File 'lib/test_prof/core.rb', line 190 def logger @logger ||= Logger.new(output, formatter: Logging::Formatter.new) end |
#timestamps? ⇒ Boolean
186 187 188 |
# File 'lib/test_prof/core.rb', line 186 def == true end |