flag request API as not_implemented

This commit is contained in:
Konstantin Haase 2015-02-17 13:11:57 +01:00
parent 49b03750e4
commit e19a9a5bed
3 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,8 @@ module Travis
LoginRequired = ClientError .create('login required', status: 403)
InsufficientAccess = ClientError .create(status: 403)
WrongParams = ClientError .create('wrong parameters')
ServerError = Error .create(status: 500)
NotImplemented = ServerError .create(status: 501, 'request not (yet) implemented')
end
end
end

View File

@ -29,6 +29,10 @@ module Travis::API::V3
raise(error, type || self.class.result_type)
end
def run!
not_implemented
end
def run
not_found unless result = run!
result = Result.new(self.class.result_type, result) unless result.is_a? Result
@ -38,5 +42,9 @@ module Travis::API::V3
def accepted(type = self.class.result_type)
Result.new(:accepted, type, status: 202)
end
def not_implemented
raise NotImplemented
end
end
end

View File

@ -3,6 +3,7 @@ module Travis::API::V3
helpers :repository
def run
not_implemented
query.schedule_for(repository)
accepted
end