proxied 0.1.1 → 0.1.2

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: 517de1167f3ffecb00a5928fc7a9372fb4190ac7cfa4c6ab61c9ba623c59dbb7
4
- data.tar.gz: 4bddfb8d6887527f1319b7ed653d2519cad672b697c76e87a9658bb673bbfc88
3
+ metadata.gz: 4b63589961f4cbc4d46a03c5c97d88171f5a86af86e6a58f47042336e38fd58d
4
+ data.tar.gz: e3ae83908238864b37d9d6d78ba1a914157898cf9430fc946d39e8480d7ff5ab
5
5
  SHA512:
6
- metadata.gz: 7a689a4a001970b1ae2f2a7d886b4406421a4df8e887ee40386f22f6de1e97c0167c1481ae9a4e61d52a341d0624ac6d92d684700190bda3486c7cf47e589cbd
7
- data.tar.gz: c26a67137820c580253bb7dc9e9d8ee683ea33fbccda247cd56c5b48c914a71a2d176e3dc79099a2a24d7b55f84860593afa15b860c4df183daa89f439de726c
6
+ metadata.gz: feb8cbe47e0563025c8c497242a5ab3aa982be099a6b457d3bee2dae64f710ec2d67e368eb25de5f0fdaee0249c924c073a9c2a9d1b6d3c3dc9bcc2654eb7448
7
+ data.tar.gz: a0799134b33788cc919808258a3add09fd881fb7a082de3a62ca91182c831ac4a23fa90827673cd436802537c5f9b021219e32dab2fc196ad1c74a64070dc3e5
@@ -34,6 +34,7 @@ require "proxied/sql/proxy_methods" if defined?(ActiveRecord)
34
34
  require "proxied/nosql/proxy_methods" if defined?(Mongoid)
35
35
 
36
36
  require "proxied/checker"
37
+ require "proxied/importer"
37
38
 
38
39
  if defined?(Sidekiq)
39
40
  require "proxied/jobs/check_proxies_job"
@@ -1,5 +1,5 @@
1
1
  module Proxied
2
- class Seeder
2
+ class Importer
3
3
 
4
4
  # Expected format:
5
5
  # {
@@ -8,14 +8,16 @@ module Proxied
8
8
  # protocol (http,socks)
9
9
  # proxy_type (private,public)
10
10
  # category
11
+ # country
12
+ # city
11
13
  # username
12
14
  # password
13
15
  # }
14
16
 
15
- def import(proxies)
17
+ def self.import(proxies)
16
18
  proxies.each do |proxy_item|
17
19
  query = {
18
- host: proxy_item[:ip_address]&.to_s&.strip,
20
+ host: proxy_item[:host]&.to_s&.strip,
19
21
  port: proxy_item[:port]&.to_s&.strip&.to_i
20
22
  }
21
23
 
@@ -23,6 +25,8 @@ module Proxied
23
25
  protocol: proxy_item.fetch(:protocol, "http")&.to_s&.strip&.downcase,
24
26
  proxy_type: proxy_item.fetch(:type, :private)&.to_s&.strip,
25
27
  category: proxy_item.fetch(:category, nil)&.to_s&.strip&.downcase,
28
+ country: proxy_item.fetch(:country, nil)&.to_s&.strip&.downcase,
29
+ city: proxy_item.fetch(:city, nil)&.to_s&.strip&.downcase,
26
30
  username: proxy_item.fetch(:username, nil)&.to_s&.strip,
27
31
  password: proxy_item.fetch(:password, nil)&.to_s&.strip
28
32
  }.merge(query)
@@ -1,3 +1,3 @@
1
1
  module Proxied
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxied
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian
@@ -291,12 +291,12 @@ files:
291
291
  - lib/proxied.rb
292
292
  - lib/proxied/checker.rb
293
293
  - lib/proxied/configuration.rb
294
+ - lib/proxied/importer.rb
294
295
  - lib/proxied/jobs/check_proxies_job.rb
295
296
  - lib/proxied/jobs/check_proxy_job.rb
296
297
  - lib/proxied/logger.rb
297
298
  - lib/proxied/nosql/proxy_methods.rb
298
299
  - lib/proxied/railtie.rb
299
- - lib/proxied/seeder.rb
300
300
  - lib/proxied/shared.rb
301
301
  - lib/proxied/sql/proxy_methods.rb
302
302
  - lib/proxied/version.rb