diff --git a/ablecop.gemspec b/ablecop.gemspec index 7a29aa2..6fbea79 100644 --- a/ablecop.gemspec +++ b/ablecop.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 + $LOAD_PATH.push File.expand_path("../lib", __FILE__) require "ablecop/version" @@ -15,25 +16,24 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.post_install_message = <<-MSG -Ablecop Setup - Local -=========================================================================== -You can generate the necessary configuration files to run any code -analysis locally by running the following command: - - bundle exec rails g ablecop:install - -Ablecop Setup - CircleCI -=========================================================================== -To enable CircleCI to run ablecop's checks and comment on commits with each -push, add the following configuration to your circle.yml configuration: - -test: - pre: - - bundle exec rails g ablecop:install - post: - - RAILS_ENV=development bundle exec rake ablecop:run_on_circleci - -MSG + Ablecop Setup - Local + =========================================================================== + You can generate the necessary configuration files to run any code + analysis locally by running the following command: + + bundle exec rails g ablecop:install + + Ablecop Setup - CircleCI + =========================================================================== + To enable CircleCI to run ablecop's checks and comment on commits with each + push, add the following configuration to your circle.yml configuration: + + test: + pre: + - bundle exec rails g ablecop:install + post: + - RAILS_ENV=development bundle exec rake ablecop:run_on_circleci + MSG spec.required_ruby_version = ">= 2.2.0" diff --git a/lib/ablecop/tasks/ablecop.rake b/lib/ablecop/tasks/ablecop.rake index b074eaf..61d6f82 100644 --- a/lib/ablecop/tasks/ablecop.rake +++ b/lib/ablecop/tasks/ablecop.rake @@ -5,7 +5,7 @@ desc "Runs ablecop automatted code review on CircleCI" namespace :ablecop do desc "Run code analysis for the current commit / pull request on CircleCI" task :run_on_circleci do - abort("The GitHub access token is missing. Please set the PRONTO_GITHUB_ACCESS_TOKEN environment variable as specified in the README: https://github.com/ableco/ablecop#circleci--github-setup") unless ENV["PRONTO_GITHUB_ACCESS_TOKEN"].present? + abort("The GitHub access token is missing. Please set the PRONTO_GITHUB_ACCESS_TOKEN environment variable as specified in the README: https://github.com/ableco/ablecop#circleci--github-setup") if ENV["PRONTO_GITHUB_ACCESS_TOKEN"].blank? require_pronto_runners @@ -13,7 +13,7 @@ namespace :ablecop do # branch for the pull request. if ENV["CI_PULL_REQUEST"].present? ENV["PULL_REQUEST_ID"] = ENV["CI_PULL_REQUEST"].match("[0-9]+$").to_s - abort("Pull Request ID is missing") unless ENV["PULL_REQUEST_ID"].present? + abort("Pull Request ID is missing") if ENV["PULL_REQUEST_ID"].blank? pull_request_formatter = Pronto::Formatter::GithubPullRequestFormatter.new status_formatter = Pronto::Formatter::GithubStatusFormatter.new