0.0
The project is in a healthy, maintained state
DataParser is a simple code for parsing a json file with search capabilty for partial or full name and showing of duplicate email if there is.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

DataParser

DataParser is a simple gem for parsing a json file with search capabilty for partial or full name and displaying of duplicate email if there are.

NOTE: Later on it can extend to process other file type like csv, pdf, text file.

Prerequisites

Installation

Install from source:

gem "data_parser", :git => "git://github.com/rolandoalvarado/data_parser.git"

Install as RubyGem:

gem install data_parser

Install in your Rails application:

gem 'data_parser', '~> 0.1.0'

Usage

Searching for Partial or Full Name:

path = '<json file path>'
full_name = 'Mich'
result = DataParser.parse(path:).process(params: { full_name: }).names
[
  {
    "id": 4,
    "full_name": "Michael Williams",
    "email": "michael.williams@outlook.com"
  },
  {
    "id": 10,
    "full_name": "Michael Brown",
    "email": "michael.brown@inbox.com"
  }
]

Showing for duplicate email:

path = '<json file path>'
result = DataParser.parse(path:).process.emails
[
  "jane.smith@example.com"
]

Using in a Ruby File:

  1. Add this to your code:
require_relative 'lib/data_parser.rb'
  1. Make ruby file executable
chmod +x bin/data_parser_runner.rb
  1. Execute the file:
./bin/data_parser_runner.rb

Running the test:

rake test

License

See LICENSE for details.