Class: Fourchette::GitHub

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/fourchette/github.rb

Instance Method Summary collapse

Methods included from Logger

#logger

Instance Method Details

#comment_pr(pr_number, comment) ⇒ Object



32
33
34
35
# File 'lib/fourchette/github.rb', line 32

def comment_pr pr_number, comment
  comment = "****** FOURCHETTE COMMENT ******\n\n#{comment}\n\n****** END OF FOURCHETTE COMMENT ******" if Fourchette::DEBUG
  octokit.add_comment(ENV['FOURCHETTE_GITHUB_PROJECT'], pr_number, comment)
end

#delete_hookObject



27
28
29
30
# File 'lib/fourchette/github.rb', line 27

def delete_hook
  logger.info 'Removing the hook for your app...'
  octokit.remove_hook(ENV['FOURCHETTE_GITHUB_PROJECT'], fourchette_hook.id)
end

#disable_hookObject



13
14
15
16
17
18
19
20
# File 'lib/fourchette/github.rb', line 13

def disable_hook
  logger.info 'Disabling the hook for your app...'
  if fourchette_hook && fourchette_hook.active == true
    disable(fourchette_hook)
  else
    logger.error 'Nothing to disable, move along!'
  end
end

#enable_hookObject



4
5
6
7
8
9
10
11
# File 'lib/fourchette/github.rb', line 4

def enable_hook
  logger.info 'Enabling the hooks for your app...'
  if fourchette_hook
    enable(fourchette_hook)
  else
    create_hook
  end
end

#update_hookObject



22
23
24
25
# File 'lib/fourchette/github.rb', line 22

def update_hook
  logger.info 'Updating the hook for your app...'
  toggle_active_state_to fourchette_hook, fourchette_hook.active
end