Project

bfs-ftp

0.0
The project is in a healthy, maintained state
https://github.com/bsm/bfs.rb
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Runtime

= 0.9.1
>= 0.1.3
 Project Readme

BFS

Build Status License

Abstraction for bucket storage.

Supported backends

Installation

Add this to your Gemfile, e.g. for S3 support:

gem 'bfs-s3'

Then execute:

$ bundle

Usage

require 'bfs/s3'

# connect to a bucket
bucket = BFS.resolve('s3://my-bucket?region=eu-west-2')

# create a file
bucket.create 'path/to/file.txt' do |f|
  f.write 'Hello World!'
end

# read that file
bucket.open 'path/to/file.txt' do |f|
  puts f.gets
end

# delete that file
bucket.rm 'path/to/file.txt'

# close the bucket again
bucket.close

Or, as a block:

require 'bfs/fs'

BFS.resolve('file:///absolute/path') do |bucket|
  bucket.ls('**').each do |file|
    puts file
  end
end