Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sixarm/sixarm_ruby_blob
SixArm » Ruby » Blob gem for simple access to a file, URI, upload, etc.
https://github.com/sixarm/sixarm_ruby_blob
binary blob gem ruby
Last synced: 24 days ago
JSON representation
SixArm » Ruby » Blob gem for simple access to a file, URI, upload, etc.
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_blob
- Owner: SixArm
- License: other
- Created: 2013-08-01T01:59:41.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:27:46.000Z (over 1 year ago)
- Last Synced: 2024-05-02T00:54:44.858Z (8 months ago)
- Topics: binary, blob, gem, ruby
- Language: Ruby
- Size: 334 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
Blob of data abstract base class[![Gem Version](https://badge.fury.io/rb/sixarm_ruby_blob.svg)](http://badge.fury.io/rb/sixarm_ruby_blob)
[![Build Status](https://travis-ci.org/SixArm/sixarm_ruby_blob.png)](https://travis-ci.org/SixArm/sixarm_ruby_blob)
[![Code Climate](https://api.codeclimate.com/v1/badges/26fa11574942bbe370ca/maintainability)](https://codeclimate.com/github/SixArm/sixarm_ruby_blob/maintainability)* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).## Introduction
This is an abstract base class to help us model a blob of data.
We use this class as our parent class for image files, music files, and video files.
A blob provides a few basic capabilities:
* Access a blob via a file path on the local filesystem.
* Access a blob via a URI.
* Upload a blob by using a typical web browser form.For docs go to
Want to help? We're happy to get pull requests.
## Install
### Gem
To install this gem in your shell or terminal:
gem install sixarm_ruby_blob
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_blob'
### Require
To require the gem in your code:
require 'sixarm_ruby_blob'
## Examples
Create a blob:
require "sixarm_ruby_blob"
blob = Blob.new(dir: "/my/photos", name: "photo.jpb")Locate the blob as a file and as a URI:
blob.file_path #=> "/my/photos/photo.jpg"
blob.uri_path #=> "http://example.com/my/photos/photo.jpg"