genderize_io_rb 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +30 -21
- data/README.md +39 -3
- data/VERSION +1 -1
- data/genderize_io_rb.gemspec +7 -4
- data/include/database_schema.rb +9 -9
- data/include/errors.rb +3 -1
- data/include/result.rb +8 -0
- data/lib/genderize_io_rb.rb +161 -42
- data/shippable.yml +7 -0
- data/spec/genderize_io_rb_spec.rb +108 -42
- data/spec/shitload_of_names.json +100 -0
- data/spec/spec_helper.rb +4 -1
- metadata +27 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5176d92ef1a771a1a04d95a30ad0b888b960980b
|
4
|
+
data.tar.gz: 106c8b15bc17aab5a8637c83d90cb4b92fe34e4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdcf553e0c5f9d5f80e9ac3b3e7424ee4cceecfa44a8aa53dbf7368d3c0f352e2af315539e8e72c4e81106748081fb81ed8d266006b4e7cb024e9c070e235048
|
7
|
+
data.tar.gz: e7c86385281e560e64280b456b6783a9cbd816d75ee5b709433eb371dde49fc9a540669fa3362beff7affc3fa47c41f92831c3fae4248378d83804a3b7468e59
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/technicalpickles/jeweler.git
|
3
|
-
revision:
|
3
|
+
revision: 922fcd5debfe50352868c7a5d49a95d74ba9988e
|
4
4
|
specs:
|
5
5
|
jeweler (2.0.1)
|
6
6
|
builder
|
@@ -17,50 +17,53 @@ GEM
|
|
17
17
|
specs:
|
18
18
|
addressable (2.3.6)
|
19
19
|
array_enumerator (0.0.3)
|
20
|
-
baza (0.0.
|
20
|
+
baza (0.0.14)
|
21
21
|
array_enumerator
|
22
22
|
datet
|
23
23
|
knjrbfw
|
24
24
|
string-cases
|
25
25
|
wref
|
26
26
|
builder (3.2.2)
|
27
|
+
codeclimate-test-reporter (0.4.1)
|
28
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
27
29
|
datet (0.0.25)
|
28
30
|
descendants_tracker (0.0.4)
|
29
31
|
thread_safe (~> 0.3, >= 0.3.1)
|
30
32
|
diff-lcs (1.1.3)
|
33
|
+
docile (1.1.5)
|
31
34
|
faraday (0.9.0)
|
32
35
|
multipart-post (>= 1.2, < 3)
|
33
|
-
git (1.2.
|
34
|
-
github_api (0.
|
36
|
+
git (1.2.8)
|
37
|
+
github_api (0.12.2)
|
35
38
|
addressable (~> 2.3)
|
36
|
-
descendants_tracker (~> 0.0.
|
39
|
+
descendants_tracker (~> 0.0.4)
|
37
40
|
faraday (~> 0.8, < 0.10)
|
38
|
-
hashie (>=
|
41
|
+
hashie (>= 3.3)
|
39
42
|
multi_json (>= 1.7.5, < 2.0)
|
40
|
-
nokogiri (~> 1.6.
|
43
|
+
nokogiri (~> 1.6.3)
|
41
44
|
oauth2
|
42
|
-
hashie (
|
45
|
+
hashie (3.3.1)
|
43
46
|
highline (1.6.21)
|
44
|
-
http2 (0.0.
|
47
|
+
http2 (0.0.26)
|
48
|
+
string-cases
|
45
49
|
json (1.8.1)
|
46
|
-
jwt (0.
|
47
|
-
|
48
|
-
knjrbfw (0.0.109)
|
50
|
+
jwt (1.0.0)
|
51
|
+
knjrbfw (0.0.110)
|
49
52
|
datet
|
50
53
|
http2
|
51
54
|
php4r
|
52
55
|
ruby_process
|
53
56
|
tsafe
|
54
57
|
wref
|
55
|
-
mini_portile (0.
|
56
|
-
multi_json (1.
|
58
|
+
mini_portile (0.6.0)
|
59
|
+
multi_json (1.10.1)
|
57
60
|
multi_xml (0.5.5)
|
58
61
|
multipart-post (2.0.0)
|
59
|
-
nokogiri (1.6.1)
|
60
|
-
mini_portile (
|
61
|
-
oauth2 (0.
|
62
|
+
nokogiri (1.6.3.1)
|
63
|
+
mini_portile (= 0.6.0)
|
64
|
+
oauth2 (1.0.0)
|
62
65
|
faraday (>= 0.8, < 0.10)
|
63
|
-
jwt (~>
|
66
|
+
jwt (~> 1.0)
|
64
67
|
multi_json (~> 1.3)
|
65
68
|
multi_xml (~> 0.5)
|
66
69
|
rack (~> 1.2)
|
@@ -69,7 +72,7 @@ GEM
|
|
69
72
|
http2
|
70
73
|
string-strtr
|
71
74
|
rack (1.5.2)
|
72
|
-
rake (10.3.
|
75
|
+
rake (10.3.2)
|
73
76
|
rdoc (3.12.2)
|
74
77
|
json (~> 1.4)
|
75
78
|
rspec (2.8.0)
|
@@ -83,10 +86,15 @@ GEM
|
|
83
86
|
ruby_process (0.0.9)
|
84
87
|
tsafe
|
85
88
|
wref
|
86
|
-
|
89
|
+
simplecov (0.9.1)
|
90
|
+
docile (~> 1.1.0)
|
91
|
+
multi_json (~> 1.0)
|
92
|
+
simplecov-html (~> 0.8.0)
|
93
|
+
simplecov-html (0.8.0)
|
94
|
+
sqlite3 (1.3.10)
|
87
95
|
string-cases (0.0.0)
|
88
96
|
string-strtr (0.0.3)
|
89
|
-
thread_safe (0.3.
|
97
|
+
thread_safe (0.3.4)
|
90
98
|
tsafe (0.0.11)
|
91
99
|
wref (0.0.6)
|
92
100
|
|
@@ -96,6 +104,7 @@ PLATFORMS
|
|
96
104
|
DEPENDENCIES
|
97
105
|
baza (>= 0.0.12)
|
98
106
|
bundler (>= 1.0.0)
|
107
|
+
codeclimate-test-reporter
|
99
108
|
http2
|
100
109
|
jeweler!
|
101
110
|
json
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[![Code Climate](https://codeclimate.com/github/kaspernj/genderize_io_rb/badges/gpa.svg)](https://codeclimate.com/github/kaspernj/genderize_io_rb)
|
2
|
+
[![Test Coverage](https://codeclimate.com/github/kaspernj/genderize_io_rb/badges/coverage.svg)](https://codeclimate.com/github/kaspernj/genderize_io_rb)
|
3
|
+
[![Build Status](https://api.shippable.com/projects/540e7b9a3479c5ea8f9ec210/badge?branchName=master)](https://app.shippable.com/projects/540e7b9a3479c5ea8f9ec210/builds/latest)
|
4
|
+
|
1
5
|
# GenderizeIoRb
|
2
6
|
|
3
7
|
Start by adding it to your Gemfile and bundle it:
|
@@ -9,12 +13,44 @@ Now check a name like this:
|
|
9
13
|
```ruby
|
10
14
|
gir = GenderizeIoRb.new
|
11
15
|
res = gir.info_for_name("kasper")
|
12
|
-
puts "Name: #{res
|
13
|
-
puts "Gender: #{res
|
16
|
+
puts "Name: #{res.name}"
|
17
|
+
puts "Gender: #{res.gender}"
|
18
|
+
```
|
19
|
+
|
20
|
+
It is also possible to look multiple names up:
|
21
|
+
```ruby
|
22
|
+
GenderizeIoRb.new do |gir|
|
23
|
+
gir.info_for_names(["kasper", "christina"]).each do |result|
|
24
|
+
puts "Name: #{result.name}"
|
25
|
+
puts "Gender: #{result.gender}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
You can attach a database-cache through a Baza::Db if Genderize is a bit slow:
|
31
|
+
```ruby
|
32
|
+
# SQLite3 database will automatically be created with table and everything. If an existing db is given, the table will automatically be created within it.
|
33
|
+
Baza::Db.new(type: "sqlite3", path: path) do |db|
|
34
|
+
GenderizeIoRb.new(cache_db: db) do |gir|
|
35
|
+
# First request will be done through a HTTP request:
|
36
|
+
first_result = gir.info_for_name("kasper")
|
37
|
+
puts "Through HTTP?: #{first_result.from_http_request?}"
|
38
|
+
|
39
|
+
# Second result will be done by a
|
40
|
+
second_result = gir.info_for_name("kasper")
|
41
|
+
puts "Through DB cache? #{second_result.from_cache_db?}"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
If you need the connections to be kept open:
|
47
|
+
```ruby
|
48
|
+
db = Baza::Db.new(type: "sqlite3", path: path)
|
49
|
+
gir = GenderizeIoRb.new(cache_db: db)
|
14
50
|
```
|
15
51
|
|
16
52
|
# Contributing to genderize_io_rb
|
17
|
-
|
53
|
+
|
18
54
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
19
55
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
20
56
|
* Fork the project.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/genderize_io_rb.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: genderize_io_rb 0.0.10 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "genderize_io_rb"
|
8
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.10"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Kasper Johansen"]
|
12
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-11-03"
|
13
15
|
s.description = "A small Gem that makes it possible to determine gender from a name via the Genderize.io service."
|
14
16
|
s.email = "kaspernj@gmail.com"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -30,13 +32,14 @@ Gem::Specification.new do |s|
|
|
30
32
|
"include/errors.rb",
|
31
33
|
"include/result.rb",
|
32
34
|
"lib/genderize_io_rb.rb",
|
35
|
+
"shippable.yml",
|
33
36
|
"spec/genderize_io_rb_spec.rb",
|
37
|
+
"spec/shitload_of_names.json",
|
34
38
|
"spec/spec_helper.rb"
|
35
39
|
]
|
36
40
|
s.homepage = "http://github.com/kaspernj/genderize_io_rb"
|
37
41
|
s.licenses = ["MIT"]
|
38
|
-
s.
|
39
|
-
s.rubygems_version = "2.0.7"
|
42
|
+
s.rubygems_version = "2.4.0"
|
40
43
|
s.summary = "A small Gem that makes it possible to determine gender from a name via the Genderize.io service."
|
41
44
|
|
42
45
|
if s.respond_to? :specification_version then
|
data/include/database_schema.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
class GenderizeIoRb::DatabaseSchema
|
2
2
|
SCHEMA = {
|
3
|
-
:
|
4
|
-
:
|
5
|
-
:
|
6
|
-
{:
|
7
|
-
{:
|
8
|
-
{:
|
9
|
-
{:
|
3
|
+
tables: {
|
4
|
+
genderize_io_rb_cache: {
|
5
|
+
columns: [
|
6
|
+
{name: :id, type: :int, autoincr: true, primarykey: true},
|
7
|
+
{name: :name, type: :varchar},
|
8
|
+
{name: :result, type: :text},
|
9
|
+
{name: :created_at, type: :datetime}
|
10
10
|
],
|
11
|
-
:
|
12
|
-
{:
|
11
|
+
indexes: [
|
12
|
+
{name: :name, columns: [:name], unique: true}
|
13
13
|
]
|
14
14
|
}
|
15
15
|
}
|
data/include/errors.rb
CHANGED
data/include/result.rb
CHANGED
data/lib/genderize_io_rb.rb
CHANGED
@@ -5,87 +5,206 @@ require "string-cases" unless ::Kernel.const_defined?(:StringCases)
|
|
5
5
|
|
6
6
|
class GenderizeIoRb
|
7
7
|
attr_reader :cache_db
|
8
|
-
|
8
|
+
|
9
9
|
def self.const_missing(name)
|
10
10
|
require_relative "../include/#{::StringCases.camel_to_snake(name)}"
|
11
11
|
raise LoadError, "Still not defined: '#{name}'." unless ::GenderizeIoRb.const_defined?(name)
|
12
12
|
return ::GenderizeIoRb.const_get(name)
|
13
13
|
end
|
14
|
-
|
15
|
-
INITIALIZE_VALID_ARGS = [:cache_as, :cache_db]
|
14
|
+
|
15
|
+
INITIALIZE_VALID_ARGS = [:cache_as, :cache_db, :debug]
|
16
16
|
def initialize(args = {})
|
17
17
|
args.each do |key, val|
|
18
18
|
raise "Invalid key: '#{key}'." unless INITIALIZE_VALID_ARGS.include?(key)
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
|
+
@debug = args[:debug]
|
21
22
|
@args = args
|
22
|
-
@http = Http2.new(:
|
23
|
-
|
23
|
+
@http = Http2.new(host: "api.genderize.io")
|
24
|
+
|
24
25
|
# Make sure the database-version is up-to-date.
|
25
26
|
@cache_db = args[:cache_db]
|
26
27
|
if @cache_db
|
27
|
-
Baza::Revision.new.init_db(:
|
28
|
+
Baza::Revision.new.init_db(db: @cache_db, schema: GenderizeIoRb::DatabaseSchema::SCHEMA)
|
28
29
|
end
|
29
|
-
|
30
|
+
|
30
31
|
@cache_as = args[:cache_as]
|
32
|
+
|
33
|
+
if block_given?
|
34
|
+
begin
|
35
|
+
yield self
|
36
|
+
ensure
|
37
|
+
destroy
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def info_for_names(names, &blk)
|
43
|
+
names_lc = names.map{ |name| name.to_s.strip.downcase }
|
44
|
+
results = []
|
45
|
+
|
46
|
+
extract_cache_db_results_from_names(names) if @cache_db
|
47
|
+
if @cache_db
|
48
|
+
debug "Looking names up in db: #{names_lc}" if @debug
|
49
|
+
@cache_db.select(:genderize_io_rb_cache, name: names_lc) do |data|
|
50
|
+
debug "Found in db-cache: #{data}" if @debug
|
51
|
+
|
52
|
+
result = ::GenderizeIoRb::Result.new(
|
53
|
+
data: JSON.parse(data[:result]),
|
54
|
+
genderize_io_rb: self,
|
55
|
+
from_cache_db: true
|
56
|
+
)
|
57
|
+
|
58
|
+
raise "Could not delete name: #{data[:name]}" unless names_lc.delete(data[:name]) == data[:name]
|
59
|
+
|
60
|
+
handle_result(result, results, blk)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
unless names_lc.empty?
|
65
|
+
debug "Looking names up using an HTTP request: #{names_lc}" if @debug
|
66
|
+
urls = generate_urls_from_names(names_lc)
|
67
|
+
|
68
|
+
# Request all the URL's.
|
69
|
+
urls.each do |url|
|
70
|
+
http_result = @http.get(url)
|
71
|
+
json_results = JSON.parse(http_result.body)
|
72
|
+
|
73
|
+
json_results.each do |json_result|
|
74
|
+
if json_result["gender"] == nil
|
75
|
+
error = GenderizeIoRb::Errors::NameNotFound.new("Name was not found on Genderize.io: '#{json_result["name"]}'.")
|
76
|
+
error.name = json_result["name"]
|
77
|
+
|
78
|
+
handle_result(error, results, blk)
|
79
|
+
else
|
80
|
+
store_cache_for_name(json_result["name"], json_result)
|
81
|
+
|
82
|
+
result = ::GenderizeIoRb::Result.new(
|
83
|
+
data: json_result,
|
84
|
+
genderize_io_rb: self,
|
85
|
+
from_http_request: true
|
86
|
+
)
|
87
|
+
|
88
|
+
handle_result(result, results, blk)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
if blk
|
95
|
+
return nil
|
96
|
+
else
|
97
|
+
return results
|
98
|
+
end
|
31
99
|
end
|
32
|
-
|
33
|
-
def info_for_name(name
|
34
|
-
|
35
|
-
|
36
|
-
|
100
|
+
|
101
|
+
def info_for_name(name)
|
102
|
+
name_lc = name.to_s.strip.downcase
|
103
|
+
|
37
104
|
# If a database-cache is enabled, try to look result up there first.
|
38
105
|
if @cache_db
|
39
|
-
cache_db_res = @cache_db.single(:genderize_io_rb_cache,
|
106
|
+
cache_db_res = @cache_db.single(:genderize_io_rb_cache, name: name_lc)
|
40
107
|
if cache_db_res
|
41
108
|
res = ::GenderizeIoRb::Result.new(
|
42
|
-
:
|
43
|
-
:
|
109
|
+
data: JSON.parse(cache_db_res[:result]),
|
110
|
+
genderize_io_rb: self,
|
111
|
+
from_cache_db: true
|
44
112
|
)
|
45
113
|
end
|
46
114
|
end
|
47
|
-
|
48
|
-
cache_as_key = "genderize_io_rb_#{name_lc}"
|
115
|
+
|
49
116
|
if @cache_as
|
50
|
-
cache_as_res = @cache_as.read(
|
51
|
-
|
117
|
+
cache_as_res = @cache_as.read(cache_key_for_name(name_lc))
|
118
|
+
|
52
119
|
if cache_as_res
|
53
120
|
res = ::GenderizeIoRb::Result.new(
|
54
|
-
:
|
55
|
-
:
|
121
|
+
data: JSON.parse(cache_as_res),
|
122
|
+
genderize_io_rb: self,
|
123
|
+
from_cache_as: true
|
56
124
|
)
|
57
125
|
end
|
58
126
|
end
|
59
|
-
|
127
|
+
|
60
128
|
unless res
|
61
|
-
http_res = @http.get("?name=#{CGI.escape(
|
129
|
+
http_res = @http.get("?name=#{CGI.escape(name_lc)}")
|
62
130
|
json_res = JSON.parse(http_res.body)
|
63
|
-
|
64
|
-
raise GenderizeIoRb::Errors::NameNotFound, "Name was not found on Genderize.io: '#{
|
65
|
-
|
131
|
+
|
132
|
+
raise GenderizeIoRb::Errors::NameNotFound, "Name was not found on Genderize.io: '#{name_lc}'." unless json_res["gender"]
|
133
|
+
|
66
134
|
res = ::GenderizeIoRb::Result.new(
|
67
|
-
:
|
68
|
-
:
|
135
|
+
data: json_res,
|
136
|
+
genderize_io_rb: self,
|
137
|
+
from_http_request: true
|
69
138
|
)
|
139
|
+
store_cache_for_name(name_lc, json_res)
|
140
|
+
end
|
141
|
+
|
142
|
+
return res
|
143
|
+
end
|
144
|
+
|
145
|
+
def destroy
|
146
|
+
@http.destroy
|
147
|
+
@destroyed = true
|
148
|
+
end
|
149
|
+
|
150
|
+
def destroyed?
|
151
|
+
return @destroyed
|
152
|
+
end
|
153
|
+
|
154
|
+
private
|
155
|
+
|
156
|
+
def handle_result(result, results, blk)
|
157
|
+
if blk
|
158
|
+
blk.call(result)
|
159
|
+
else
|
160
|
+
results << result
|
70
161
|
end
|
71
|
-
|
162
|
+
end
|
163
|
+
|
164
|
+
def generate_urls_from_names(names_lc)
|
165
|
+
urls = []
|
166
|
+
url = "?"
|
167
|
+
|
168
|
+
names_lc.each_with_index do |name, index|
|
169
|
+
part = "name[#{index}]=#{CGI.escape(name)}"
|
170
|
+
|
171
|
+
new_length = part.length + url.length
|
172
|
+
if new_length >= 7000
|
173
|
+
urls << url
|
174
|
+
url = "?"
|
175
|
+
end
|
176
|
+
|
177
|
+
part.prepend("&") unless url == "?"
|
178
|
+
url << part
|
179
|
+
end
|
180
|
+
|
181
|
+
urls << url
|
182
|
+
|
183
|
+
return urls
|
184
|
+
end
|
185
|
+
|
186
|
+
def cache_key_for_name(name_lc)
|
187
|
+
"genderize_io_rb_#{name_lc}"
|
188
|
+
end
|
189
|
+
|
190
|
+
def store_cache_for_name(name_lc, json_result)
|
191
|
+
debug "Caching name: #{json_result}" if @debug
|
192
|
+
|
72
193
|
# Save result to the database cache.
|
73
|
-
if @cache_db
|
74
|
-
|
75
|
-
|
76
|
-
:
|
77
|
-
:
|
194
|
+
if @cache_db
|
195
|
+
debug "Upserting into cache '#{name_lc}': #{json_result}" if @debug
|
196
|
+
@cache_db.upsert(:genderize_io_rb_cache, {name: name_lc}, {
|
197
|
+
result: JSON.generate(json_result),
|
198
|
+
created_at: Time.now
|
78
199
|
})
|
79
200
|
end
|
80
|
-
|
201
|
+
|
81
202
|
if @cache_as && !cache_as_res
|
82
|
-
@cache_as.write(
|
203
|
+
@cache_as.write(cache_key_for_name(name_lc), http_res.body)
|
83
204
|
end
|
84
|
-
|
85
|
-
return {:result => res, :cache_db => @cache_db_res, :cache_as => cache_as_res}
|
86
205
|
end
|
87
|
-
|
88
|
-
def
|
89
|
-
@
|
206
|
+
|
207
|
+
def debug(str)
|
208
|
+
$stderr.puts str if @debug
|
90
209
|
end
|
91
210
|
end
|
data/shippable.yml
ADDED
@@ -2,55 +2,121 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
3
3
|
describe "GenderizeIoRb" do
|
4
4
|
it "can detect various names" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
GenderizeIoRb.new do |gir|
|
6
|
+
res = gir.info_for_name("kasper")
|
7
|
+
res.name.should eq "kasper"
|
8
|
+
res.gender.should eq "male"
|
9
|
+
res.from_http_request?.should eq true
|
10
|
+
|
11
|
+
res = gir.info_for_name("christina")
|
12
|
+
res.name.should eq "christina"
|
13
|
+
res.gender.should eq "female"
|
14
|
+
res.from_http_request?.should eq true
|
15
|
+
end
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
|
+
it "should accept a block to destroy automatically" do
|
19
|
+
gir = GenderizeIoRb.new{ |gir| }
|
20
|
+
gir.destroyed?.should eq true
|
21
|
+
end
|
22
|
+
|
18
23
|
it "can use a db cache" do
|
19
24
|
require "baza"
|
20
25
|
require "tmpdir"
|
21
26
|
require "sqlite3"
|
22
|
-
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
27
|
+
|
28
|
+
Baza::Db.new(type: "sqlite3", path: "#{Dir.tmpdir}/genderize_io_rb_spec_#{Time.now.to_f.to_s}.sqlite3", debug: false) do |db|
|
29
|
+
GenderizeIoRb.new(cache_db: db) do |gir|
|
30
|
+
res = gir.info_for_name("kasper")
|
31
|
+
res.name.should eq "kasper"
|
32
|
+
res.from_http_request?.should eq true
|
33
|
+
|
34
|
+
res = gir.cache_db.select(:genderize_io_rb_cache, "name" => "kasper")
|
35
|
+
|
36
|
+
count = 0
|
37
|
+
res.each do |data|
|
38
|
+
data[:name].should eq "kasper"
|
39
|
+
count += 1
|
40
|
+
end
|
41
|
+
|
42
|
+
count.should > 0
|
43
|
+
|
44
|
+
expect {
|
45
|
+
gir.cache_db.insert(:genderize_io_rb_cache, name: "kasper")
|
46
|
+
}.to raise_error
|
47
|
+
|
48
|
+
res = gir.info_for_name("kasper")
|
49
|
+
res.name.should eq "kasper"
|
50
|
+
res.from_cache_db?.should eq true
|
51
|
+
end
|
40
52
|
end
|
41
|
-
|
42
|
-
count.should > 0
|
43
|
-
|
44
|
-
expect {
|
45
|
-
gir.cache_db.insert(:genderize_io_rb_cache, :name => "kasper")
|
46
|
-
}.to raise_error
|
47
53
|
end
|
48
|
-
|
54
|
+
|
49
55
|
it "should raise errors when a name is not found" do
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
GenderizeIoRb.new do |gir|
|
57
|
+
expect {
|
58
|
+
gir.info_for_name("ksldfjslkjfweuir")
|
59
|
+
}.to raise_error(GenderizeIoRb::Errors::NameNotFound)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
it "can do a multi-name request to speed it up with partly cache from a database" do
|
64
|
+
require "baza"
|
65
|
+
require "tmpdir"
|
66
|
+
require "sqlite3"
|
67
|
+
|
68
|
+
path = "#{Dir.tmpdir}/genderize_io_rb_spec_#{Time.now.to_f.to_s}.sqlite3"
|
69
|
+
File.unlink(path) if File.exists?(path)
|
70
|
+
|
71
|
+
Baza::Db.new(type: "sqlite3", path: path, debug: false) do |db|
|
72
|
+
GenderizeIoRb.new(cache_db: db, debug: false) do |gir|
|
73
|
+
results = gir.info_for_names(["kasper", "christina", "asdjkvujksuhdv"])
|
74
|
+
|
75
|
+
results[0].name.should eq "kasper"
|
76
|
+
results[0].gender.should eq "male"
|
77
|
+
results[0].from_http_request?.should eq true
|
78
|
+
|
79
|
+
results[1].name.should eq "christina"
|
80
|
+
results[1].gender.should eq "female"
|
81
|
+
results[1].from_http_request?.should eq true
|
82
|
+
|
83
|
+
results[2].is_a?(::GenderizeIoRb::Errors::NameNotFound).should eq true
|
84
|
+
results[2].name.should eq "asdjkvujksuhdv"
|
85
|
+
|
86
|
+
|
87
|
+
results = gir.info_for_names(["kasper", "charlotte", "bsdjkvujksuhdv"])
|
88
|
+
|
89
|
+
results[0].name.should eq "kasper"
|
90
|
+
results[0].gender.should eq "male"
|
91
|
+
results[0].from_cache_db?.should eq true
|
92
|
+
|
93
|
+
results[1].name.should eq "charlotte"
|
94
|
+
results[1].gender.should eq "female"
|
95
|
+
results[1].from_http_request?.should eq true
|
96
|
+
|
97
|
+
results[2].is_a?(::GenderizeIoRb::Errors::NameNotFound).should eq true
|
98
|
+
results[2].name.should eq "bsdjkvujksuhdv"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should automatically chomp up a lot of names to avoid errors" do
|
104
|
+
names = JSON.parse(File.read("#{File.dirname(__FILE__)}/shitload_of_names.json"))
|
105
|
+
names = names.map{ |name| name.slice(1, name.length) }
|
106
|
+
|
107
|
+
GenderizeIoRb.new do |gir|
|
108
|
+
# Check returning of array.
|
109
|
+
results = gir.info_for_names(names)
|
110
|
+
results.length.should eq names.length
|
111
|
+
|
112
|
+
|
113
|
+
# Check yielding works so it is possible to save memory.
|
114
|
+
count = 0
|
115
|
+
gir.info_for_names(names) do |result|
|
116
|
+
count += 1
|
117
|
+
end
|
118
|
+
|
119
|
+
count.should eq names.length
|
120
|
+
end
|
55
121
|
end
|
56
122
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
[
|
2
|
+
"fAaliyah","mAaron","fAarushi","fAbbey","fAbbi","fAbbie","fAbby","mAbdul","mAbdullah","mAbel"
|
3
|
+
,"fAbi","fAbia","fAbigail","mAbraham","mAbram","mAbriel","fAby","fAcacia","mAce","fAda"
|
4
|
+
,"fAdalia","fAdalyn","mAdam","mAdan","fAddie","fAddison","mAde","fAdelaide","fAdele","fAdelia"
|
5
|
+
,"fAdelina","fAdeline","mAden","mAdnan","fAdreanna","mAdrian","fAdriana","fAdrianna","fAdrianne","fAdrienne"
|
6
|
+
,"fAerona","fAgatha","fAggie","fAgnes","mAhmad","mAhmed","fAida","mAidan","mAiden","fAileen"
|
7
|
+
,"fAimee","fAine","mAinsley","fAinsley","fAisha","fAisling","mAl","mAlain","fAlaina","mAlan"
|
8
|
+
,"fAlana","fAlanis","fAlanna","fAlannah","mAlastair","fAlayah","fAlayna","fAlba","mAlbert","mAlberto"
|
9
|
+
,"mAlbie","mAlden","mAldo","fAleah","mAlec","fAlecia","fAleisha","fAlejandra","mAlejandro","mAlen"
|
10
|
+
,"fAlena","mAlesandro","fAlessandra","fAlessia","mAlex","fAlex","fAlexa","mAlexander","fAlexandra","fAlexandria"
|
11
|
+
,"fAlexia","fAlexis","mAlexis","fAlexus","mAlfie","mAlfonso","mAlfred","mAlfredo","mAli","fAli"
|
12
|
+
,"fAlia","fAlice","fAlicia","fAlina","fAlisa","fAlisha","fAlison","fAlissa","mAlistair","fAlivia"
|
13
|
+
,"fAliyah","fAlize","fAlka","mAllan","mAllen","fAllie","fAllison","fAlly","fAllyson","fAlma"
|
14
|
+
,"fAlondra","mAlonzo","mAloysius","mAlphonso","mAlton","mAlvin","fAlycia","fAlyshialynn","fAlyson","fAlyssa"
|
15
|
+
,"fAlyssia","fAmalia","fAmanda","fAmani","fAmara","fAmari","mAmari","fAmaris","fAmaya","fAmber"
|
16
|
+
,"fAmelia","fAmelie","fAmerica","fAmethyst","fAmie","fAmina","mAmir","fAmirah","mAmit","mAmos"
|
17
|
+
,"fAmy","fAmya","fAna","fAnabel","fAnabelle","fAnahi","fAnais","fAnamaria","fAnastasia","fAndie"
|
18
|
+
,"mAndre","fAndrea","mAndreas","mAndres","mAndrew","fAndromeda","mAndy","fAngel","mAngel","fAngela"
|
19
|
+
,"fAngelia","fAngelica","fAngelina","fAngeline","fAngelique","mAngelo","fAngie","mAngus","fAnika","fAnisa"
|
20
|
+
,"fAnita","fAniya","fAniyah","fAnjali","fAnn","fAnna","fAnnabel","fAnnabella","fAnnabelle","fAnnabeth"
|
21
|
+
,"fAnnalisa","fAnnalise","fAnne","fAnneke","fAnnemarie","fAnnette","fAnnie","fAnnika","fAnnmarie","fAnselma"
|
22
|
+
,"fAnthea","mAnthony","fAntoinette","mAnton","fAntonia","mAntonio","mAntony","fAnuja","fAnusha","fAnya"
|
23
|
+
,"fAoibhe","fAoibheann","fAoife","fAphrodite","fApple","fApril","fAqua","fArabella","mAran","mArcher"
|
24
|
+
,"mArchie","mAri","fAria","fAriadne","fAriana","fArianna","fArianne","fAriel","fAriella","fArielle"
|
25
|
+
,"fArisha","mArjun","fArleen","fArlene","mArlo","mArman","mArmando","mArnold","mArrie","mArt"
|
26
|
+
,"fArtemis","mArthur","mArturo","mArwin","fArya","mAsa","mAsad","mAsh","fAsha","fAshanti"
|
27
|
+
,"mAsher","fAshlee","fAshleigh","mAshley","fAshley","fAshlie","fAshlyn","fAshlynn","mAshton","fAshton"
|
28
|
+
,"fAshvini","fAsia","mAsif","fAsma","mAspen","fAspen","mAston","fAstrid","fAthena","mAtticus"
|
29
|
+
,"fAubree","fAubrey","mAubrey","fAudra","fAudrey","fAudrina","mAudwin","mAugust","fAugustina","mAugustus"
|
30
|
+
,"fAurelia","fAurora","mAusten","mAustin","fAutumn","fAva","fAvalon","fAvery","mAvery","fAvril"
|
31
|
+
,"mAxel","fAya","mAyaan","fAyana","fAyanna","mAyden","fAyesha","fAyisha","fAyla","fAzalea"
|
32
|
+
,"fAzaria","fAzariah","fBailey","mBailey","fBarbara","fBarbie","mBarclay","mBarnaby","mBarney","mBarrett"
|
33
|
+
,"mBarry","mBart","mBartholomew","mBasil","mBay","fBaylee","mBaylor","fBea","fBeatrice","fBeatrix"
|
34
|
+
,"mBeau","fBecca","fBeccy","mBeck","mBeckett","fBecky","fBelinda","fBella","mBellamy","fBellatrix"
|
35
|
+
,"fBelle","mBen","mBenedict","fBenita","mBenjamin","mBenji","mBenjy","mBennett","mBennie","mBenny"
|
36
|
+
,"mBenson","fBenthe","mBentley","mBently","fBernadette","mBernard","mBernardo","fBernice","mBernie","mBert"
|
37
|
+
,"fBertha","mBertie","mBertram","fBeryl","fBess","fBeth","fBethan","fBethanie","fBethany","fBetsy"
|
38
|
+
,"fBettina","fBetty","mBevan","fBeverly","fBeyonce","fBhu","fBianca","mBill","fBillie","mBilly"
|
39
|
+
,"mBladen","mBlain","mBlaine","fBlair","mBlair","fBlaire","mBlaise","fBlake","mBlake","fBlanche"
|
40
|
+
,"mBlaze","fBliss","fBloom","fBlossom","mBlue","fBlythe","mBob","fBobbi","fBobbie","mBobby"
|
41
|
+
,"mBodie","fBonita","fBonnie","mBoris","mBoston","mBoyd","mBrad","mBraden","mBradford","mBradley"
|
42
|
+
,"mBradwin","mBrady","mBraeden","fBraelyn","mBram","mBranden","fBrandi","mBrandon","fBrandy","mBrantley"
|
43
|
+
,"mBraxton","mBrayan","mBrayden","mBraydon","fBraylee","mBraylon","fBrea","fBreanna","fBree","fBreeze"
|
44
|
+
,"fBrenda","mBrendan","mBrenden","mBrendon","fBrenna","mBrennan","mBrent","mBret","mBrett","mBrevyn"
|
45
|
+
,"fBria","mBrian","fBriana","fBrianna","fBrianne","fBriar","mBrice","fBridget","fBridgette","fBridie"
|
46
|
+
,"fBriella","fBrielle","fBriley","mBrinley","fBrinley","fBriony","fBrisa","fBritney","fBritt","fBrittany"
|
47
|
+
,"fBrittney","mBrock","mBrodie","mBrody","fBrogan","mBrogan","mBronson","fBronte","fBronwen","fBronwyn"
|
48
|
+
,"fBrooke","fBrooklyn","fBrooklynn","mBrooks","mBruce","mBruno","mBryan","fBryanna","mBryant","mBryce"
|
49
|
+
,"mBrydon","fBrylee","fBryn","fBrynlee","fBrynn","mBryon","fBryony","mBryson","mBuck","mBuddy"
|
50
|
+
,"fBunty","mBurt","mBurton","mBuster","mButch","mByron","mCadby","mCade","mCaden","fCadence"
|
51
|
+
,"mCael","mCaelan","mCaesar","mCai","mCaiden","fCailin","mCain","fCaitlan","fCaitlin","fCaitlyn"
|
52
|
+
,"mCaius","mCal","mCaleb","fCaleigh","mCalhoun","fCali","mCallan","fCallie","fCalliope","fCallista"
|
53
|
+
,"mCallum","mCalum","mCalvin","fCalypso","mCam","mCamden","fCameron","mCameron","fCami","fCamila"
|
54
|
+
,"fCamilla","fCamille","mCampbell","mCamron","fCamryn","fCandace","fCandice","fCandy","fCaoimhe","fCaprice"
|
55
|
+
,"fCara","mCarey","fCarina","fCaris","fCarissa","mCarl","fCarla","fCarley","fCarlie","mCarlos"
|
56
|
+
,"mCarlton","fCarly","fCarlynn","fCarmel","fCarmela","fCarmen","fCarol","fCarole","fCarolina","fCaroline"
|
57
|
+
,"fCarolyn","fCarrie","mCarsen","mCarson","mCarter","fCarter","mCary","fCarys","mCasey","fCasey"
|
58
|
+
,"mCash","mCasper","fCassandra","fCassia","fCassidy","fCassie","mCassius","mCastiel","fCat","fCate"
|
59
|
+
,"fCaterina","mCathal","fCathalina","fCatherine","fCathleen","fCathy","fCatlin","mCato","fCatrina","fCatriona"
|
60
|
+
,"mCavan","mCayden","fCayla","fCece","fCecelia","mCecil","fCecilia","fCecily","mCedric","fCeleste"
|
61
|
+
,"fCelestia","fCelestine","fCelia","fCelina","fCeline","fCerys","mCesar","mChad","mChance","mChandler"
|
62
|
+
,"fChanel","fChanelle","mChanning","fChantal","fChantelle","fCharis","fCharissa","fCharity","fCharlene","mCharles"
|
63
|
+
,"fCharley","mCharlie","fCharlie","fCharlize","fCharlotte","fCharmaine","mChase","fChastity","mChaz","mChe"
|
64
|
+
,"fChelsea","fChelsey","fChenille","fCher","fCheri","fCherie","fCherry","fCheryl","mChesney","mChester"
|
65
|
+
,"mChevy","fCheyanne","fCheyenne","fChiara","mChip","fChloe","mChris","fChris","fChrissy","fChrista"
|
66
|
+
,"fChristabel","fChristal","fChristen","fChristi","mChristian","fChristiana","fChristie","fChristina","fChristine","mChristopher"
|
67
|
+
,"fChristy","fChrystal","mChuck","mCian","fCiara","mCiaran","fCici","fCiel","fCierra","mCillian"
|
68
|
+
,"fCindy","fClaire","mClancy","fClara","fClarabelle","fClare","mClarence","fClarice","fClarissa","fClarisse"
|
69
|
+
,"mClark","fClary","mClaude","fClaudette","fClaudia","fClaudine","mClay","mClayton","fClea","mClement"
|
70
|
+
,"fClementine","fCleo","mCliff","mClifford","mClifton","mClint","mClinton","mClive","fClodagh","fClover"
|
71
|
+
,"mClyde","mCoby","fCoco","mCody","mCohen","mColby","mCole","fColette","mColin","fColleen"
|
72
|
+
,"mCollin","mColm","mColt","mColton","mConan","mConner","fConnie","mConnor","mConor","mConrad"
|
73
|
+
,"fConstance","mConstantine","mCooper","fCora","fCoral","fCoralie","fCoraline","mCorbin","fCordelia","mCorey"
|
74
|
+
,"fCori","fCorina","fCorinne","mCormac","mCornelius","fCorra","mCory","fCosette","fCourtney","mCraig"
|
75
|
+
,"mCristian","fCristina","mCristobal","mCruz","fCrystal","mCullen","mCurt","mCurtis","mCuthbert","fCynthia"
|
76
|
+
,"mCyril","mCyrus","mDacey","fDagmar","fDahlia","mDaire","fDaisy","fDakota","mDakota","mDale"
|
77
|
+
,"mDallas","mDalton","mDamian","mDamien","mDamion","mDamon","mDan","mDana","fDana","mDane"
|
78
|
+
,"fDanette","fDani","fDanica","mDaniel","fDaniela","fDaniella","fDanielle","fDanika","mDanny","mDante"
|
79
|
+
,"fDaphne","mDara","fDara","mDaragh","fDarcey","fDarcie","mDarcy","fDarcy","mDaren","fDaria"
|
80
|
+
,"mDarian","mDarin","mDario","mDarius","fDarla","fDarlene","mDarnell","mDarragh","mDarrel","mDarrell"
|
81
|
+
,"mDarren","mDarrin","mDarryl","mDarwin","mDaryl","mDash","mDashawn","fDashee","mDave","mDavid"
|
82
|
+
,"fDavida","fDavina","mDavion","mDavis","fDawn","mDawson","mDax","mDaxter","mDaxton","fDayna"
|
83
|
+
,"fDaysha","mDayton","mDeacon","mDean","fDeana","mDeandre","fDeann","fDeanna","fDeanne","fDebbie"
|
84
|
+
,"fDebora","fDeborah","fDebra","mDeclan","fDee","fDeedee","fDeena","mDeepak","fDeidre","fDeirdre"
|
85
|
+
,"fDeja","fDelaney","fDelanie","mDelbert","fDelia","fDelilah","fDella","fDelores","fDelphine","fDemetria"
|
86
|
+
,"mDemetrius","fDemi","fDena","mDenis","fDenise","mDennis","fDenny","mDenver","mDenzel","mDerek"
|
87
|
+
,"mDerrick","mDeshawn","fDesiree","mDesmond","fDestinee","fDestiny","mDev","mDevin","mDevlin","mDevon"
|
88
|
+
,"mDewayne","mDewey","mDexter","mDhalsim","fDiamond","fDiana","fDiane","fDianna","fDianne","mDiarmuid"
|
89
|
+
,"mDick","fDido","mDiego","mDieter","mDillon","mDimitri","fDina","mDinesh","mDino","mDion"
|
90
|
+
,"fDionne","fDior","mDirk","fDixie","mDjango","mDmitri","fDolly","fDolores","mDominic","mDominick"
|
91
|
+
,"fDominique","mDon","mDonald","fDonna","mDonnie","mDonovan","fDora","fDoreen","mDorian","fDoris"
|
92
|
+
,"fDorothy","fDot","mDoug","mDouglas","mDoyle","mDrake","fDrew","mDrew","mDuane","mDuke"
|
93
|
+
,"fDulce","mDuncan","mDustin","mDwayne","mDwight","mDylan","fEabha","mEamon","mEarl","mEarnest"
|
94
|
+
,"mEaston","fEbony","fEcho","mEd","mEddie","mEddy","mEden","fEden","mEdgar","fEdie"
|
95
|
+
,"mEdison","fEdith","mEdmund","fEdna","mEduardo","mEdward","mEdwardo","mEdwin","fEdwina","fEffie"
|
96
|
+
,"mEfrain","mEfren","mEgan","mEgon","fEileen","fEilidh","fEimear","fElaina","fElaine","fElana"
|
97
|
+
,"fEleanor","fElectra","fElektra","fElena","mEli","fEliana","mElias","mElijah","fElin","fElina"
|
98
|
+
,"mEliot","fElisa","fElisabeth","fElise","mElisha","fEliza","fElizabeth","fElla","fElle","fEllen"
|
99
|
+
,"fEllery","fEllie","mElliot","mElliott","mEllis","fEllis","fElly","mElmer","mElmo","fElodie"
|
100
|
+
,"fEloise","fElora","fElsa","fElsie","fElspeth","mElton","fElvira","mElvis","fElysia","fElyza"]
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
|
1
4
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
5
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
6
|
require 'rspec'
|
@@ -8,5 +11,5 @@ require 'genderize_io_rb'
|
|
8
11
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
12
|
|
10
13
|
RSpec.configure do |config|
|
11
|
-
|
14
|
+
|
12
15
|
end
|
metadata
CHANGED
@@ -1,139 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genderize_io_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: string-cases
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 2.8.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.8.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rdoc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3.12'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.12'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.0.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: jeweler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sqlite3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: baza
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 0.0.12
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.0.12
|
139
139
|
description: A small Gem that makes it possible to determine gender from a name via
|
@@ -145,8 +145,8 @@ extra_rdoc_files:
|
|
145
145
|
- LICENSE.txt
|
146
146
|
- README.md
|
147
147
|
files:
|
148
|
-
- .document
|
149
|
-
- .rspec
|
148
|
+
- ".document"
|
149
|
+
- ".rspec"
|
150
150
|
- Gemfile
|
151
151
|
- Gemfile.lock
|
152
152
|
- LICENSE.txt
|
@@ -158,7 +158,9 @@ files:
|
|
158
158
|
- include/errors.rb
|
159
159
|
- include/result.rb
|
160
160
|
- lib/genderize_io_rb.rb
|
161
|
+
- shippable.yml
|
161
162
|
- spec/genderize_io_rb_spec.rb
|
163
|
+
- spec/shitload_of_names.json
|
162
164
|
- spec/spec_helper.rb
|
163
165
|
homepage: http://github.com/kaspernj/genderize_io_rb
|
164
166
|
licenses:
|
@@ -170,17 +172,17 @@ require_paths:
|
|
170
172
|
- lib
|
171
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
172
174
|
requirements:
|
173
|
-
- -
|
175
|
+
- - ">="
|
174
176
|
- !ruby/object:Gem::Version
|
175
177
|
version: '0'
|
176
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
179
|
requirements:
|
178
|
-
- -
|
180
|
+
- - ">="
|
179
181
|
- !ruby/object:Gem::Version
|
180
182
|
version: '0'
|
181
183
|
requirements: []
|
182
184
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.0
|
185
|
+
rubygems_version: 2.4.0
|
184
186
|
signing_key:
|
185
187
|
specification_version: 4
|
186
188
|
summary: A small Gem that makes it possible to determine gender from a name via the
|