Sha256: 90e8d35cf22f39349fe6ef52b2e738e8d2acdad7377c6199d280a8ca16b37286

Contents?: true

Size: 743 Bytes

Versions: 1

Compression:

Stored size: 743 Bytes

Contents

if Rails.env.development? || Rails.env.test?
  def run_command(command, env = {})
    description = "Running '#{command}'"
    separator = '-' * description.length

    puts '', separator, description, separator, ''

    system(env, command) or fail "There was an error while running '#{command}'"
  end

  desc 'Checks app health: runs tests, security checks and rubocop'
  task :health do
    rails_helper = Rails.root / 'spec/rails_helper.rb'

    run_command "bundle exec rspec -r#{rails_helper}", 'COVERAGE' => 'true'
    run_command 'npm run test'
    run_command 'bundle exec bundle-audit update'
    run_command 'bundle exec bundle-audit check'
    run_command 'bundle exec brakeman -z'
    run_command 'bundle exec rubocop'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
code42template-2.0.0 templates/health.rake