Skip to content

daneb/mergeit

Repository files navigation

Mergeit

Build Status

Custom-format merge utility

Current Format Support of Input Files

  • [ IP ] : [ CSV format numbers ]
  • 127.0.0.1: 1,202,3,4
  • 192.168.101.1: 32,23,100

There is flexibility in the format, please review lib/config.rb

    # Delimiter for how a line is divided up into parts
    FILE_FORMAT = { delimeter: ':'}
    # Determines after splitting on delimeter how many parts there should be
    SUPPORTED_PARTS = { size: 2 }
    # Regex that verfies a CSV (supports floating-point and integers) 
    # @note Does not support e notation
    CSV_FORMAT = { regex: '(^((\d+,)|(\d+[,.]\d+))+(\d+|(\d+[,.]\d+))$)' }
    # Delimiter for splitting the second part (aka. the numbers)
    NUMBERS = { delimeter: ','}

Get Started

RVM and Ruby 2.3.0 are required dependencies

  1. Clone Repo
  2. gem install bundler
  3. bundle install

How To Run Tests

Run both cucumber and rspec tests (default configured)
# rake
Further info view Rakefile in project root

Code Coverage

HTML report can be found coverage/index.html
# rake mergeit:coverage

Run Command Line Executable

Help
# bin/mergeit
Example
# bin/mergeit -f1 file1.txt -f2 file2.txt

Documentation

Generate documentation
# yard doc
Host documentation locally
# yard server

Extra-reading (initial planning and scratch)

[ Google Doc ] (https://docs.google.com/spreadsheets/d/1CXo1Y-cEUk6f4TTWWvIPyYmfL5y0Tz_zy2ahPy-eqc4/edit?usp=sharing)

About

Custom format merge utility

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published