summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat/responder/base.rb
diff options
context:
space:
mode:
authorJames Fargher <proglottis@gmail.com>2019-01-30 11:10:04 +1300
committerJames Fargher <proglottis@gmail.com>2019-02-07 10:55:30 +1300
commitbdd1bac2f0ca6760376ae422c68ba9c787c199c3 (patch)
tree2b90be8ecb8f93c75ccd5247c6d47e330d70b7e1 /lib/gitlab/chat/responder/base.rb
parentf67690057b4711654f71565999040c1819aa0323 (diff)
downloadgitlab-ce-bdd1bac2f0ca6760376ae422c68ba9c787c199c3.tar.gz
Move ChatOps to Coremove_chatops_to_core
ChatOps used to be in the Ultimate tier.
Diffstat (limited to 'lib/gitlab/chat/responder/base.rb')
-rw-r--r--lib/gitlab/chat/responder/base.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/gitlab/chat/responder/base.rb b/lib/gitlab/chat/responder/base.rb
new file mode 100644
index 00000000000..f1ad0e36793
--- /dev/null
+++ b/lib/gitlab/chat/responder/base.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Chat
+ module Responder
+ class Base
+ attr_reader :build
+
+ # build - The `Ci::Build` that was executed.
+ def initialize(build)
+ @build = build
+ end
+
+ def pipeline
+ build.pipeline
+ end
+
+ def project
+ pipeline.project
+ end
+
+ def success(*)
+ raise NotImplementedError, 'You must implement #success(output)'
+ end
+
+ def failure
+ raise NotImplementedError, 'You must implement #failure'
+ end
+
+ def send_response(output)
+ raise NotImplementedError, 'You must implement #send_response(output)'
+ end
+
+ def scheduled_output
+ raise NotImplementedError, 'You must implement #scheduled_output'
+ end
+ end
+ end
+ end
+end