Class: Chronicle::Shell::ShellHistoryExtractor
- Inherits:
-
ETL::Extractor
- Object
- ETL::Extractor
- Chronicle::Shell::ShellHistoryExtractor
- Defined in:
- lib/chronicle/shell/shell_history_extractor.rb
Constant Summary collapse
- BASH_TIMESTAMP_REGEX =
/^\#(?<timestamp>[0-9]{10})/
Instance Method Summary collapse
Instance Method Details
#extract ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/chronicle/shell/shell_history_extractor.rb', line 26 def extract @commands.each do |command| = { username:, hostname:, shell_name: @config.shell } yield build_extraction(data: command, meta:) end end |
#prepare ⇒ Object
18 19 20 |
# File 'lib/chronicle/shell/shell_history_extractor.rb', line 18 def prepare @commands = load_commands end |
#results_count ⇒ Object
22 23 24 |
# File 'lib/chronicle/shell/shell_history_extractor.rb', line 22 def results_count @commands.count end |