Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: firstdraft
  • License: mit
  • Language: Ruby
  • Default Branch: main
  • Size: 49.8 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 10 months ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License Citation

README.md

filetodata_uri

A Ruby gem that converts files or file-like objects to data URI strings (e.g. image files to strings suitable for use as the src of an <img>).

Installation

Gemfile way (preferred)

Add this line to your application's Gemfile:

ruby gem "file_to_data_uri", "< 1.0.0"

And then, at a command prompt:

bundle install

Direct way

Or, install it directly with:

gem install file_to_data_uri

Usage

```ruby

With a file path

@data_uri = DataURI.convert("path/to/image.jpg") # => "data:image/jpeg;base64,..."

With a file-like object, e.g. an uploaded file

@data_uri = DataURI.convert(params[:image]) # => "data:image/png;base64,..."

Then you can use it in an ERB template

MIT License.

Owner

  • Name: firstdraft
  • Login: firstdraft
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: Please use the following metadata when citing this project in your work.
title: FileToDataURI
abstract: A Ruby gem that converts files or file-like objects to data URI strings suitable for use in HTML elements.
version: 0.0.1
license: MIT
date-released: 2025-04-29
authors:
  - family-names: Betina
    given-names: Raghu
    affiliation: FIRSTDRAFT LLC
    orcid: https://orcid.org/
keywords:
 - ruby
 - data-uri
 - base64
 - html
repository-code: https://github.com/firstdraft/file_to_data_uri
repository-artifact: https://rubygems.org/gems/file_to_data_uri
url: https://github.com/firstdraft/file_to_data_uri

GitHub Events

Total
  • Watch event: 1
  • Push event: 5
  • Create event: 1
Last Year
  • Watch event: 1
  • Push event: 5
  • Create event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • rubygems 314 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
rubygems.org: file_to_data_uri

A Ruby gem that converts files or file-like objects to data URI strings suitable for use in HTML elements like img tags.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 314 Total
Rankings
Dependent packages count: 14.4%
Dependent repos count: 44.2%
Average: 50.4%
Downloads: 92.8%
Maintainers (1)
Funding
  • https://github.com/sponsors/firstdraft
Last synced: 7 months ago

Dependencies

Gemfile rubygems
  • amazing_print ~> 1.7 development
  • caliber ~> 0.79 development
  • debug ~> 1.10 development
  • git-lint ~> 9.0 development
  • irb-kit ~> 1.1 development
  • rake ~> 13.2 development
  • reek ~> 6.5 development
  • repl_type_completor ~> 0.1 development
  • rspec ~> 3.13 development
  • simplecov ~> 0.22 development
  • standard ~> 1.0 development
file_to_data_uri.gemspec rubygems
  • base64 ~> 0.1, >= 0.1.0
  • mime-types ~> 3.0