gendered 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gendered/guesser.rb +6 -4
- data/lib/gendered/version.rb +1 -1
- data/spec/lib/gendered/guesser_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 068779934b3427d6384b168d8245413af6049192
|
4
|
+
data.tar.gz: dbec58cf7001b7f72dcd51b769d8eb4cb1647cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83588c1c1bd0196cbf28cbe4c4ad6c8a3521e2be5b8a43f425b6b806f49bbb874d707fa8cc7d8c082ed6d1526c8770289fd93b8b09d49295bef714d5d2350dfe
|
7
|
+
data.tar.gz: 6003d7bed6f5d4d8f93188af3e62333d911fd4d1579f7629e3a21ec049929ce134f59598f8e4a3de1e48aa368c1150612176b12e25eb85d2b52106c202fe8bb0
|
data/lib/gendered/guesser.rb
CHANGED
@@ -21,9 +21,11 @@ module Gendered
|
|
21
21
|
end
|
22
22
|
|
23
23
|
name.tap do |n|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
if guess["gender"]
|
25
|
+
n.gender = guess["gender"].to_sym
|
26
|
+
n.probability = guess["probability"]
|
27
|
+
n.sample_size = guess["count"]
|
28
|
+
end
|
27
29
|
end
|
28
30
|
end
|
29
31
|
self.names
|
@@ -33,7 +35,7 @@ module Gendered
|
|
33
35
|
def url
|
34
36
|
url = "http://api.genderize.io/?"
|
35
37
|
name_queries = names.collect.with_index do |name, index|
|
36
|
-
"name[#{index}]=#{name}"
|
38
|
+
"name[#{index}]=#{CGI.escape(name.to_s)}"
|
37
39
|
end
|
38
40
|
url + name_queries.join("&")
|
39
41
|
end
|
data/lib/gendered/version.rb
CHANGED