This lib contains all the business logic necessary to run the auctions. A principle and standard must be strictly followed: The The principle of single responsibility and clean architecture concepts.
Add this line to your application's Gemfile:
gem 'auction_fun_core'
And then execute:
bundle install
Or install it yourself as:
gem install auction_fun_core
Initially, download the project remotely and copy the templates from the project's environment variables:
git clone [email protected]:ricardopacheco/auction-fun-core.git core
cd core
cp .env.development.template .env.development
cp .env.test.template .env.test
As the idea of this project is to be a lib, it was decided to use a specific environment variable called
APP_ENV
, so as not to conflict with others if the lib is used by a framework.
Configure the .env.development
file with the values according to your machine or network.
Run the commands below to create the database and its structure, remembering to replace
the postgres
by the user of your postgresql service. By default, if APP_ENV
is not provided
is considered the value development
by default.
sudo apt install build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev
asdf plugin add postgres
asdf install postgres 16.1
rm -rf $HOME/.asdf/installs/postgres/16.1/data
initdb -D $HOME/.asdf/installs/postgres/16.1/data -U postgres
sudo apt install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev
asdf plugin add ruby
asdf install ruby 3.3.0
gem install pg -v 1.5.5 --verbose -- --with-pg-config=$HOME/.asdf/installs/postgres/16.1/bin/pg_config # Fix pg_config
bin/setup
asdf install golang latest
go install github.com/DarthSim/overmind/v2
asdf reshim
- postgres in rake commands is a name of user for postgres. Change if needed
In current tab:
overmind s -l database
Open a new tab and create development database:
bundle exec rake 'auction_fun_core:db:create_database[postgres]'
bundle exec rake 'auction_fun_core:db:migrate'
Now come back to overmind tab, kill the current database process using Ctrl+c. After that:
overmind start
This will start all required services needed to run core application.
In new tab, you could run seed data for development with
bundle exec rake 'auction_fun_core:db:seed'
To experiment with that code, run bin/console
for an interactive prompt.
Configure the .env.test
file with the values according to your machine or network.
Run the test suite with the coverage report using the command:
APP_ENV=test bundle exec rake auction_fun_core:db:create_database[postgres]
APP_ENV=test bundle exec rake auction_fun_core:db:migrate
CI=true APP_ENV=test bundle exec rspec .
This project uses yadr
as a documentation tool. To generate documentation and view it, run
bundle exec yard server --reload
Documentation will be available at http://localhost:8808
.
If you already use overmind, the documentation server starts automatically.
The gem is available as open source under the terms of the MIT License.