Project

crf

0.0
No commit activity in last 3 years
No release in over 3 years
Library that looks for exact duplicated files in a directory.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 2.0, >= 1.3.0
>= 9.0.5, ~> 9.0
>= 0.47.1, ~> 0.47

Runtime

>= 0.8.1, ~> 0.8
>= 1.0.5, ~> 1.0
>= 1.8.1, ~> 1.8
 Project Readme

CRF - Check Repeated Files

Gem Version Dependency Status Build Status Code Climate Test Coverage Inline docs

This gem finds exact duplicate files inside given directories and all of each sub directories. The result of the execution gets stored in a file called crf_log.txt. The execution time depends on the amount of files and each size, so be careful (or patient). You have options to run an approximated version of the algorithm which is faster but more inaccurate.

Installation

Add this line to your application's Gemfile:

gem 'crf'

And then execute:

$ bundle

Or install it yourself as:

$ gem install crf

Usage

After installing the gem, you can use it in your command line:

crf PATH_1 PATH_2 .. [-f] [-n] [-o]

Or you can use it in any ruby code you want:

require 'crf'

path = './test'
options = { interactive: true, progress: true, fast: false }

crf_checker = Crf::Checker.new([paths], options)
crf_checker.check_repeated_files

The -f, --fast option only checks if the files have the same size (is faster but it does not mean that the files are duplicates).

The -n, --no-interactive option will save the first file of the repetitions and remove the rest of the duplicates without asking.

The -o, --no-progress option will make CRF run without showing the progress bar.

The default version compares the size and SHA256 checksums of the files (which is more than enough in most cases). When using the crf command directly on the command line the interactive and progress bar options are enabled by default. But, when using the class directly on ruby code, these options are disabled by default.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Run rubocop lint (rubocop -R --format simple)
  5. Run rspec tests (bundle exec rspec)
  6. Push your branch (git push origin my-new-feature)
  7. Create a new Pull Request