2013-11-05 05:06:52 -05:00
|
|
|
module Files
|
2014-01-16 12:03:42 -05:00
|
|
|
class BaseService < ::BaseService
|
2013-11-05 05:06:52 -05:00
|
|
|
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
|