Project

genderizr

0.0
No commit activity in last 3 years
No release in over 3 years
Having gender issues in your ruby app? Genderizr to the rescue!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

genderizr image

genderizr

A ruby gem to genderize strings.

Build Status Dependency Status Code Climate Buggerall

Usage

Genderizr.feminize(string) replaces masculine words in string with their feminine counterparts

Genderizr.masculize(string) replaces feminine words

Genderizr.genderize(string, turnFeminine) Takes a masculine string and Feminizes it if turnFeminine evaluates to true, otherwise masculizes string.

On its own

0 apollo /home/brundage % irb
1.9.3-p0 :001 > require 'genderizr'
 => true 

1.9.3-p0 :002 > Genderizr.feminize("A man needs to keep his head up")
 => "A woman needs to keep her head up" 

In Rails

Genderizr monkey-patches the String class... cause that's the Rails Way.

It adds String#feminize, String#genderize(turnFeminine) and String#masculize

Now you can do cool stuff like

# app/views/users/show.html.erb

<%= "#{@user.name} updated his status".genderize(@user.female?) %>

Produces

Dean updated his status.

or

Adrienne updated her status.

This gem pilfered the translation hash from JackDanger's feminizer.