genderize-io 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -3
- data/.travis.yml +1 -0
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +55 -48
- data/README.md +0 -7
- data/genderize-io.gemspec +2 -2
- data/lib/genderize/io.rb +9 -8
- data/lib/genderize/io/base.rb +6 -8
- data/lib/genderize/io/lookup.rb +1 -1
- data/lib/genderize/io/parser/header.rb +4 -4
- data/lib/genderize/io/parser/json.rb +3 -3
- data/lib/genderize/io/version.rb +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c1376818a13c76f350db58d37acf2f6145542720b4d2e5b9fd3bd286619bb2d
|
4
|
+
data.tar.gz: fcd99945a5facb96f66c5b99602362786cfe205c1abcbd75250a4edbba9f7650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b0804ed996d68791457cf741356f0a95eca590d0f76a9d4e829606a880dd6e7bdee1ef03fc996d457b1de4a7dfa014f2dcbab088d9a3acb16bfd9a787c68b9
|
7
|
+
data.tar.gz: 1cc74d398fabf1511354c46757aa204e82aec733e242515c727a1793a70e7b1d3513bac275f694a2a912bdd6ad0947e0ce482de929041a1bb833d97b2c04edd6
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-performance
|
3
|
+
- rubocop-rake
|
3
4
|
- rubocop-rspec
|
4
5
|
AllCops:
|
5
|
-
TargetRubyVersion:
|
6
|
+
TargetRubyVersion: 3.0
|
7
|
+
NewCops: enable
|
6
8
|
DisplayCopNames: true
|
7
9
|
DisplayStyleGuide: true
|
10
|
+
Gemspec/RequiredRubyVersion:
|
11
|
+
Enabled: false
|
12
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
13
|
+
Enabled: true
|
8
14
|
Layout/EmptyLinesAroundBlockBody:
|
9
15
|
Exclude:
|
10
16
|
- 'spec/**/**/*'
|
@@ -12,16 +18,24 @@ Layout/EmptyLinesAroundClassBody:
|
|
12
18
|
EnforcedStyle: empty_lines_except_namespace
|
13
19
|
Layout/EmptyLinesAroundModuleBody:
|
14
20
|
EnforcedStyle: empty_lines_except_namespace
|
21
|
+
Layout/LineLength:
|
22
|
+
Max: 100
|
23
|
+
Layout/SpaceAroundMethodCallOperator:
|
24
|
+
Enabled: true
|
25
|
+
Lint/RaiseException:
|
26
|
+
Enabled: true
|
27
|
+
Lint/StructNewOverride:
|
28
|
+
Enabled: true
|
15
29
|
Metrics/BlockLength:
|
16
30
|
Exclude:
|
17
31
|
- 'spec/**/**/*'
|
18
32
|
- '*.gemspec'
|
19
|
-
Metrics/LineLength:
|
20
|
-
Max: 100
|
21
33
|
RSpec/ExampleLength:
|
22
34
|
Enabled: false
|
23
35
|
RSpec/MultipleExpectations:
|
24
36
|
Enabled: false
|
37
|
+
Style/ArgumentsForwarding:
|
38
|
+
Enabled: false
|
25
39
|
Style/Documentation:
|
26
40
|
Enabled: false
|
27
41
|
Style/ExpandPathArguments:
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.4.0] - 2021-07-22
|
10
|
+
### Changed
|
11
|
+
- Improved requirement initializations
|
12
|
+
### Removed
|
13
|
+
- Remove agents dependency
|
14
|
+
|
15
|
+
## [1.3.0] - 2021-07-19
|
16
|
+
### Added
|
17
|
+
- Added Ruby 3.0 support
|
18
|
+
|
19
|
+
## [1.2.2] - 2021-07-05
|
20
|
+
### Changed
|
21
|
+
- Linter fixes
|
22
|
+
|
23
|
+
## [1.2.1] - 2020-07-03
|
24
|
+
### Added
|
25
|
+
- Added Ruby 2.7 support
|
26
|
+
|
9
27
|
## [1.2.0] - 2019-11-17
|
10
28
|
### Added
|
11
29
|
- Added CHANGELOG.md
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,69 +1,75 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
genderize-io (1.
|
5
|
-
agents
|
4
|
+
genderize-io (1.4.0)
|
6
5
|
typhoeus
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
|
-
addressable (2.
|
10
|
+
addressable (2.8.0)
|
12
11
|
public_suffix (>= 2.0.2, < 5.0)
|
13
|
-
|
14
|
-
ast (2.4.0)
|
12
|
+
ast (2.4.2)
|
15
13
|
colorize (0.8.1)
|
16
|
-
crack (0.4.
|
17
|
-
|
18
|
-
diff-lcs (1.
|
19
|
-
ethon (0.
|
20
|
-
ffi (>= 1.
|
21
|
-
fasterer (0.
|
14
|
+
crack (0.4.5)
|
15
|
+
rexml
|
16
|
+
diff-lcs (1.4.4)
|
17
|
+
ethon (0.14.0)
|
18
|
+
ffi (>= 1.15.0)
|
19
|
+
fasterer (0.9.0)
|
22
20
|
colorize (~> 0.7)
|
23
21
|
ruby_parser (>= 3.14.1)
|
24
|
-
ffi (1.
|
25
|
-
hashdiff (1.0.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
public_suffix (4.0.1)
|
22
|
+
ffi (1.15.3)
|
23
|
+
hashdiff (1.0.1)
|
24
|
+
parallel (1.20.1)
|
25
|
+
parser (3.0.2.0)
|
26
|
+
ast (~> 2.4.1)
|
27
|
+
public_suffix (4.0.6)
|
31
28
|
rainbow (3.0.0)
|
32
|
-
rake (13.0.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
rspec-
|
37
|
-
|
38
|
-
rspec-
|
39
|
-
rspec-
|
29
|
+
rake (13.0.6)
|
30
|
+
regexp_parser (2.1.1)
|
31
|
+
rexml (3.2.5)
|
32
|
+
rspec (3.10.0)
|
33
|
+
rspec-core (~> 3.10.0)
|
34
|
+
rspec-expectations (~> 3.10.0)
|
35
|
+
rspec-mocks (~> 3.10.0)
|
36
|
+
rspec-core (3.10.1)
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-expectations (3.10.1)
|
40
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-mocks (3.
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-mocks (3.10.2)
|
43
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-support (3.
|
46
|
-
rubocop (
|
47
|
-
jaro_winkler (~> 1.5.1)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-support (3.10.2)
|
45
|
+
rubocop (1.18.3)
|
48
46
|
parallel (~> 1.10)
|
49
|
-
parser (>=
|
47
|
+
parser (>= 3.0.0.0)
|
50
48
|
rainbow (>= 2.2.2, < 4.0)
|
49
|
+
regexp_parser (>= 1.8, < 3.0)
|
50
|
+
rexml
|
51
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
51
52
|
ruby-progressbar (~> 1.7)
|
52
|
-
unicode-display_width (>= 1.4.0, <
|
53
|
-
rubocop-
|
54
|
-
|
55
|
-
rubocop-
|
56
|
-
rubocop (>= 0.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
53
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
54
|
+
rubocop-ast (1.8.0)
|
55
|
+
parser (>= 3.0.1.1)
|
56
|
+
rubocop-performance (1.11.4)
|
57
|
+
rubocop (>= 1.7.0, < 2.0)
|
58
|
+
rubocop-ast (>= 0.4.0)
|
59
|
+
rubocop-rake (0.6.0)
|
60
|
+
rubocop (~> 1.0)
|
61
|
+
rubocop-rspec (2.4.0)
|
62
|
+
rubocop (~> 1.0)
|
63
|
+
rubocop-ast (>= 1.1.0)
|
64
|
+
ruby-progressbar (1.11.0)
|
65
|
+
ruby_parser (3.16.0)
|
66
|
+
sexp_processor (~> 4.15, >= 4.15.1)
|
67
|
+
sexp_processor (4.15.3)
|
68
|
+
typhoeus (1.4.0)
|
63
69
|
ethon (>= 0.9.0)
|
64
|
-
unicode-display_width (
|
65
|
-
vcr (
|
66
|
-
webmock (3.
|
70
|
+
unicode-display_width (2.0.0)
|
71
|
+
vcr (6.0.0)
|
72
|
+
webmock (3.13.0)
|
67
73
|
addressable (>= 2.3.6)
|
68
74
|
crack (>= 0.3.2)
|
69
75
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -79,9 +85,10 @@ DEPENDENCIES
|
|
79
85
|
rspec
|
80
86
|
rubocop
|
81
87
|
rubocop-performance
|
88
|
+
rubocop-rake
|
82
89
|
rubocop-rspec
|
83
90
|
vcr
|
84
91
|
webmock
|
85
92
|
|
86
93
|
BUNDLED WITH
|
87
|
-
|
94
|
+
2.2.24
|
data/README.md
CHANGED
@@ -22,13 +22,6 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
$ gem install genderize-io
|
24
24
|
|
25
|
-
## Table of Contents
|
26
|
-
|
27
|
-
* [Simple Lookup](#simple-lookup)
|
28
|
-
* [Simple Response](#simple-response)
|
29
|
-
* [Batch Lookup](#batch-lookup)
|
30
|
-
* [Batch Response](#batch-response)
|
31
|
-
|
32
25
|
## Usage
|
33
26
|
|
34
27
|
### Simple Lookup
|
data/genderize-io.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
)
|
26
26
|
else
|
27
27
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
28
|
-
|
28
|
+
'public gem pushes.'
|
29
29
|
end
|
30
30
|
|
31
31
|
# Specify which files should be added to the gem when it is released.
|
@@ -37,7 +37,6 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
38
|
spec.require_paths = %w[lib]
|
39
39
|
|
40
|
-
spec.add_runtime_dependency 'agents'
|
41
40
|
spec.add_runtime_dependency 'typhoeus'
|
42
41
|
|
43
42
|
spec.add_development_dependency 'bundler'
|
@@ -46,6 +45,7 @@ Gem::Specification.new do |spec|
|
|
46
45
|
spec.add_development_dependency 'rspec'
|
47
46
|
spec.add_development_dependency 'rubocop'
|
48
47
|
spec.add_development_dependency 'rubocop-performance'
|
48
|
+
spec.add_development_dependency 'rubocop-rake'
|
49
49
|
spec.add_development_dependency 'rubocop-rspec'
|
50
50
|
spec.add_development_dependency 'vcr'
|
51
51
|
spec.add_development_dependency 'webmock'
|
data/lib/genderize/io.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
require 'genderize/io/version'
|
4
|
+
|
5
|
+
require 'genderize/io/parser/json'
|
6
|
+
require 'genderize/io/parser/header'
|
7
|
+
|
8
|
+
require 'genderize/io/base'
|
9
|
+
require 'genderize/io/lookup'
|
10
|
+
|
11
|
+
require 'genderize/io/batch/lookup'
|
data/lib/genderize/io/base.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'typhoeus'
|
3
|
+
require 'typhoeus' unless defined?(Typhoeus)
|
5
4
|
|
6
5
|
module Genderize
|
7
6
|
module Io
|
8
7
|
class Base
|
9
8
|
|
10
|
-
DEFAULT_HOST
|
11
|
-
HEADER_KEYS
|
9
|
+
DEFAULT_HOST = 'https://api.genderize.io'
|
10
|
+
HEADER_KEYS = %w[
|
12
11
|
x_rate_limit_limit x_rate_limit_remaining x_rate_reset
|
13
12
|
].freeze
|
14
13
|
|
@@ -23,9 +22,9 @@ module Genderize
|
|
23
22
|
end
|
24
23
|
|
25
24
|
def self.determine(name, host: DEFAULT_HOST, country_id: nil, language_id: nil)
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
instance = new(name, host: host, country_id: country_id, language_id: language_id)
|
26
|
+
instance.determine
|
27
|
+
instance
|
29
28
|
end
|
30
29
|
|
31
30
|
def url
|
@@ -57,7 +56,6 @@ module Genderize
|
|
57
56
|
def generate_request
|
58
57
|
return @request unless @request.nil?
|
59
58
|
|
60
|
-
Typhoeus::Config.user_agent = Agents.random_user_agent(:desktop)
|
61
59
|
Typhoeus.get(url, accept_encoding: 'gzip,deflate')
|
62
60
|
end
|
63
61
|
|
data/lib/genderize/io/lookup.rb
CHANGED
@@ -14,9 +14,9 @@ module Genderize
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.parse(response, strict: true)
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
instance = new(response, strict: strict)
|
18
|
+
instance.parse
|
19
|
+
instance
|
20
20
|
end
|
21
21
|
|
22
22
|
def parse
|
@@ -54,7 +54,7 @@ module Genderize
|
|
54
54
|
|
55
55
|
def value_from(tag)
|
56
56
|
val = tag.split(/:\s+/)[1]
|
57
|
-
val =~
|
57
|
+
val =~ /^"(.*)"$/ ? Regexp.last_match(1) : val
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
data/lib/genderize/io/version.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genderize-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: typhoeus
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,13 +25,13 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: fasterer
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
98
|
+
name: rubocop-performance
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-
|
112
|
+
name: rubocop-rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
description:
|
167
|
+
description:
|
168
168
|
email:
|
169
169
|
- j.gomez@drexed.com
|
170
170
|
executables: []
|
@@ -197,7 +197,7 @@ homepage: http://drexed.github.io/genderize-io
|
|
197
197
|
licenses:
|
198
198
|
- MIT
|
199
199
|
metadata: {}
|
200
|
-
post_install_message:
|
200
|
+
post_install_message:
|
201
201
|
rdoc_options: []
|
202
202
|
require_paths:
|
203
203
|
- lib
|
@@ -212,8 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
|
-
rubygems_version: 3.
|
216
|
-
signing_key:
|
215
|
+
rubygems_version: 3.2.24
|
216
|
+
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Genderize.io Ruby SDK for interacting with the Genderize.io API.
|
219
219
|
test_files: []
|