genderizr 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +35 -3
- data/Rakefile +6 -9
- data/lib/genderizr/version.rb +1 -1
- metadata +2 -4
- data/.gitignore +0 -17
- data/genderizr.gemspec.erb +0 -18
data/README.md
CHANGED
@@ -1,4 +1,36 @@
|
|
1
|
-
genderizr
|
2
|
-
=========
|
1
|
+
# genderizr
|
3
2
|
|
4
|
-
A ruby gem to genderize strings
|
3
|
+
A ruby gem to genderize strings. It owes a little to [JackDanger's feminizer](https://github.com/JackDanger/feminizer).
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
`feminize_string(string)` replaces masculine words in `string` with their feminine counterparts
|
8
|
+
|
9
|
+
`masculize_string(string)` replaces feminine words
|
10
|
+
|
11
|
+
`genderize_string(string, turn_feminine)` Feminizes `string` if `turn_feminine` evaluates to `true`, masculizes `string` otherwise.
|
12
|
+
|
13
|
+
### On its own
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
0 apollo /home/brundage % irb
|
17
|
+
1.9.3-p0 :001 > require 'genderizr'
|
18
|
+
=> true
|
19
|
+
|
20
|
+
1.9.3-p0 :002 > Genderizr.feminize_string("A man needs to keep his head up")
|
21
|
+
=> "A woman needs to keep her head up"
|
22
|
+
```
|
23
|
+
|
24
|
+
### In Rails
|
25
|
+
|
26
|
+
Genderizr monkey-patches the String class... cause that's the Rails Way.
|
27
|
+
|
28
|
+
It adds `String#feminize`, `String#genderize(turn_feminine)` and `String#masculize`
|
29
|
+
|
30
|
+
Now you can do cool stuff like
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
# app/views/users/show.html.erb
|
34
|
+
|
35
|
+
<%= @user.name %> <%= "updated his status".genderize(@user.female?) %>
|
36
|
+
```
|
data/Rakefile
CHANGED
@@ -3,23 +3,20 @@ require './lib/genderizr/version'
|
|
3
3
|
|
4
4
|
GEM = "genderizr-#{Genderizr::VERSION}.gem"
|
5
5
|
GEMSPEC = "genderizr.gemspec"
|
6
|
-
|
7
|
-
FILES = `git ls-files`.split(/\n/).delete_if { |f| [GEMSPEC].include?(f) }
|
6
|
+
FILES = `git ls-files`.split(/\n/)
|
8
7
|
|
9
8
|
|
10
9
|
task :build => :default
|
11
10
|
task :default => GEM
|
12
11
|
|
12
|
+
task :deploy => GEM do
|
13
|
+
system "gem push #{GEM}"
|
14
|
+
end
|
15
|
+
|
13
16
|
task :install => GEM do
|
14
17
|
system "gem install #{GEM}"
|
15
18
|
end
|
16
19
|
|
17
|
-
file GEM =>
|
20
|
+
file GEM => FILES do |task|
|
18
21
|
system "gem build -V #{GEMSPEC}"
|
19
22
|
end
|
20
|
-
|
21
|
-
file GEMSPEC => FILES do |task|
|
22
|
-
input = File.open(GEMSPEC_ERB, "r")
|
23
|
-
output = File.open(task.to_s, "w")
|
24
|
-
output.write( ERB.new( input.read ).result )
|
25
|
-
end
|
data/lib/genderizr/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module Genderizr; VERSION = "0.0.
|
1
|
+
module Genderizr; VERSION = "0.0.4"; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genderizr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A gem to genderize strings
|
15
15
|
email:
|
@@ -18,10 +18,8 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- .gitignore
|
22
21
|
- README.md
|
23
22
|
- Rakefile
|
24
|
-
- genderizr.gemspec.erb
|
25
23
|
- lib/genderizr.rb
|
26
24
|
- lib/genderizr/railtie.rb
|
27
25
|
- lib/genderizr/version.rb
|
data/.gitignore
DELETED
data/genderizr.gemspec.erb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
$:.push File.expand_path("../lib", __FILE__)
|
2
|
-
require "genderizr/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "genderizr"
|
6
|
-
s.version = Genderizr::VERSION
|
7
|
-
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = ["Dean Brundage"]
|
9
|
-
s.email = ["dean@newrepublicbrewing.com"]
|
10
|
-
s.homepage = "https://github.com/brundage/genderizr"
|
11
|
-
s.summary = "Genderize text"
|
12
|
-
s.description = "A gem to genderize strings"
|
13
|
-
|
14
|
-
s.files = [ <%= `git ls-files`.split(/\n/).collect {|f| "'#{f}'" }.join(", ") %> ]
|
15
|
-
s.test_files = [ <%= `git ls-files -- spec/*`.split("\n").collect {|f| "'#{f}'" }.join(", ") %> ]
|
16
|
-
s.executables = [ <%= `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }.collect {|f| "'#{f}'" }.join(", ") %> ]
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
end
|