Skip to content

takatoh/filestorage

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

Filestorage

A simple file storage.

Installation

Add this line to your application's Gemfile:

gem 'filestorage'

And then execute:

$ bundle

Or install it yourself as:

$ gem install filestorage

Usage

Create a instance.

require 'filestorage'
storage = Filesotrage::Local.new(base_dir)

Store a file to path.

storage.store("foo/bar/baz.txt", file)

And get the file. `get' method returns instance of File class.

file = storage.get("foo/bar/baz.txt")
content = file.read

Contributing

  1. Fork it ( https://github.com/takatoh/filestorage/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A simple file storage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages