Class: Avm::Scms::AutoCommit::Rules::Manual::WithFile
- Inherits:
-
Base::WithFile
- Object
- Base::WithFile
- Avm::Scms::AutoCommit::Rules::Manual::WithFile
- Defined in:
- lib/avm/scms/auto_commit/rules/manual.rb
Constant Summary collapse
- SKIP_OPTION =
's'
Instance Method Summary collapse
Methods inherited from Base::WithFile
Instance Method Details
#commit_info ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/avm/scms/auto_commit/rules/manual.rb', line 15 def commit_info return nil unless file.commits.any? input('Which commit?', list: commits_by_position).if_present do |v| new_commit_info.fixup(v) end end |
#commits_banner ⇒ Object
24 25 26 27 28 29 |
# File 'lib/avm/scms/auto_commit/rules/manual.rb', line 24 def file.commits.each_with_index do |commit, _index| infov " #{commit.position}", commit end infov " #{SKIP_OPTION}", 'skip' end |
#commits_by_position ⇒ Object
31 32 33 34 |
# File 'lib/avm/scms/auto_commit/rules/manual.rb', line 31 def commits_by_position (file.commits.map { |commit| [commit.position.to_s, commit] } + [[SKIP_OPTION, nil]]) .to_h end |