proxied 0.2.0 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58e69adf50671eb77dac5aab9fbe23f3704243a1f21678082bfb4d92cd1204a9
4
- data.tar.gz: c10c1245e7fde08ab30b82e109e3c5d977dd0dc80332f48f37910d5c9b30bb23
3
+ metadata.gz: 1efa52c524322a60a208bd12ebc9d8acdc5e9abeaa4f907cb77d4084ad5cd09c
4
+ data.tar.gz: 16347e22feb2f9059bf52dc9806a7a40b1e2ab484f3bd5db4cbac8af830c3c45
5
5
  SHA512:
6
- metadata.gz: de4a55cac54cf4906ad7ff46cc774d2ca0eec7e416227a5e8f091c8faead140741fe5f5defd9a3f7d5ac963430281aca48992953a1e88252f92a3cecf5de885d
7
- data.tar.gz: 412e1cf5216ffd43e7b48c916331a5798ef139eab8372f7a917298728eb50935d08830b7ffb8abf9929877bed5101b2e65d84bbe6851ccbd93f0cc74c7c30ddf
6
+ metadata.gz: 7a53757a72afef8145b241569d2d2be729851a7a243321eb42bf991d2d1944ab260d8e8f6a3f360b06bf626ab36871c7ffd303ed161e3d263a1187d0f57bb344
7
+ data.tar.gz: 26ebf333aa140ad846422482913834f52d2139bc8900900f8b5d2b66eee67443f3272adab13e2a7b97b9cfea908c6c83d5bfd6892cb5d8d8af8aabfbdd1946cb
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
5
  # Specify your gem's dependencies in proxied.gemspec
6
6
  gemspec
7
7
 
8
- gem "rails", "~> 5.2"
8
+ gem 'rails', '~> 6.0', '>= 6.0.3.2'
@@ -1,202 +1,218 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proxied (0.2.0)
5
- faraday (>= 0.15.4)
6
- net-ssh (>= 5.1)
4
+ proxied (0.2.6)
5
+ faraday (~> 1.0, >= 1.0.1)
6
+ net-ssh (~> 6.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.2.3)
12
- actionpack (= 5.2.3)
11
+ actioncable (6.0.3.2)
12
+ actionpack (= 6.0.3.2)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailer (5.2.3)
16
- actionpack (= 5.2.3)
17
- actionview (= 5.2.3)
18
- activejob (= 5.2.3)
15
+ actionmailbox (6.0.3.2)
16
+ actionpack (= 6.0.3.2)
17
+ activejob (= 6.0.3.2)
18
+ activerecord (= 6.0.3.2)
19
+ activestorage (= 6.0.3.2)
20
+ activesupport (= 6.0.3.2)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.0.3.2)
23
+ actionpack (= 6.0.3.2)
24
+ actionview (= 6.0.3.2)
25
+ activejob (= 6.0.3.2)
19
26
  mail (~> 2.5, >= 2.5.4)
20
27
  rails-dom-testing (~> 2.0)
21
- actionpack (5.2.3)
22
- actionview (= 5.2.3)
23
- activesupport (= 5.2.3)
24
- rack (~> 2.0)
28
+ actionpack (6.0.3.2)
29
+ actionview (= 6.0.3.2)
30
+ activesupport (= 6.0.3.2)
31
+ rack (~> 2.0, >= 2.0.8)
25
32
  rack-test (>= 0.6.3)
26
33
  rails-dom-testing (~> 2.0)
27
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.2.3)
29
- activesupport (= 5.2.3)
34
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
35
+ actiontext (6.0.3.2)
36
+ actionpack (= 6.0.3.2)
37
+ activerecord (= 6.0.3.2)
38
+ activestorage (= 6.0.3.2)
39
+ activesupport (= 6.0.3.2)
40
+ nokogiri (>= 1.8.5)
41
+ actionview (6.0.3.2)
42
+ activesupport (= 6.0.3.2)
30
43
  builder (~> 3.1)
31
44
  erubi (~> 1.4)
32
45
  rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
