Loading .gitlab-ci.yml +16 −2 Original line number Diff line number Diff line Loading @@ -4,15 +4,29 @@ stages: - linting - testing - deploy syntax_ruby: syntax_ruby_2-4: stage: syntax image: ruby:2.4 script: - ruby -v - find . -name '*\.rb' -exec bash -c 'echo -ne "{}\t\t\t" && ruby -c {}' \; syntax_erb: syntax_erb_2-4: stage: syntax image: ruby:2.4 script: - ruby -v - find . -name '*\.erb' -exec bash -c 'echo -ne "{}\t\t\t" && erb -P -x {} | ruby -c' \; syntax_ruby_2-3: stage: syntax image: ruby:2.3 script: - ruby -v - find . -name '*\.rb' -exec bash -c 'echo -ne "{}\t\t\t" && ruby -c {}' \; syntax_erb_2-3: stage: syntax image: ruby:2.3 script: - ruby -v - find . -name '*\.erb' -exec bash -c 'echo -ne "{}\t\t\t" && erb -P -x {} | ruby -c' \; lint_ruby: stage: linting Loading routes/code.rb +2 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ class SignupSite < Sinatra::Base def check_code(code) return true if code.nil? return false if code.match?(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/) return true if code.match(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/).nil? # TODO: Check code against database true false end end Loading
.gitlab-ci.yml +16 −2 Original line number Diff line number Diff line Loading @@ -4,15 +4,29 @@ stages: - linting - testing - deploy syntax_ruby: syntax_ruby_2-4: stage: syntax image: ruby:2.4 script: - ruby -v - find . -name '*\.rb' -exec bash -c 'echo -ne "{}\t\t\t" && ruby -c {}' \; syntax_erb: syntax_erb_2-4: stage: syntax image: ruby:2.4 script: - ruby -v - find . -name '*\.erb' -exec bash -c 'echo -ne "{}\t\t\t" && erb -P -x {} | ruby -c' \; syntax_ruby_2-3: stage: syntax image: ruby:2.3 script: - ruby -v - find . -name '*\.rb' -exec bash -c 'echo -ne "{}\t\t\t" && ruby -c {}' \; syntax_erb_2-3: stage: syntax image: ruby:2.3 script: - ruby -v - find . -name '*\.erb' -exec bash -c 'echo -ne "{}\t\t\t" && erb -P -x {} | ruby -c' \; lint_ruby: stage: linting Loading
routes/code.rb +2 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ class SignupSite < Sinatra::Base def check_code(code) return true if code.nil? return false if code.match?(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/) return true if code.match(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/).nil? # TODO: Check code against database true false end end