Skip to content

A CLI application that would search through a list of clients

License

Notifications You must be signed in to change notification settings

GD-Personal/json_search_cli_app

Repository files navigation

Github Actions Maintainability Test Coverage

JSON Dataset Search CLI

Description

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 query
  • find_duplicate_emails: finds out if there are any data with the same email in the dataset, and show those duplicates if any are found.

Setup

This application is using ruby 3.2.2 with the following tools:

🐳 Docker

The easiest way to run this application is by using docker to make sure you have the correct development environment.

Pre-requisites

Docker installed on your machine (See Docker Installation Guides).

❯ docker-compose build
❯ docker-compose run app

Or you could still run it without docker

Intall Ruby with one of the following:

Run the CLI

❯ 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

Testing

❯ make test
bundle exec rspec

Coding standard

Use make lint to check code for style issues.

❯ make lint
bundle exec standardrb lib spec

Security audit

Use make audit to check vulnerability issues of the gems in Gemfile.lock

❯ make audit
bundle exec bundle-audit check --update

About

A CLI application that would search through a list of clients

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published