Class: Ace::GitCommit::Models::CommitOptions
- Inherits:
-
Object
- Object
- Ace::GitCommit::Models::CommitOptions
- Defined in:
- lib/ace/git_commit/models/commit_options.rb
Overview
CommitOptions encapsulates all options for a commit operation
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#files ⇒ Object
Returns the value of attribute files.
-
#force ⇒ Object
Returns the value of attribute force.
-
#intention ⇒ Object
Returns the value of attribute intention.
-
#message ⇒ Object
Returns the value of attribute message.
-
#model ⇒ Object
Returns the value of attribute model.
-
#no_split ⇒ Object
Returns the value of attribute no_split.
-
#only_staged ⇒ Object
Returns the value of attribute only_staged.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(intention: nil, message: nil, model: nil, files: [], only_staged: false, dry_run: false, debug: false, force: false, verbose: true, quiet: false, no_split: false) ⇒ CommitOptions
constructor
A new instance of CommitOptions.
-
#specific_files? ⇒ Boolean
Check if specific files are targeted.
-
#stage_all? ⇒ Boolean
Check if we should stage all changes.
-
#to_h ⇒ Hash
Convert to hash for debugging.
-
#use_llm? ⇒ Boolean
Check if we should use LLM generation.
Constructor Details
#initialize(intention: nil, message: nil, model: nil, files: [], only_staged: false, dry_run: false, debug: false, force: false, verbose: true, quiet: false, no_split: false) ⇒ CommitOptions
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 11 def initialize( intention: nil, message: nil, model: nil, files: [], only_staged: false, dry_run: false, debug: false, force: false, verbose: true, quiet: false, no_split: false ) @intention = intention = @model = model @files = files || [] @only_staged = only_staged @dry_run = dry_run @debug = debug @force = force @verbose = verbose @quiet = quiet @no_split = no_split end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def debug @debug end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def dry_run @dry_run end |
#files ⇒ Object
Returns the value of attribute files.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def files @files end |
#force ⇒ Object
Returns the value of attribute force.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def force @force end |
#intention ⇒ Object
Returns the value of attribute intention.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def intention @intention end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def end |
#model ⇒ Object
Returns the value of attribute model.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def model @model end |
#no_split ⇒ Object
Returns the value of attribute no_split.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def no_split @no_split end |
#only_staged ⇒ Object
Returns the value of attribute only_staged.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def only_staged @only_staged end |
#quiet ⇒ Object
Returns the value of attribute quiet.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def quiet @quiet end |
#verbose ⇒ Object
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 8 def verbose @verbose end |
Instance Method Details
#specific_files? ⇒ Boolean
Check if specific files are targeted
45 46 47 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 45 def specific_files? !@files.empty? end |
#stage_all? ⇒ Boolean
Check if we should stage all changes
51 52 53 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 51 def stage_all? !@only_staged && !specific_files? end |
#to_h ⇒ Hash
Convert to hash for debugging
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 57 def to_h { intention: @intention, message: , model: @model, files: @files, only_staged: @only_staged, dry_run: @dry_run, debug: @debug, force: @force, verbose: @verbose, quiet: @quiet, no_split: @no_split } end |
#use_llm? ⇒ Boolean
Check if we should use LLM generation
39 40 41 |
# File 'lib/ace/git_commit/models/commit_options.rb', line 39 def use_llm? .nil? || .empty? end |