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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad61d98db56ec7459e024d660cf8f6385dcc8eac
4
- data.tar.gz: 704830b14e5410155eb6168122c24420aacf995b
3
+ metadata.gz: 068779934b3427d6384b168d8245413af6049192
4
+ data.tar.gz: dbec58cf7001b7f72dcd51b769d8eb4cb1647cfc
5
5
  SHA512:
6
- metadata.gz: eea6d8460989213d9aec104adce7674bb94701a532eeeda8088eed244b43ff78833b33ebf6be9defd183446611f8bfcb91807934e9bddd3f2316fcddf4ecabbd
7
- data.tar.gz: e4b4bcd4ca717904cac005b55f26c9f8293c0c513bea54eac665803e9cd2406d014280f93bcd5dd747f85093c2152b6ec964ff1e54b4af6e629aff77b495b915
6
+ metadata.gz: 83588c1c1bd0196cbf28cbe4c4ad6c8a3521e2be5b8a43f425b6b806f49bbb874d707fa8cc7d8c082ed6d1526c8770289fd93b8b09d49295bef714d5d2350dfe
7
+ data.tar.gz: 6003d7bed6f5d4d8f93188af3e62333d911fd4d1579f7629e3a21ec049929ce134f59598f8e4a3de1e48aa368c1150612176b12e25eb85d2b52106c202fe8bb0
@@ -21,9 +21,11 @@ module Gendered
21
21
  end
22
22
 
23
23
  name.tap do |n|
24
- n.gender = guess["gender"].to_sym
25
- n.probability = guess["probability"]
26
- n.sample_size = guess["count"]
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
@@ -1,3 +1,3 @@
1
1
  module Gendered
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -30,5 +30,14 @@ module Gendered
30
30
  end
31
31
  end
32
32
 
33
+ context "with the name Evat" do
34
+ let :names do
35
+ ["Evat"]
36
+ end
37
+ it "does not error" do
38
+ expect{subject.guess!}.to_not raise_error
39
+ end
40
+ end
41
+
33
42
  end
34
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gendered
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Devine