remove query and permission

This commit is contained in:
carlad 2016-01-11 14:43:23 +01:00
parent cf20650d39
commit 2d00e16962
3 changed files with 6 additions and 24 deletions

View File

@ -1,9 +0,0 @@
require 'travis/api/v3/permissions/generic'
module Travis::API::V3
class Permissions::Lint < Permissions::Generic
def lint?
write?
end
end
end

View File

@ -1,14 +0,0 @@
require 'travis/yaml'
module Travis::API::V3
class Queries::Lint < Query
def lint
request.body.rewind
content = params[:content] || request.body.read
parsed = Travis::Yaml.parse(content)
warnings = parsed.nested_warnings.map { |k, m| { key: k, message: m } }
payload = { lint: { warnings: warnings } }.to_json
payload
end
end
end

View File

@ -1,7 +1,12 @@
module Travis::API::V3
class Services::Lint::Lint < Service
def run!
lint
request.body.rewind
content = params[:content] || request.body.read
parsed = Travis::Yaml.parse(content)
warnings = parsed.nested_warnings.map { |k, m| { key: k, message: m } }
payload = { lint: { warnings: warnings } }.to_json
payload
end
end
end