From 3f5e51c7da3818f896acf574dc5795de7930da78 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Fri, 6 Feb 2015 19:30:00 +0200 Subject: [PATCH] update README --- README.md | 17 ++++++++++++++--- carrierwave-data-uri.gemspec | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9c8ee30..7cb084b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Carrierwave::Data::Uri +# CarrierWave::DataUri -TODO: Write a gem description +Carrierwave plugin that allows create image from data uri ## Installation @@ -20,8 +20,19 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here +```ruby +class User < ActiveRecord::Base + mount_uploader :avatar, AvatarUploader +end +``` + +Then we can create image from data +``` +user = User.find 123 +user.image_data_uri = 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP////8AAP///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==' +user.save +``` ## Contributing 1. Fork it ( https://github.com/[my-github-username]/carrierwave-data-uri/fork ) diff --git a/carrierwave-data-uri.gemspec b/carrierwave-data-uri.gemspec index 6caa6b4..f4bcf3b 100644 --- a/carrierwave-data-uri.gemspec +++ b/carrierwave-data-uri.gemspec @@ -8,8 +8,8 @@ Gem::Specification.new do |spec| spec.version = Carrierwave::Data::Uri::VERSION spec.authors = ['Tima Maslyuchenko'] spec.email = ['insside@gmail.com'] - spec.summary = %q{Carrierwave plugin that allow create image based from data uri} - spec.description = %q{Carrierwave plugin that allow create image based from data uri} + spec.summary = %q{Carrierwave plugin that allows create image from data uri} + spec.description = %q{Carrierwave plugin that allows create image from data uri} spec.homepage = 'https://github.com/timsly/carrierwave-data-uri' spec.license = 'MIT'