- activejob (5.2.3)
35
- activesupport (= 5.2.3)
46
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
47
+ activejob (6.0.3.2)
48
+ activesupport (= 6.0.3.2)
36
49
  globalid (>= 0.3.6)
37
- activemodel (5.2.3)
38
- activesupport (= 5.2.3)
39
- activerecord (5.2.3)
40
- activemodel (= 5.2.3)
41
- activesupport (= 5.2.3)
42
- arel (>= 9.0)
43
- activestorage (5.2.3)
44
- actionpack (= 5.2.3)
45
- activerecord (= 5.2.3)
50
+ activemodel (6.0.3.2)
51
+ activesupport (= 6.0.3.2)
52
+ activerecord (6.0.3.2)
53
+ activemodel (= 6.0.3.2)
54
+ activesupport (= 6.0.3.2)
55
+ activestorage (6.0.3.2)
56
+ actionpack (= 6.0.3.2)
57
+ activejob (= 6.0.3.2)
58
+ activerecord (= 6.0.3.2)
46
59
  marcel (~> 0.3.1)
47
- activesupport (5.2.3)
60
+ activesupport (6.0.3.2)
48
61
  concurrent-ruby (~> 1.0, >= 1.0.2)
49
62
  i18n (>= 0.7, < 2)
50
63
  minitest (~> 5.1)
51
64
  tzinfo (~> 1.1)
52
- addressable (2.6.0)
53
- public_suffix (>= 2.0.2, < 4.0)
54
- appraisal (2.2.0)
65
+ zeitwerk (~> 2.2, >= 2.2.2)
66
+ addressable (2.7.0)
67
+ public_suffix (>= 2.0.2, < 5.0)
68
+ appraisal (2.3.0)
55
69
  bundler
56
70
  rake
57
71
  thor (>= 0.14.0)
58
- arel (9.0.0)
59
72
  axiom-types (0.1.1)
60
73
  descendants_tracker (~> 0.0.4)
61
74
  ice_nine (~> 0.11.0)
62
75
  thread_safe (~> 0.3, >= 0.3.1)
63
- builder (3.2.3)
64
- coderay (1.1.2)
76
+ builder (3.2.4)
77
+ coderay (1.1.3)
65
78
  coercible (1.0.0)
66
79
  descendants_tracker (~> 0.0.1)
67
- concurrent-ruby (1.1.5)
80
+ concurrent-ruby (1.1.6)
68
81
  crack (0.4.3)
69
82
  safe_yaml (~> 1.0.0)
70
- crass (1.0.4)
83
+ crass (1.0.6)
71
84
  descendants_tracker (0.0.4)
72
85
  thread_safe (~> 0.3, >= 0.3.1)
73
- diff-lcs (1.3)
86
+ diff-lcs (1.4.4)
74
87
  equalizer (0.0.11)
75
- erubi (1.8.0)
76
- faraday (0.15.4)
88
+ erubi (1.9.0)
89
+ faraday (1.0.1)
77
90
  multipart-post (>= 1.2, < 3)
78
91
  generator_spec (0.9.4)
79
92
  activesupport (>= 3.0.0)
80
93
  railties (>= 3.0.0)
81
94
  globalid (0.4.2)
82
95
  activesupport (>= 4.2.0)
83
- hashdiff (0.4.0)
84
- i18n (1.6.0)
96
+ hashdiff (1.0.1)
97
+ i18n (1.8.3)
85
98
  concurrent-ruby (~> 1.0)
86
99
  ice_nine (0.11.2)
87
- loofah (2.2.3)
100
+ loofah (2.6.0)
88
101
  crass (~> 1.0.2)
89
102
  nokogiri (>= 1.5.9)
90
103
  mail (2.7.1)
91
104
  mini_mime (>= 0.1.1)
92
105
  marcel (0.3.3)
93
106
  mimemagic (~> 0.3.2)
94
- method_source (0.9.2)
95
- mimemagic (0.3.3)
96
- mini_mime (1.0.1)
107
+ method_source (1.0.0)
108
+ mimemagic (0.3.5)
109
+ mini_mime (1.0.2)
97
110
  mini_portile2 (2.4.0)
