Class: Fourchette::GitHub
- Inherits:
-
Object
- Object
- Fourchette::GitHub
- Includes:
- Logger
- Defined in:
- lib/fourchette/github.rb
Instance Method Summary collapse
- #comment_pr(pr_number, comment) ⇒ Object
- #delete_hook ⇒ Object
- #disable_hook ⇒ Object
- #enable_hook ⇒ Object
- #update_hook ⇒ Object
Methods included from 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_hook ⇒ Object
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_hook ⇒ Object
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_hook ⇒ Object
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_hook ⇒ Object
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 |