Class: GitAutoCheckout::GitCheckoutHelper
- Inherits:
-
Object
- Object
- GitAutoCheckout::GitCheckoutHelper
- Defined in:
- lib/git_auto_checkout/git_checkout_helper.rb
Instance Attribute Summary collapse
-
#commits ⇒ Object
readonly
Internal: Gets the Array of GitCommits.
Instance Method Summary collapse
-
#initialize(page_size = 8) ⇒ GitCheckoutHelper
constructor
Internal: Intialize a CheckoutHelper.
-
#make_commit ⇒ Object
Internal: Prompt the user to select a past commit or quit, and checkout the past commit if one was selected.
Constructor Details
#initialize(page_size = 8) ⇒ GitCheckoutHelper
Internal: Intialize a CheckoutHelper.
9 10 11 12 13 14 15 |
# File 'lib/git_auto_checkout/git_checkout_helper.rb', line 9 def initialize(page_size = 8) @page_size = page_size log = `git log`.split("\n") parse_all_commits(log) get_git_branches end |
Instance Attribute Details
#commits ⇒ Object (readonly)
Internal: Gets the Array of GitCommits.
6 7 8 |
# File 'lib/git_auto_checkout/git_checkout_helper.rb', line 6 def commits @commits end |
Instance Method Details
#make_commit ⇒ Object
Internal: Prompt the user to select a past commit or quit, and checkout the past commit if one was selected.
Returns nothing.
21 22 23 24 25 26 |
# File 'lib/git_auto_checkout/git_checkout_helper.rb', line 21 def make_commit commit_or_branch = prompt_user_until_quit_or_commit_selection return unless commit_or_branch git_checkout(commit_or_branch) end |