Project

bfs-s3

0.01
Low commit activity in last 3 years
No release in over a year
https://github.com/bsm/bfs.rb
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.38
= 0.9.1
 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