From 4330d87bf9d1ae58bd8325a08e8b7298655758bc Mon Sep 17 00:00:00 2001 From: KrauseFx Date: Mon, 9 May 2016 18:10:10 -0700 Subject: [PATCH] Added option to hide the commit message --- lib/lolcommits/plugins/loltext.rb | 4 ++++ lib/lolcommits/plugins/snapgit.rb | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/lolcommits/plugins/loltext.rb b/lib/lolcommits/plugins/loltext.rb index e190fbb..4d2f6c3 100644 --- a/lib/lolcommits/plugins/loltext.rb +++ b/lib/lolcommits/plugins/loltext.rb @@ -10,6 +10,10 @@ def self.name # enabled by default (if no configuration exists) def enabled? + # Added by Felix + # we have to access the configuration for the snapgit plugin here + config = runner.config.read_configuration if runner + return false unless config["snapgit"]["show_commit_messages"] !configured? || super end diff --git a/lib/lolcommits/plugins/snapgit.rb b/lib/lolcommits/plugins/snapgit.rb index 73e9061..c582c89 100644 --- a/lib/lolcommits/plugins/snapgit.rb +++ b/lib/lolcommits/plugins/snapgit.rb @@ -107,6 +107,9 @@ def configure_auth! print "\n4) Your Gravatar password: " gravatar_password = STDIN.gets.strip.downcase.to_s + print "\n5) Do you want to show the commit message on the picture? This is recommended for open source projects (y/n) " + show_commit_messages = (STDIN.gets.strip == "y") + puts '' puts '------------------------------' puts 'Successfully set up snapgit' @@ -115,7 +118,8 @@ def configure_auth! 'access_token' => access_token.token, 'secret' => access_token.secret, 'email' => gravatar_email, - 'password' => gravatar_password + 'password' => gravatar_password, + 'show_commit_messages' => show_commit_messages } end # rubocop:enable Metrics/MethodLength @@ -125,6 +129,7 @@ def configured? !configuration['enabled'].nil? && configuration['access_token'] && configuration['secret'] && + # configuration['show_commit_messages'] && # we don't do that, since it might be false configuration['email'] && configuration['password'] end