Class: GitFonky::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/git_fonky/reporter.rb

Instance Method Summary collapse

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_attemptObject



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_successObject



20
21
22
# File 'lib/git_fonky/reporter.rb', line 20

def announce_sync_success
  report("-----> Successfully synced #{@repo} | #{@branch} branch")
end

#failed_pull_msgObject



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_msgObject



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_msgObject



24
25
26
# File 'lib/git_fonky/reporter.rb', line 24

def invalid_branch_msg
  report("Failed to validate upstream #{@branch}.")
end