{"id":17598940,"url":"https://github.com/jinhucheung/rpictogrify","last_synced_at":"2025-04-30T06:08:31.767Z","repository":{"id":50565662,"uuid":"325310362","full_name":"jinhucheung/rpictogrify","owner":"jinhucheung","description":"Ruby version of the pictogrify to generate unique pictograms","archived":false,"fork":false,"pushed_at":"2022-07-24T16:04:42.000Z","size":92,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T06:08:24.953Z","etag":null,"topics":["avataaars","avatar","avatar-generator","pictogram","pictogrify","rails","ruby"],"latest_commit_sha":null,"homepage":"https://github.com/jinhucheung/rpictogrify","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinhucheung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-29T14:39:53.000Z","updated_at":"2023-04-24T05:57:52.000Z","dependencies_parsed_at":"2022-08-20T16:10:18.107Z","dependency_job_id":null,"html_url":"https://github.com/jinhucheung/rpictogrify","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhucheung%2Frpictogrify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhucheung%2Frpictogrify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhucheung%2Frpictogrify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhucheung%2Frpictogrify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinhucheung","download_url":"https://codeload.github.com/jinhucheung/rpictogrify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651233,"owners_count":21621716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avataaars","avatar","avatar-generator","pictogram","pictogrify","rails","ruby"],"created_at":"2024-10-22T10:08:21.895Z","updated_at":"2025-04-30T06:08:31.726Z","avatar_url":"https://github.com/jinhucheung.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/rpictogrify.svg)](https://badge.fury.io/rb/rpictogrify)\n[![Build Status](https://travis-ci.org/jinhucheung/rpictogrify.svg?branch=master)](https://travis-ci.org/jinhucheung/rpictogrify)\n\n\u003cp align=\"center\"\u003e\n  \u003ch2 align=\"center\"\u003eRpictogrify\u003c/h2\u003e\n  \u003cp align=\"center\"\u003eRuby version of the \u003ca href=\"https://github.com/luciorubeens/pictogrify\"\u003epictogrify\u003c/a\u003e to generate unique pictograms\u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/V7WcroX.png\" width=\"600px\" alt=\"Avatar\"\u003e\u003c/p\u003e\n\n## Installation\n\nAdd `rpictogrify` to application's Gemfile:\n\n```\ngem 'rpictogrify'\n```\n\nAnd then execute:\n\n```\n$ bundle install\n```\n\nOr install it yourself as:\n\n```\n$ gem install rpictogrify\n```\n\n## Configuration\n\n```ruby\nRpictogrify.configure do\n  # default theme, one of these themes: avataars_female, avataars_male, male_flat, monsters. default is :monsters\n  self.theme      = :monsters\n  # pictogram directory. default is 'public/system'\n  self.base_path  = 'public/system'\n  # register a custome theme with assets. assets see assets/themes\n  self.register_theme :custom, assets_path: 'vendor/assets/rpictogrify/themes/custom'\nend\n```\n\n## Usage\n\n```ruby\nRpictogrify.generate 'jim.cheung'                          #=\u003e 'public/system/rpictogrify/1/monsters/1313467160.svg'\nRpictogrify.generate 'jim.cheung', theme: :avataars_male   #=\u003e 'public/system/rpictogrify/1/avataars_male/1313467160.svg'\nRpictogrify.generate 'jim.cheung', theme: :custom          #=\u003e 'public/system/rpictogrify/1/custom/1313467160.svg', use custom theme\n```\n\n### Controller / View\n\nThere is a helper for this, you need to include `Rpictogrify::Helper` in your controller or helper. e.g. `ApplicationHelper`\n\n```ruby\ninclude Rpictogrify::Helper\n```\n\nThen you can use the following methods in views.\n\n```ruby\nrpictogrify_for('jim', theme: :monsters)          #=\u003e 'public/system/rpictogrify/1/monsters/1313467160.svg'\nrpictogrify_url('jim')                            #=\u003e '/system/rpictogrify/1/monsters/1313467160.svg'\nrpictogrify_tag('jim', html: {class: :avatar})    #=\u003e '\u003cimg class=\"avatar\" src=\"/system/rpictogrify/1/monsters/1313467160.svg\" alt=\"jim\" /\u003e'\nrpictogrify_url_for('public/system/rpictogrify/1/monsters/1313467160.svg') #=\u003e '/system/rpictogrify/1/monsters/1313467160.svg'\n```\n\n### Model\n\nYou can include `Rpictogrify::Extension` in your model class. e.g. `User` model\n\n```ruby\nclass User\n  include Rpictogrify::Extension\n\n  rpictogrify_on :username, theme: -\u003e { gender == :male ? :avataars_male : :avataars_female }\n  # rpictogrify_on :username, theme: :avataars_male\nend\n```\n\nThen you have the following methods in user\n\n```ruby\n@user.rpictogrify_path      #=\u003e 'public/system/rpictogrify/1/monsters/1313467160.svg'\n@user.rpictogrify_url       #=\u003e '/system/rpictogrify/1/monsters/1313467160.svg'\n```\n\n## Contributing\n\nBug report or pull request are welcome.\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n\nPlease write unit test with your code if necessary.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](MIT-LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinhucheung%2Frpictogrify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinhucheung%2Frpictogrify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinhucheung%2Frpictogrify/lists"}