Solving Advent of Code 2021 using Ruby with Sorbet type checking and RSpec unit testing.
After Setup, to run a particular day run:
ruby day01/main.rb < day01/input.txt
Ruby version used:
asdf install ruby 2.7.6
Update bundler:
gem install bundler:2.3.13
Install dependencies:
bundle install
Run tests with:
bundle exec rspec
Check coding style with:
bundle exec rubocop
Run type checker:
bundle exec srb tc
If the Solargraph LSP gives warnings about 'required path could not be resolved' it's because Solargraph needs YARD docs to resolve dependencies. Following the vscode-solargraph instructions you need to run:
bundle exec yard gems