98
- minitest (5.11.3)
111
+ minitest (5.14.1)
99
112
  multipart-post (2.1.1)
100
- net-ssh (5.2.0)
101
- nio4r (2.3.1)
102
- nokogiri (1.10.3)
113
+ net-ssh (6.1.0)
114
+ nio4r (2.5.2)
115
+ nokogiri (1.10.10)
103
116
  mini_portile2 (~> 2.4.0)
104
- pry (0.12.2)
105
- coderay (~> 1.1.0)
106
- method_source (~> 0.9.0)
107
- public_suffix (3.1.1)
108
- rack (2.0.7)
117
+ pry (0.13.1)
118
+ coderay (~> 1.1)
119
+ method_source (~> 1.0)
120
+ public_suffix (4.0.5)
121
+ rack (2.2.3)
109
122
  rack-test (1.1.0)
110
123
  rack (>= 1.0, < 3)
111
- rails (5.2.3)
112
- actioncable (= 5.2.3)
113
- actionmailer (= 5.2.3)
114
- actionpack (= 5.2.3)
115
- actionview (= 5.2.3)
116
- activejob (= 5.2.3)
117
- activemodel (= 5.2.3)
118
- activerecord (= 5.2.3)
119
- activestorage (= 5.2.3)
120
- activesupport (= 5.2.3)
124
+ rails (6.0.3.2)
125
+ actioncable (= 6.0.3.2)
126
+ actionmailbox (= 6.0.3.2)
127
+ actionmailer (= 6.0.3.2)
128
+ actionpack (= 6.0.3.2)
129
+ actiontext (= 6.0.3.2)
130
+ actionview (= 6.0.3.2)
131
+ activejob (= 6.0.3.2)
132
+ activemodel (= 6.0.3.2)
133
+ activerecord (= 6.0.3.2)
134
+ activestorage (= 6.0.3.2)
135
+ activesupport (= 6.0.3.2)
121
136
  bundler (>= 1.3.0)
122
- railties (= 5.2.3)
137
+ railties (= 6.0.3.2)
123
138
  sprockets-rails (>= 2.0.0)
124
139
  rails-dom-testing (2.0.3)
125
140
  activesupport (>= 4.2.0)
126
141
  nokogiri (>= 1.6)
127
- rails-html-sanitizer (1.0.4)
128
- loofah (~> 2.2, >= 2.2.2)
129
- railties (5.2.3)
130
- actionpack (= 5.2.3)
131
- activesupport (= 5.2.3)
142
+ rails-html-sanitizer (1.3.0)
143
+ loofah (~> 2.3)
144
+ railties (6.0.3.2)
145
+ actionpack (= 6.0.3.2)
146
+ activesupport (= 6.0.3.2)
132
147
  method_source
133
148
  rake (>= 0.8.7)
134
- thor (>= 0.19.0, < 2.0)
135
- rake (12.3.2)
136
- rdoc (6.1.1)
137
- rspec-core (3.8.2)
138
- rspec-support (~> 3.8.0)
139
- rspec-expectations (3.8.4)
149
+ thor (>= 0.20.3, < 2.0)
150
+ rake (13.0.1)
151
+ rdoc (6.2.1)
152
+ rspec-core (3.9.2)
153
+ rspec-support (~> 3.9.3)
154
+ rspec-expectations (3.9.2)
140
155
  diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.8.0)
142
- rspec-mocks (3.8.1)
156
+ rspec-support (~> 3.9.0)
157
+ rspec-mocks (3.9.1)
143
158
  diff-lcs (>= 1.2.0, < 2.0)
