Class: GitFonky::Reporter
- Inherits:
-
Object
- Object
- GitFonky::Reporter
- Defined in:
- lib/git_fonky/reporter.rb
Instance Method Summary collapse
- #announce(action, direction, remote) ⇒ Object
- #announce_sync_attempt ⇒ Object
- #announce_sync_success ⇒ Object
- #failed_pull_msg ⇒ Object
- #failed_push_msg ⇒ Object
-
#initialize(repo, branch) ⇒ Reporter
constructor
A new instance of Reporter.
- #invalid_branch_msg ⇒ Object
Constructor Details
#initialize(repo, branch) ⇒ Reporter
Returns a new instance of Reporter.
7 8 9 10 |
# File 'lib/git_fonky/reporter.rb', line 7 def initialize(repo, branch) @repo = repo @branch = branch end |
Instance Method Details
#announce(action, direction, remote) ⇒ Object
16 17 18 |
# File 'lib/git_fonky/reporter.rb', line 16 def announce(action, direction, remote) report("-----> #{action.capitalize} #{direction} #{remote} #{@branch}") end |
#announce_sync_attempt ⇒ Object
12 13 14 |
# File 'lib/git_fonky/reporter.rb', line 12 def announce_sync_attempt report("Attempting to sync -> #{@repo} | #{@branch} branch", heading: true) end |
#announce_sync_success ⇒ Object
20 21 22 |
# File 'lib/git_fonky/reporter.rb', line 20 def announce_sync_success report("-----> Successfully synced #{@repo} | #{@branch} branch") end |
#failed_pull_msg ⇒ Object
28 29 30 |
# File 'lib/git_fonky/reporter.rb', line 28 def failed_pull_msg "#{"WARNING".blink}: Failed to pull from upstream #{@branch}. Moving on to next repo.".yellow end |
#failed_push_msg ⇒ Object
32 33 34 |
# File 'lib/git_fonky/reporter.rb', line 32 def failed_push_msg "#{"WARNING".blink}: Failed to push to origin #{@branch}. Moving on to next repo.".yellow end |
#invalid_branch_msg ⇒ Object
24 25 26 |
# File 'lib/git_fonky/reporter.rb', line 24 def invalid_branch_msg report("Failed to validate upstream #{@branch}.") end |