No commit activity in last 3 years
No release in over 3 years
It is a SVG avatars generator gem based on themes which can be designed by users but also you can find some great pre-designed themes on it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 10.0
~> 3.4.0

Runtime

 Project Readme

RubySvgImageGenerator

Build Status Coverage Status Code Climate

ruby_svg_image_generator is a great gem, created for you but specially for your web application users.

It is a SVG avatars generator gem based on themes which can be designed by users but also you can find some great pre-designed themes on it.

Demo App

We have implemented a demo app for you to try out: Demo App

Installation

Add this line to your application's Gemfile:

gem 'ruby_svg_image_generator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby_svg_image_generator

Usage

Create a random svg image from selected theme

RubySvgImageGenerator.create_random(title, options={})

title: (String) Created SVG image name
options: (Hash)
  -  theme: (String) Theme where you get the random image

Example: RubySvgImageGenerator.create_random('awesome_random_avatar', {theme: RubySvgImageGenerator::T_MONKEY_AVATARS})

Create a random svg image from selected theme and save on the file system

RubySvgImageGenerator.create_random_and_save(filename, title, options={})

filename: (String): Created SVG image file name
title: (String) Created SVG image name
options: (Hash)
  -  theme: (String) Theme where you get the random image

Example: RubySvgImageGenerator.create_random_and_save('image.svg', 'awesome_random_avatar', {theme: RubySvgImageGenerator::T_LANDSCAPE_THEME})

Create an image from selected theme and specific values for parts

RubySvgImageGenerator.create(title, options={})

title: (String) Created SVG image name
options: (Hash)
  -  theme: (String) Theme where you get the image
  -  parts: (Array) Array of index of parts' values which compose the theme

Example: RubySvgImageGenerator.create('awesome_avatar', {theme: RubySvgImageGenerator::T_FACE_AVATARS, parts: [0, 1, 5, 0, 1]})

Create an image from selected theme with specific values for parts and save on the file system

RubySvgImageGenerator.create_and_save(filename, title, options={})

filename: (String): Created SVG image file name
title: (String) Created SVG image name
options: (Hash)
  -  theme: (String) Theme where you get the image
  -  parts: (Array) Array of index of parts' values which compose the theme

Example: RubySvgImageGenerator.create('face_avatar.svg', 'awesome_avatar', {theme: RubySvgImageGenerator::T_FACE_AVATARS, parts: [0, 1, 5, 0, 1]})

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/monkeyKoders/ruby_svg_image_generator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.