HelpersHQ Build Status Code Climate

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

  1. bundle exec rspec spec

Single

  1. bundle exec rspec --backtrace spec/PATH_TO_FILE.rb Note: --backtrace for full error stack

Extra tips

  1. bundle exec irb to use your local ruby version
  2. 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

  1. Update the .rubocop-https---onehq-com-rubocop-yml file if any modifications are required.
  2. Make sure to update TargetRubyVersion in the file for any ruby version upgrade.
  3. 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)
  4. Solutin: replace send(:include, ::HasHelpers::Controller) with include ::HasHelpers::Controller