A simple CLI application that would search through any JSON dataset using the flexi-json gem.
Available commands:
search
: searches through the given dataset and return those data that is partially matching a given search queryfind_duplicate_emails
: finds out if there are any data with the same email in the dataset, and show those duplicates if any are found.
This application is using ruby 3.2.2 with the following tools:
- RSpec for testing
- standardrb for linting
- bundler-audit for checking Gemfile's vulnerability issues
- Byebug for debugging
- Make for build tasks
- Github Actions for CI
The easiest way to run this application is by using docker to make sure you have the correct development environment.
Docker installed on your machine (See Docker Installation Guides).
❯ docker-compose build
❯ docker-compose run app
- Using RVM or with
- the asdf version manager
❯ make run command=search query=john fields=full_name
ruby ./lib/cli.rb search --dataset_path= --query=john --fields=full_name
❯ make run command=search query=william fields=full_name,email
ruby ./lib/cli.rb search --dataset_path= --query=william --fields=full_name,email
❯ make run command=find_duplicate_emails
ruby ./lib/cli.rb find_duplicate_emails --dataset_path= --query= --fields=
❯ make help
ruby ./lib/cli.rb --help
❯ make test
bundle exec rspec
Use make lint
to check code for style issues.
❯ make lint
bundle exec standardrb lib spec
Use make audit
to check vulnerability issues of the gems in Gemfile.lock
❯ make audit
bundle exec bundle-audit check --update