genderize-io 1.3.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: eefc153806c261ec8b1ae00ce0d5e9b1de409b60028d056a3969a2d907196e19
4
- data.tar.gz: 5f425c3e959a0c4f34da36b3800d143faeac7733d95f158058f276b5152ea9c5
3
+ metadata.gz: 4c1376818a13c76f350db58d37acf2f6145542720b4d2e5b9fd3bd286619bb2d
4
+ data.tar.gz: fcd99945a5facb96f66c5b99602362786cfe205c1abcbd75250a4edbba9f7650
5
5
  SHA512:
6
- metadata.gz: cf147f0c26294e4c0f8174ba4dbfc54e43fa646f4abffa9b35b2ef8b337f424eed8424efb63414c2d9c78ea27dfb607961c1d8f01bbef33ac4131d1b52e50d49
7
- data.tar.gz: 2b2cb0b51fec3187f4fd821b3259901eda546872aed663ff0d68c4de4650ba9dbd5bfbb5178f5312da8870afa0c8c991195774c149cdab91da08398a74edbb52
6
+ metadata.gz: 23b0804ed996d68791457cf741356f0a95eca590d0f76a9d4e829606a880dd6e7bdee1ef03fc996d457b1de4a7dfa014f2dcbab088d9a3acb16bfd9a787c68b9
7
+ data.tar.gz: 1cc74d398fabf1511354c46757aa204e82aec733e242515c727a1793a70e7b1d3513bac275f694a2a912bdd6ad0947e0ce482de929041a1bb833d97b2c04edd6
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ 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
+
9
15
  ## [1.3.0] - 2021-07-19
10
16
  ### Added
11
17
  - Added Ruby 3.0 support
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- genderize-io (1.3.0)
5
- agents
4
+ genderize-io (1.4.0)
6
5
  typhoeus
7
6
 
8
7
  GEM
@@ -10,7 +9,6 @@ GEM
10
9
  specs:
11
10
  addressable (2.8.0)
12
11
  public_suffix (>= 2.0.2, < 5.0)
13
- agents (0.1.4)
14
12
  ast (2.4.2)
15
13
  colorize (0.8.1)
16
14
  crack (0.4.5)
data/genderize-io.gemspec CHANGED
@@ -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'
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,7 +1,6 @@
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
@@ -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
 
@@ -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
@@ -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.3.0'
6
+ VERSION = '1.4.0'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genderize-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-20 00:00:00.000000000 Z
11
+ date: 2021-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: agents
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: typhoeus
29
15
  requirement: !ruby/object:Gem::Requirement