Class: GitAuto::Commands::HistoryAnalysisCommand
- Inherits:
-
Object
- Object
- GitAuto::Commands::HistoryAnalysisCommand
- Defined in:
- lib/git_auto/commands/history_analysis_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ HistoryAnalysisCommand
constructor
A new instance of HistoryAnalysisCommand.
Constructor Details
#initialize(options = {}) ⇒ HistoryAnalysisCommand
Returns a new instance of HistoryAnalysisCommand.
6 7 8 9 10 11 |
# File 'lib/git_auto/commands/history_analysis_command.rb', line 6 def initialize( = {}) @limit = [:limit] || 10 @git_service = Services::GitService.new @prompt = TTY::Prompt.new @spinner = TTY::Spinner.new("[:spinner] Analyzing commit history...") end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/git_auto/commands/history_analysis_command.rb', line 13 def execute @spinner.auto_spin commits = fetch_commits analysis = analyze_commits(commits) @spinner.success display_results(analysis) rescue StandardError => e puts "❌ Error analyzing commits: #{e.}".red exit 1 end |