No commit activity in last 3 years
No release in over 3 years
Simple library that allows organize distribution of files within hex based tree.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 10.0.0, ~> 10.0
 Project Readme

Simple RUBY file distribution library.

Build Status

Description:

Simple library that allows organize distribution of files within hex based tree.

Install file_distribution GEM:

gem install file_distribution

Example of usage:

require 'rubygems'
require 'file_distribution'

fd = FileDistribution.new("/tmp/storage")

# default extensions
database_id = 1
fd.hex_path(database_id)
fd.rename_from("/tmp/upload/file1.txt")
path = fd.get_path # saved file path

# set all extensions to .pdf
database_id = 256
fd.set_extension(".pdf")
fd.hex_path(database_id)
fd.rename_from("/tmp/upload/file2.txt")
path = fd.get_path # saved file path

Files should be stored in /tmp/storage/01.dat and /tmp/storage/01/00.pdf