summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-06-09 16:26:50 +0300
committerValery Sizov <vsv2711@gmail.com>2015-06-09 17:53:42 +0300
commit8fd43216598bc74b3dea2188ff7262081999de33 (patch)
tree38bb4b4464e4a9dea40af30af869151ef63e4029 /app/controllers
parentdedabbc0243cc7aa401c49f35b4e100ff2d95fa3 (diff)
downloadgitlab-ci-8fd43216598bc74b3dea2188ff7262081999de33.tar.gz
Lint implementation
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/lints_controller.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/lints_controller.rb b/app/controllers/lints_controller.rb
new file mode 100644
index 0000000..1a9cd92
--- /dev/null
+++ b/app/controllers/lints_controller.rb
@@ -0,0 +1,20 @@
+class LintsController < ApplicationController
+ def show
+ end
+
+ def create
+ if params[:content].blank?
+ @status = false
+ @error = "Please provide content of your file"
+ else
+ @config_processor = GitlabCiYamlProcessor.new params[:content]
+ @status = true
+ end
+ rescue Psych::SyntaxError => e
+ @error = e.message
+ @status = false
+ rescue Exception => e
+ @error = "Undefined error"
+ @status = false
+ end
+end \ No newline at end of file