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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c70aa532119519cef8bccf2bef58bbdb9afdcba8abd4f88fe0b6a8621eaef4c
4
- data.tar.gz: 466736b3a9127dd5260914a80a46ddf91e670603105fbb79077fc16f2d07eed2
3
+ metadata.gz: 4c1376818a13c76f350db58d37acf2f6145542720b4d2e5b9fd3bd286619bb2d
4
+ data.tar.gz: fcd99945a5facb96f66c5b99602362786cfe205c1abcbd75250a4edbba9f7650
5
5
  SHA512:
6
- metadata.gz: 3dd1223fd6f72fac667d2c1a5d1cbb33655bf7831b6b6dbb0c0fa3e702fcda45efbe872f50144467b55b1b7618934ab5c20e35df0686019b8486735423fefe88
7
- data.tar.gz: 55a29a8e3ddb9044de27ec9dfe1e4b23bea78f96f0fa08bcae0159332a9324cc7e2cb529cdad01cd8a09735f6855c7960ec726c6de3f3f636a6ab8052db7dcd7
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: 2.6
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
@@ -4,6 +4,7 @@ cache: bundler
4
4
  rvm:
5
5
  - 2.5
6
6
  - 2.6
7
+ - 2.7
7
8
  - ruby-head
8
9
  matrix:
9
10
  fast_finish: true
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in lite-ruby.gemspec
5
+ # Specify your gem's dependencies in genderize-io.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,69 +1,75 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- genderize-io (1.2.0)
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.7.0)
10
+ addressable (2.8.0)
12
11
  public_suffix (>= 2.0.2, < 5.0)
13
- agents (0.1.4)
14
- ast (2.4.0)
12
+ ast (2.4.2)
15
13
  colorize (0.8.1)
16
- crack (0.4.3)
17
- safe_yaml (~> 1.0.0)
18
- diff-lcs (1.3)
19
- ethon (0.12.0)
20
- ffi (>= 1.3.0)
21
- fasterer (0.8.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.11.2)
25
- hashdiff (1.0.0)
26
- jaro_winkler (1.5.4)
27
- parallel (1.19.0)
28
- parser (2.6.5.0)
29
- ast (~> 2.4.0)
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.1)
33
- rspec (3.9.0)
34
- rspec-core (~> 3.9.0)
35
- rspec-expectations (~> 3.9.0)
36
- rspec-mocks (~> 3.9.0)
37
- rspec-core (3.9.0)
38
- rspec-support (~> 3.9.0)
39
- rspec-expectations (3.9.0)
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.9.0)
42
- rspec-mocks (3.9.0)
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.9.0)
45
- rspec-support (3.9.0)
46
- rubocop (0.76.0)
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 (>= 2.6)
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, < 1.7)
53
- rubocop-performance (1.5.1)
54
- rubocop (>= 0.71.0)
55
- rubocop-rspec (1.36.0)
56
- rubocop (>= 0.68.1)
57
- ruby-progressbar (1.10.1)
58
- ruby_parser (3.14.1)
59
- sexp_processor (~> 4.9)
60
- safe_yaml (1.0.5)
61
- sexp_processor (4.13.0)
62
- typhoeus (1.3.1)
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 (1.6.0)
65
- vcr (5.0.0)
66
- webmock (3.7.6)
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
- 1.17.3
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
- 'public gem pushes.'
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
- %w[json header].each do |file_name|
4
- require "genderize/io/parser/#{file_name}"
5
- end
6
-
7
- %w[version base lookup].each do |file_name|
8
- require "genderize/io/#{file_name}"
9
- require "genderize/io/batch/#{file_name}" if file_name == 'lookup'
10
- end
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'
@@ -1,14 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'agents'
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 ||= 'https://api.genderize.io'
11
- HEADER_KEYS ||= %w[
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
- klass = new(name, host: host, country_id: country_id, language_id: language_id)
27
- klass.determine
28
- klass
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
 
@@ -4,7 +4,7 @@ module Genderize
4
4
  module Io
5
5
  class Lookup < Genderize::Io::Base
6
6
 
7
- RESPONSE_KEYS ||= %w[
7
+ RESPONSE_KEYS = %w[
8
8
  count country_id error language_id gender probability
9
9
  ].freeze
10
10
 
@@ -14,9 +14,9 @@ module Genderize
14
14
  end
15
15
 
16
16
  def self.parse(response, strict: true)
17
- klass = new(response, strict: strict)
18
- klass.parse
19
- klass
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 =~ /^\"(.*)\"$/ ? Regexp.last_match(1) : val
57
+ val =~ /^"(.*)"$/ ? Regexp.last_match(1) : val
58
58
  end
59
59
 
60
60
  end
@@ -15,9 +15,9 @@ module Genderize
15
15
  end
16
16
 
17
17
  def self.parse(data)
18
- klass = new(data)
19
- klass.parse
20
- klass.hash
18
+ instance = new(data)
19
+ instance.parse
20
+ instance.hash
21
21
  end
22
22
 
23
23
  def parse
@@ -3,7 +3,7 @@
3
3
  module Genderize
4
4
  module Io
5
5
 
6
- VERSION ||= '1.2.0'
6
+ VERSION = '1.4.0'
7
7
 
8
8
  end
9
9
  end
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.2.0
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: 2019-11-17 00:00:00.000000000 Z
11
+ date: 2021-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: agents
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: typhoeus
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: :runtime
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: bundler
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: fasterer
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: rake
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: rspec
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-performance
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.0.6
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: []