144
- rspec-support (~> 3.8.0)
145
- rspec-rails (3.8.2)
146
- actionpack (>= 3.0)
147
- activesupport (>= 3.0)
148
- railties (>= 3.0)
149
- rspec-core (~> 3.8.0)
150
- rspec-expectations (~> 3.8.0)
151
- rspec-mocks (~> 3.8.0)
152
- rspec-support (~> 3.8.0)
153
- rspec-support (3.8.2)
159
+ rspec-support (~> 3.9.0)
160
+ rspec-rails (4.0.1)
161
+ actionpack (>= 4.2)
162
+ activesupport (>= 4.2)
163
+ railties (>= 4.2)
164
+ rspec-core (~> 3.9)
165
+ rspec-expectations (~> 3.9)
166
+ rspec-mocks (~> 3.9)
167
+ rspec-support (~> 3.9)
168
+ rspec-support (3.9.3)
154
169
  safe_yaml (1.0.5)
155
- sprockets (3.7.2)
170
+ sprockets (4.0.2)
156
171
  concurrent-ruby (~> 1.0)
157
172
  rack (> 1, < 3)
158
173
  sprockets-rails (3.2.1)
159
174
  actionpack (>= 4.0)
160
175
  activesupport (>= 4.0)
161
176
  sprockets (>= 3.0.0)
162
- thor (0.20.3)
177
+ thor (1.0.1)
163
178
  thread_safe (0.3.6)
164
- tzinfo (1.2.5)
179
+ tzinfo (1.2.7)
165
180
  thread_safe (~> 0.1)
166
- vcr (5.0.0)
181
+ vcr (6.0.0)
167
182
  virtus (1.0.5)
168
183
  axiom-types (~> 0.1)
169
184
  coercible (~> 1.0)
170
185
  descendants_tracker (~> 0.0, >= 0.0.3)
171
186
  equalizer (~> 0.0, >= 0.0.9)
172
- webmock (3.6.0)
187
+ webmock (3.8.3)
173
188
  addressable (>= 2.3.6)
174
189
  crack (>= 0.3.2)
175
190
  hashdiff (>= 0.4.0, < 2.0.0)
176
- websocket-driver (0.7.1)
191
+ websocket-driver (0.7.3)
177
192
  websocket-extensions (>= 0.1.0)
178
- websocket-extensions (0.1.4)
193
+ websocket-extensions (0.1.5)
194
+ zeitwerk (2.3.1)
179
195
 
180
196
  PLATFORMS
181
197
  ruby
182
198
 
183
199
  DEPENDENCIES
184
- appraisal (>= 2.2.0)
185
- bundler (>= 1.17.2)
186
- generator_spec (>= 0.9.4)
200
+ appraisal (~> 2.3)
201
+ bundler (~> 2.1, >= 2.1.4)
202
+ generator_spec (~> 0.9.4)
187
203
  proxied!
188
- pry (>= 0.12.2)
189
- rails (~> 5.2)
190
- rake (>= 12.3.2)
191
- rdoc (>= 6.1.1)
192
- rspec-core (>= 3.8)
193
- rspec-expectations (>= 3.8.2)
194
- rspec-mocks (>= 3.8)
195
- rspec-rails (>= 3.8.2)
196
- rspec-support (>= 3.8)
197
- vcr (>= 4.0)
198
- virtus (>= 1.0)
199
- webmock (>= 3.5.1)
204
+ pry (~> 0.13.1)
205
+ rails (~> 6.0, >= 6.0.3.2)
206
+ rake (~> 13.0, >= 13.0.1)
207
+ rdoc (~> 6.2, >= 6.2.1)
208
+ rspec-core (~> 3.9, >= 3.9.2)
209
+ rspec-expectations (~> 3.9, >= 3.9.2)
210
+ rspec-mocks (~> 3.9, >= 3.9.1)
211
+ rspec-rails (~> 4.0, >= 4.0.1)
212
+ rspec-support (~> 3.9, >= 3.9.3)
213
+ vcr (~> 6.0)
214
+ virtus (~> 1.0, >= 1.0.5)
215
+ webmock (~> 3.8, >= 3.8.3)
200
216
 
201
217
  BUNDLED WITH
202
- 1.17.2
218
+ 2.1.4
@@ -20,16 +20,16 @@ module ActiveRecord
20
20
  end
21
21
 
22
22
  def inject_proxied_content
23
- content = model_contents
23
+ content = model_contents
24
24
 
