From affbe2a46034b9cf05323bcce1805b2b5142e6e3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 2 Mar 2017 21:13:06 +1300 Subject: [PATCH] renamed ruby files to .rb so rubocop cop catches these in her net --- .travis.yml | 2 +- ..._contributors_md => check_contributors_md.rb} | 16 ++++++++-------- script/{check_static => check_static.rb} | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) rename script/{check_contributors_md => check_contributors_md.rb} (82%) rename script/{check_static => check_static.rb} (80%) diff --git a/.travis.yml b/.travis.yml index 0eb6192dc..610a12047 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ script: - set -e - > if [ "${STATIC_CHECKS}" = "true" ]; then - ./script/check_static + ./script/check_static.rb else bundle exec rake db:migrate --trace; bundle exec rspec --tag $RSPEC_TAG spec/; diff --git a/script/check_contributors_md b/script/check_contributors_md.rb similarity index 82% rename from script/check_contributors_md rename to script/check_contributors_md.rb index 2bf2e6a4e..444cf372d 100755 --- a/script/check_contributors_md +++ b/script/check_contributors_md.rb @@ -1,8 +1,8 @@ #!/usr/bin/env ruby puts "Checking to see if you're in CONTRIBUTORS.md..." -if ENV['TRAVIS'] then - if ENV['TRAVIS_PULL_REQUEST'] then +if ENV['TRAVIS'] + if ENV['TRAVIS_PULL_REQUEST'] require 'httparty' repo = ENV['TRAVIS_REPO_SLUG'] pr = ENV['TRAVIS_PULL_REQUEST'] @@ -18,20 +18,20 @@ if ENV['TRAVIS'] then end else author = `git config github.user`.chomp - if $?.exitstatus > 0 then - abort %{ + if $?.exitstatus.positive? + abort %( Couldn't determine your GitHub username, and not in a Travis PR build Please set it using git config --add github.user [username] -} +) end end -unless system('grep', '-i', author, 'CONTRIBUTORS.md') then - abort %{ +unless system('grep', '-i', author, 'CONTRIBUTORS.md') + abort %( Thanks for your contribution, #{author}! Please add your name and GitHub handle to the file CONTRIBUTORS.md, commit it, and update your PR. - } + ) end diff --git a/script/check_static b/script/check_static.rb similarity index 80% rename from script/check_static rename to script/check_static.rb index 34f37d631..137c97f7f 100755 --- a/script/check_static +++ b/script/check_static.rb @@ -2,7 +2,7 @@ checks = [ 'overcommit -r', - 'bundle exec script/check_contributors_md' + 'bundle exec script/check_contributors_md.rb' ] return_values = checks.collect { |t| system(t) }