summaryrefslogtreecommitdiff
path: root/app/services/files/base_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/files/base_service.rb')
-rw-r--r--app/services/files/base_service.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb
new file mode 100644
index 00000000000..f1765d38976
--- /dev/null
+++ b/app/services/files/base_service.rb
@@ -0,0 +1,31 @@
+module Files
+ class BaseService < ::BaseService
+ attr_reader :ref, :path
+
+ def initialize(project, user, params, ref, path = nil)
+ @project, @current_user, @params = project, user, params.dup
+ @ref = ref
+ @path = path
+ end
+
+ private
+
+ def error(message)
+ {
+ error: message,
+ status: :error
+ }
+ end
+
+ def success
+ {
+ error: '',
+ status: :success
+ }
+ end
+
+ def repository
+ project.repository
+ end
+ end
+end