25
- class_path = if namespaced?
25
+ class_path = if namespaced?
26
26
  class_name.to_s.split("::")
27
27
  else
28
28
  [class_name]
29
29
  end
30
30
 
31
- indent_depth = class_path.size - 1
32
- content = content.split("\n").map { |line| " " * indent_depth + line } .join("\n") << "\n"
31
+ indent_depth = class_path.size - 1
32
+ content = content.split("\n").map { |line| " " * indent_depth + line } .join("\n") << "\n"
33
33
 
34
34
  inject_into_class(model_path, class_path.last, content) if model_exists?
35
35
  end
@@ -40,8 +40,8 @@ module ActiveRecord
40
40
  RUBY
41
41
  end
42
42
 
43
- def rails5?
44
- Rails.version.start_with? '5'
43
+ def should_version_migration?
44
+ !(Rails.version.to_s =~ /^(5|6)/i).nil?
45
45
  end
46
46
 
47
47
  def postgresql?
@@ -49,20 +49,21 @@ RUBY
49
49
  config && config['adapter'] == 'postgresql'
50
50
  end
51
51
 
52
- def migration_version
53
- if rails5?
54
- "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
55
- end
56
- end
52
+ def migration_version
53
+ if should_version_migration?
54
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
55
+ end
56
+ end
57
57
 
58
- def primary_key_type
59
- primary_key_string if rails5?
60
- end
58
+ def primary_key_type
59
+ primary_key_string if should_version_migration?
60
+ end
61
61
 
62
- def primary_key_string
63
- key_string = options[:primary_key_type]
64
- ", id: :#{key_string}" if key_string
65
- end
62
+ def primary_key_string
63
+ key_string = options[:primary_key_type]
64
+ ", id: :#{key_string}" if key_string
65
+ end
66
+
66
67
  end
67
68
  end
68
69
  end
@@ -3,18 +3,23 @@
3
3
  class ProxiedCreate<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
4
4
  def change
5
5
  create_table :<%= table_name %><%= primary_key_type %> do |t|
6
- t.string :host, null: false, index: true
7
- t.integer :port, null: false, index: true
8
- t.string :username
9
- t.string :password
6
+ t.string :host, null: false, index: true
7
+ t.string :ip_address, null: false, index: true
8
+ t.integer :port, null: false, index: true
10
9
 
11
- t.string :protocol, null: false, default: 'http', index: true
12
- t.string :proxy_type, null: false, default: 'public', index: true
13
- t.string :category
10
+ t.string :username
11
+ t.string :password
12
+ t.string :auth_mode, null: false, default: 'credentials', index: true
14
13
 
15
- t.string :country, index: true
16
- t.string :city, index: true
14
+ t.string :protocol, null: false, default: 'http', index: true
15
+ t.string :proxy_type, null: false, default: 'public', index: true
16
+ t.string :category
17
17
 
18
+ t.string :country, index: true
19
+ t.string :city, index: true
20
+
21
+ t.boolean :checkable, null: false, default: true, index: true
22
+ t.boolean :asyncable, null: false, default: true, index: true
18
23
  t.datetime :last_checked_at, index: true
19
24
 
20
25
  t.boolean :valid_proxy, null: false, default: false, index: true
@@ -22,10 +22,12 @@ module Mongoid
22
22
 
23
23
  # Fields
24
24
  field :host, type: String
25
+ field :ip_address, type: String
25
26
  field :port, type: Integer
26
27
 
27
28
  field :username, type: String
28
29
  field :password, type: String
30
+ field :auth_mode, type: String, default: :credentials
29
31
 
30
32
  field :protocol, type: String, default: :http
31
33
  field :proxy_type, type: String, default: :public
@@ -38,6 +40,9 @@ module Mongoid
38
40
  field :successful_attempts, type: Integer, default: 0
39
41
  field :failed_attempts, type: Integer, default: 0
40
42
 
43
+ field :checkable, type: Boolean, default: true
44
+ field :asyncable, type: Boolean, default: true
45
+
41
46
  field :last_checked_at, type: DateTime
42
47
 
43
48
  # Validations