Skip to content

Commit

Permalink
Update to latest challenge standards
Browse files Browse the repository at this point in the history
  • Loading branch information
neoeno committed Aug 28, 2021
1 parent d55d9a7 commit 25dce20
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 35 deletions.
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
# https://github.com/makersacademy/scaffolint
#
# Configure Rubocop to use the config file in the Scaffolint GitHub repo

inherit_from:
- https://raw.githubusercontent.com/makersacademy/scaffolint/v1.1.0/.rubocop.yml
- https://raw.githubusercontent.com/makersacademy/scaffolint/v2.2.0/.rubocop.yml
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
source 'https://rubygems.org'

ruby '3.0.2'

group :test do
gem 'rspec'
gem 'rubocop', '0.79.0'
gem 'simplecov', require: false, group: :test
gem 'simplecov-console', require: false, group: :test
end

group :development, :test do
gem 'rubocop', '1.20'
end
74 changes: 42 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,65 @@ GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.4.0)
diff-lcs (1.3)
docile (1.3.2)
jaro_winkler (1.5.4)
parallel (1.19.1)
parser (2.7.0.3)
ast (~> 2.4.0)
ast (2.4.2)
diff-lcs (1.4.4)
docile (1.4.0)
parallel (1.20.1)
parser (3.0.2.0)
ast (~> 2.4.1)
rainbow (3.0.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.20.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
simplecov (0.18.0)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11.0)
simplecov-console (0.6.0)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-console (0.9.1)
ansi
simplecov
terminal-table
simplecov-html (0.11.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.6.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
terminal-table (3.0.1)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.0.0)

PLATFORMS
ruby

DEPENDENCIES
rspec
rubocop (= 0.79.0)
rubocop (= 1.20)
simplecov
simplecov-console

RUBY VERSION
ruby 3.0.2p107

BUNDLED WITH
2.1.4
2.2.26
46 changes: 46 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

# This script is used by Makers to ensure that the challenges stay up to date.
# If you're a student, you don't need to run it. But you can if you like!

set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR

script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

setup_colors() {
if [[ -t 2 ]] && [[ -z "${NO_COLOR-}" ]] && [[ "${TERM-}" != "dumb" ]]; then
NOFORMAT='\033[0m' RED='\033[0;31m' GREEN='\033[0;32m' ORANGE='\033[0;33m' BLUE='\033[0;34m' PURPLE='\033[0;35m' CYAN='\033[0;36m' YELLOW='\033[1;33m'
else
NOFORMAT='' RED='' GREEN='' ORANGE='' BLUE='' PURPLE='' CYAN='' YELLOW=''
fi
}

cleanup() {
trap - SIGINT SIGTERM ERR
die "${RED}Checks failed${NOFORMAT}"
}

msg() {
echo >&2 -e "${1-}"
}

die() {
local msg=$1
local code=${2-1} # default exit status 1
msg "$msg"
exit "$code"
}

setup_colors

msg "${BLUE}Integrity check using Ruby version ${ORANGE}$(ruby -v)${NOFORMAT}"
msg "${BLUE} • Installing bundler${NOFORMAT}"
gem install bundler
msg "${BLUE} • Running bundle install${NOFORMAT}"
bundle install
msg "${BLUE} • Running rspec${NOFORMAT}"
bundle exec rspec
msg "${BLUE} • Running rubocop${NOFORMAT}"
bundle exec rubocop
exit 0

0 comments on commit 25dce20

Please sign in to comment.