HelpersHQ

An engine that faciliates paperclicip, has_attachment other other HQ gems:
Setup
git clone the repo
Run bundle or bundle install
Please note: install the ruby version located in the .ruby-version file
rbenv local ruby_version e.g 3.0.0
Testing
Create your database.yml in spec/internal/config directory
Cards Role Proxy
See docs/cards_role_proxy.md for configuring cross-app card role resolution with HasHelpers::Cards::Roles.
Test database setup
# EXAMPLE
test:
adapter: postgresql
host: localhost
database: has_helpers_test
username: postgres
password:
timeout: 5000
encoding: utf8
pool: 5
Running Test
whole suite
- bundle exec rspec spec
Single
- bundle exec rspec --backtrace spec/PATH_TO_FILE.rb Note: --backtrace for full error stack
Extra tips
- bundle exec irb to use your local ruby version
- bundle exec ruby PATH_TO_FILE.rb to run a single ruby file with the ruby version for the app
Linting
You must make sure the code is properly linted. Achieve that by running the line below
bundle exec rubocop
- Update the .rubocop-https---onehq-com-rubocop-yml file if any modifications are required.
- Make sure to update
TargetRubyVersionin the file for any ruby version upgrade. - Example below is a linting issue:
lib/has_helpers/engine.rb:21:33: W: Lint/SendWithMixinArgument: Use include ::HasHelpers::Controller instead of send(:include, ::HasHelpers::Controller). ::ApplicationController.send(:include, ::HasHelpers::Controller) - Solutin: replace
send(:include, ::HasHelpers::Controller)withinclude ::HasHelpers::Controller