Class: TraceLocation::Generator::Log
- Defined in:
- lib/trace_location/generator/log.rb
Overview
:nodoc:
Constant Summary collapse
- EVENTS =
{ call: 'C', return: 'R' }.freeze
- INDENT_SPACES =
2- INDENT_STRING =
' '
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(events, return_value, options) ⇒ Log
constructor
A new instance of Log.
Constructor Details
#initialize(events, return_value, options) ⇒ Log
Returns a new instance of Log.
12 13 14 15 16 17 18 19 |
# File 'lib/trace_location/generator/log.rb', line 12 def initialize(events, return_value, ) super @current_dir = ::TraceLocation.config.current_dir @dest_dir = .fetch(:dest_dir) { ::TraceLocation.config.dest_dir } @current = Time.now @filename = "trace_location-#{@current.strftime('%Y%m%d%H%m%s')}.log" @file_path = File.join(@dest_dir, @filename) end |
Instance Method Details
#generate ⇒ Object
21 22 23 24 25 |
# File 'lib/trace_location/generator/log.rb', line 21 def generate setup_dir create_file $stdout.puts "Created at #{file_path}" end |