RabbitFileSplit
Simple File Byte Split
Installation
Add this line to your application's Gemfile:
gem 'rabbit_file_split'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rabbit_file_split
Usage
#1M(1048576)byte split
split_file_list = RabbitFileSplit::Bytes.new(file_path).split(1048576)
split_file_list = RabbitFileSplit::Bytes.new(file_path).split(1048576, file_prefix: 'object')
split_file_list = RabbitFileSplit::Bytes.new(file_path).split(1048576, file_prefix: 'object', dest_file_path: '/tmp')
split_file_list = RabbitFileSplit::Bytes.new(file_path).split(1048576, file_prefix: 'object', dest_file_path: '/tmp', buffer_size: 8096)
Support byte Format
Integer + unit(KB/MB/GB)
split_file_list = RabbitFileSplit::Bytes.new(file_path).split('1KB') 1024 Byte
split_file_list = RabbitFileSplit::Bytes.new(file_path).split('1MB') 1048576 Byte
split_file_list = RabbitFileSplit::Bytes.new(file_path).split('1GB') 1073741824 Byte
Contributing
- Fork it ( https://github.com/[my-github-username]/rabbit_file_split/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request