rails_type_id 0.1.0
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 +7 -0
- data/.rubocop.yml +25 -0
- data/.ruby-version +1 -0
- data/README.md +46 -0
- data/Rakefile +16 -0
- data/lib/rails_type_id/concern.rb +129 -0
- data/lib/rails_type_id/require.rb +6 -0
- data/lib/rails_type_id/test_helper.rb +16 -0
- data/lib/rails_type_id/version.rb +6 -0
- data/lib/rails_type_id.rb +9 -0
- data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
- data/sig/rails_type_id.rbs +4 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
- data/sorbet/rbi/annotations/actionpack.rbi +430 -0
- data/sorbet/rbi/annotations/actionview.rbi +75 -0
- data/sorbet/rbi/annotations/activejob.rbi +44 -0
- data/sorbet/rbi/annotations/activemodel.rbi +89 -0
- data/sorbet/rbi/annotations/activerecord.rbi +98 -0
- data/sorbet/rbi/annotations/activesupport.rbi +468 -0
- data/sorbet/rbi/annotations/globalid.rbi +30 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/railties.rbi +61 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
- data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
- data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
- data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
- data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
- data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
- data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
- data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
- data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
- data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
- data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
- data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
- data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
- data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
- data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
- data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
- data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
- data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
- data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
- data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
- data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
- data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
- data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
- data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
- data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
- data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
- data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
- data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
- data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
- data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
- data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
- data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
- data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
- data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
- data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
- data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
- data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
- data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
- data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
- data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
- data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
- data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
- data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
- data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
- data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
- data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
- data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
- data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
- data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
- data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
- data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
- data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
- data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
- data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
- data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
- data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
- data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
- data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
- data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
- data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
- data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
- data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
- data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
- data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
- data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
- data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
- data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
- data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
- data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +13 -0
- metadata +208 -0
@@ -0,0 +1,927 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `net-pop` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem net-pop`.
|
6
|
+
|
7
|
+
|
8
|
+
# This class is equivalent to POP3, except that it uses APOP authentication.
|
9
|
+
#
|
10
|
+
# source://net-pop//lib/net/pop.rb#729
|
11
|
+
class Net::APOP < ::Net::POP3
|
12
|
+
# Always returns true.
|
13
|
+
#
|
14
|
+
# @return [Boolean]
|
15
|
+
#
|
16
|
+
# source://net-pop//lib/net/pop.rb#731
|
17
|
+
def apop?; end
|
18
|
+
end
|
19
|
+
|
20
|
+
# class aliases
|
21
|
+
#
|
22
|
+
# source://net-pop//lib/net/pop.rb#737
|
23
|
+
Net::APOPSession = Net::APOP
|
24
|
+
|
25
|
+
# class aliases
|
26
|
+
#
|
27
|
+
# source://net-pop//lib/net/pop.rb#722
|
28
|
+
Net::POP = Net::POP3
|
29
|
+
|
30
|
+
# == What is This Library?
|
31
|
+
#
|
32
|
+
# This library provides functionality for retrieving
|
33
|
+
# email via POP3, the Post Office Protocol version 3. For details
|
34
|
+
# of POP3, see [RFC1939] (http://www.ietf.org/rfc/rfc1939.txt).
|
35
|
+
#
|
36
|
+
# == Examples
|
37
|
+
#
|
38
|
+
# === Retrieving Messages
|
39
|
+
#
|
40
|
+
# This example retrieves messages from the server and deletes them
|
41
|
+
# on the server.
|
42
|
+
#
|
43
|
+
# Messages are written to files named 'inbox/1', 'inbox/2', ....
|
44
|
+
# Replace 'pop.example.com' with your POP3 server address, and
|
45
|
+
# 'YourAccount' and 'YourPassword' with the appropriate account
|
46
|
+
# details.
|
47
|
+
#
|
48
|
+
# require 'net/pop'
|
49
|
+
#
|
50
|
+
# pop = Net::POP3.new('pop.example.com')
|
51
|
+
# pop.start('YourAccount', 'YourPassword') # (1)
|
52
|
+
# if pop.mails.empty?
|
53
|
+
# puts 'No mail.'
|
54
|
+
# else
|
55
|
+
# i = 0
|
56
|
+
# pop.each_mail do |m| # or "pop.mails.each ..." # (2)
|
57
|
+
# File.open("inbox/#{i}", 'w') do |f|
|
58
|
+
# f.write m.pop
|
59
|
+
# end
|
60
|
+
# m.delete
|
61
|
+
# i += 1
|
62
|
+
# end
|
63
|
+
# puts "#{pop.mails.size} mails popped."
|
64
|
+
# end
|
65
|
+
# pop.finish # (3)
|
66
|
+
#
|
67
|
+
# 1. Call Net::POP3#start and start POP session.
|
68
|
+
# 2. Access messages by using POP3#each_mail and/or POP3#mails.
|
69
|
+
# 3. Close POP session by calling POP3#finish or use the block form of #start.
|
70
|
+
#
|
71
|
+
# === Shortened Code
|
72
|
+
#
|
73
|
+
# The example above is very verbose. You can shorten the code by using
|
74
|
+
# some utility methods. First, the block form of Net::POP3.start can
|
75
|
+
# be used instead of POP3.new, POP3#start and POP3#finish.
|
76
|
+
#
|
77
|
+
# require 'net/pop'
|
78
|
+
#
|
79
|
+
# Net::POP3.start('pop.example.com', 110,
|
80
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
81
|
+
# if pop.mails.empty?
|
82
|
+
# puts 'No mail.'
|
83
|
+
# else
|
84
|
+
# i = 0
|
85
|
+
# pop.each_mail do |m| # or "pop.mails.each ..."
|
86
|
+
# File.open("inbox/#{i}", 'w') do |f|
|
87
|
+
# f.write m.pop
|
88
|
+
# end
|
89
|
+
# m.delete
|
90
|
+
# i += 1
|
91
|
+
# end
|
92
|
+
# puts "#{pop.mails.size} mails popped."
|
93
|
+
# end
|
94
|
+
# end
|
95
|
+
#
|
96
|
+
# POP3#delete_all is an alternative for #each_mail and #delete.
|
97
|
+
#
|
98
|
+
# require 'net/pop'
|
99
|
+
#
|
100
|
+
# Net::POP3.start('pop.example.com', 110,
|
101
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
102
|
+
# if pop.mails.empty?
|
103
|
+
# puts 'No mail.'
|
104
|
+
# else
|
105
|
+
# i = 1
|
106
|
+
# pop.delete_all do |m|
|
107
|
+
# File.open("inbox/#{i}", 'w') do |f|
|
108
|
+
# f.write m.pop
|
109
|
+
# end
|
110
|
+
# i += 1
|
111
|
+
# end
|
112
|
+
# end
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# And here is an even shorter example.
|
116
|
+
#
|
117
|
+
# require 'net/pop'
|
118
|
+
#
|
119
|
+
# i = 0
|
120
|
+
# Net::POP3.delete_all('pop.example.com', 110,
|
121
|
+
# 'YourAccount', 'YourPassword') do |m|
|
122
|
+
# File.open("inbox/#{i}", 'w') do |f|
|
123
|
+
# f.write m.pop
|
124
|
+
# end
|
125
|
+
# i += 1
|
126
|
+
# end
|
127
|
+
#
|
128
|
+
# === Memory Space Issues
|
129
|
+
#
|
130
|
+
# All the examples above get each message as one big string.
|
131
|
+
# This example avoids this.
|
132
|
+
#
|
133
|
+
# require 'net/pop'
|
134
|
+
#
|
135
|
+
# i = 1
|
136
|
+
# Net::POP3.delete_all('pop.example.com', 110,
|
137
|
+
# 'YourAccount', 'YourPassword') do |m|
|
138
|
+
# File.open("inbox/#{i}", 'w') do |f|
|
139
|
+
# m.pop do |chunk| # get a message little by little.
|
140
|
+
# f.write chunk
|
141
|
+
# end
|
142
|
+
# i += 1
|
143
|
+
# end
|
144
|
+
# end
|
145
|
+
#
|
146
|
+
# === Using APOP
|
147
|
+
#
|
148
|
+
# The net/pop library supports APOP authentication.
|
149
|
+
# To use APOP, use the Net::APOP class instead of the Net::POP3 class.
|
150
|
+
# You can use the utility method, Net::POP3.APOP(). For example:
|
151
|
+
#
|
152
|
+
# require 'net/pop'
|
153
|
+
#
|
154
|
+
# # Use APOP authentication if $isapop == true
|
155
|
+
# pop = Net::POP3.APOP($isapop).new('apop.example.com', 110)
|
156
|
+
# pop.start('YourAccount', 'YourPassword') do |pop|
|
157
|
+
# # Rest of the code is the same.
|
158
|
+
# end
|
159
|
+
#
|
160
|
+
# === Fetch Only Selected Mail Using 'UIDL' POP Command
|
161
|
+
#
|
162
|
+
# If your POP server provides UIDL functionality,
|
163
|
+
# you can grab only selected mails from the POP server.
|
164
|
+
# e.g.
|
165
|
+
#
|
166
|
+
# def need_pop?( id )
|
167
|
+
# # determine if we need pop this mail...
|
168
|
+
# end
|
169
|
+
#
|
170
|
+
# Net::POP3.start('pop.example.com', 110,
|
171
|
+
# 'Your account', 'Your password') do |pop|
|
172
|
+
# pop.mails.select { |m| need_pop?(m.unique_id) }.each do |m|
|
173
|
+
# do_something(m.pop)
|
174
|
+
# end
|
175
|
+
# end
|
176
|
+
#
|
177
|
+
# The POPMail#unique_id() method returns the unique-id of the message as a
|
178
|
+
# String. Normally the unique-id is a hash of the message.
|
179
|
+
#
|
180
|
+
# source://net-pop//lib/net/pop.rb#196
|
181
|
+
class Net::POP3 < ::Net::Protocol
|
182
|
+
# Creates a new POP3 object.
|
183
|
+
#
|
184
|
+
# +address+ is the hostname or ip address of your POP3 server.
|
185
|
+
#
|
186
|
+
# The optional +port+ is the port to connect to.
|
187
|
+
#
|
188
|
+
# The optional +isapop+ specifies whether this connection is going
|
189
|
+
# to use APOP authentication; it defaults to +false+.
|
190
|
+
#
|
191
|
+
# This method does *not* open the TCP connection.
|
192
|
+
#
|
193
|
+
# @return [POP3] a new instance of POP3
|
194
|
+
#
|
195
|
+
# source://net-pop//lib/net/pop.rb#417
|
196
|
+
def initialize(addr, port = T.unsafe(nil), isapop = T.unsafe(nil)); end
|
197
|
+
|
198
|
+
# +true+ if the POP3 session has started.
|
199
|
+
#
|
200
|
+
# @return [Boolean]
|
201
|
+
#
|
202
|
+
# source://net-pop//lib/net/pop.rb#518
|
203
|
+
def active?; end
|
204
|
+
|
205
|
+
# The address to connect to.
|
206
|
+
#
|
207
|
+
# source://net-pop//lib/net/pop.rb#490
|
208
|
+
def address; end
|
209
|
+
|
210
|
+
# Does this instance use APOP authentication?
|
211
|
+
#
|
212
|
+
# @return [Boolean]
|
213
|
+
#
|
214
|
+
# source://net-pop//lib/net/pop.rb#436
|
215
|
+
def apop?; end
|
216
|
+
|
217
|
+
# Starts a pop3 session, attempts authentication, and quits.
|
218
|
+
# This method must not be called while POP3 session is opened.
|
219
|
+
# This method raises POPAuthenticationError if authentication fails.
|
220
|
+
#
|
221
|
+
# @raise [IOError]
|
222
|
+
#
|
223
|
+
# source://net-pop//lib/net/pop.rb#314
|
224
|
+
def auth_only(account, password); end
|
225
|
+
|
226
|
+
# Deletes all messages on the server.
|
227
|
+
#
|
228
|
+
# If called with a block, yields each message in turn before deleting it.
|
229
|
+
#
|
230
|
+
# === Example
|
231
|
+
#
|
232
|
+
# n = 1
|
233
|
+
# pop.delete_all do |m|
|
234
|
+
# File.open("inbox/#{n}") do |f|
|
235
|
+
# f.write m.pop
|
236
|
+
# end
|
237
|
+
# n += 1
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
# This method raises a POPError if an error occurs.
|
241
|
+
#
|
242
|
+
# source://net-pop//lib/net/pop.rb#690
|
243
|
+
def delete_all; end
|
244
|
+
|
245
|
+
# Disable SSL for all new instances.
|
246
|
+
#
|
247
|
+
# source://net-pop//lib/net/pop.rb#463
|
248
|
+
def disable_ssl; end
|
249
|
+
|
250
|
+
# Yields each message to the passed-in block in turn.
|
251
|
+
# Equivalent to:
|
252
|
+
#
|
253
|
+
# pop3.mails.each do |popmail|
|
254
|
+
# ....
|
255
|
+
# end
|
256
|
+
#
|
257
|
+
# This method raises a POPError if an error occurs.
|
258
|
+
#
|
259
|
+
# source://net-pop//lib/net/pop.rb#672
|
260
|
+
def each(&block); end
|
261
|
+
|
262
|
+
# Yields each message to the passed-in block in turn.
|
263
|
+
# Equivalent to:
|
264
|
+
#
|
265
|
+
# pop3.mails.each do |popmail|
|
266
|
+
# ....
|
267
|
+
# end
|
268
|
+
#
|
269
|
+
# This method raises a POPError if an error occurs.
|
270
|
+
#
|
271
|
+
# source://net-pop//lib/net/pop.rb#668
|
272
|
+
def each_mail(&block); end
|
273
|
+
|
274
|
+
# :call-seq:
|
275
|
+
# Net::POP#enable_ssl(params = {})
|
276
|
+
#
|
277
|
+
# Enables SSL for this instance. Must be called before the connection is
|
278
|
+
# established to have any effect.
|
279
|
+
# +params[:port]+ is port to establish the SSL connection on; Defaults to 995.
|
280
|
+
# +params+ (except :port) is passed to OpenSSL::SSLContext#set_params.
|
281
|
+
#
|
282
|
+
# source://net-pop//lib/net/pop.rb#452
|
283
|
+
def enable_ssl(verify_or_params = T.unsafe(nil), certs = T.unsafe(nil), port = T.unsafe(nil)); end
|
284
|
+
|
285
|
+
# Finishes a POP3 session and closes TCP connection.
|
286
|
+
#
|
287
|
+
# @raise [IOError]
|
288
|
+
#
|
289
|
+
# source://net-pop//lib/net/pop.rb#589
|
290
|
+
def finish; end
|
291
|
+
|
292
|
+
# Provide human-readable stringification of class state.
|
293
|
+
#
|
294
|
+
# source://net-pop//lib/net/pop.rb#468
|
295
|
+
def inspect; end
|
296
|
+
|
297
|
+
# debugging output for +msg+
|
298
|
+
#
|
299
|
+
# source://net-pop//lib/net/pop.rb#715
|
300
|
+
def logging(msg); end
|
301
|
+
|
302
|
+
# Returns an array of Net::POPMail objects, representing all the
|
303
|
+
# messages on the server. This array is renewed when the session
|
304
|
+
# restarts; otherwise, it is fetched from the server the first time
|
305
|
+
# this method is called (directly or indirectly) and cached.
|
306
|
+
#
|
307
|
+
# This method raises a POPError if an error occurs.
|
308
|
+
#
|
309
|
+
# source://net-pop//lib/net/pop.rb#646
|
310
|
+
def mails; end
|
311
|
+
|
312
|
+
# Returns the total size in bytes of all the messages on the POP server.
|
313
|
+
#
|
314
|
+
# source://net-pop//lib/net/pop.rb#634
|
315
|
+
def n_bytes; end
|
316
|
+
|
317
|
+
# Returns the number of messages on the POP server.
|
318
|
+
#
|
319
|
+
# source://net-pop//lib/net/pop.rb#627
|
320
|
+
def n_mails; end
|
321
|
+
|
322
|
+
# Seconds to wait until a connection is opened.
|
323
|
+
# If the POP3 object cannot open a connection within this time,
|
324
|
+
# it raises a Net::OpenTimeout exception. The default value is 30 seconds.
|
325
|
+
#
|
326
|
+
# source://net-pop//lib/net/pop.rb#500
|
327
|
+
def open_timeout; end
|
328
|
+
|
329
|
+
# Seconds to wait until a connection is opened.
|
330
|
+
# If the POP3 object cannot open a connection within this time,
|
331
|
+
# it raises a Net::OpenTimeout exception. The default value is 30 seconds.
|
332
|
+
#
|
333
|
+
# source://net-pop//lib/net/pop.rb#500
|
334
|
+
def open_timeout=(_arg0); end
|
335
|
+
|
336
|
+
# The port number to connect to.
|
337
|
+
#
|
338
|
+
# source://net-pop//lib/net/pop.rb#493
|
339
|
+
def port; end
|
340
|
+
|
341
|
+
# Seconds to wait until reading one block (by one read(1) call).
|
342
|
+
# If the POP3 object cannot complete a read() within this time,
|
343
|
+
# it raises a Net::ReadTimeout exception. The default value is 60 seconds.
|
344
|
+
#
|
345
|
+
# source://net-pop//lib/net/pop.rb#505
|
346
|
+
def read_timeout; end
|
347
|
+
|
348
|
+
# Set the read timeout.
|
349
|
+
#
|
350
|
+
# source://net-pop//lib/net/pop.rb#508
|
351
|
+
def read_timeout=(sec); end
|
352
|
+
|
353
|
+
# Resets the session. This clears all "deleted" marks from messages.
|
354
|
+
#
|
355
|
+
# This method raises a POPError if an error occurs.
|
356
|
+
#
|
357
|
+
# source://net-pop//lib/net/pop.rb#700
|
358
|
+
def reset; end
|
359
|
+
|
360
|
+
# source://net-pop//lib/net/pop.rb#709
|
361
|
+
def set_all_uids; end
|
362
|
+
|
363
|
+
# *WARNING*: This method causes a serious security hole.
|
364
|
+
# Use this method only for debugging.
|
365
|
+
#
|
366
|
+
# Set an output stream for debugging.
|
367
|
+
#
|
368
|
+
# === Example
|
369
|
+
#
|
370
|
+
# pop = Net::POP.new(addr, port)
|
371
|
+
# pop.set_debug_output $stderr
|
372
|
+
# pop.start(account, passwd) do |pop|
|
373
|
+
# ....
|
374
|
+
# end
|
375
|
+
#
|
376
|
+
# source://net-pop//lib/net/pop.rb#485
|
377
|
+
def set_debug_output(arg); end
|
378
|
+
|
379
|
+
# Starts a POP3 session.
|
380
|
+
#
|
381
|
+
# When called with block, gives a POP3 object to the block and
|
382
|
+
# closes the session after block call finishes.
|
383
|
+
#
|
384
|
+
# This method raises a POPAuthenticationError if authentication fails.
|
385
|
+
#
|
386
|
+
# @raise [IOError]
|
387
|
+
#
|
388
|
+
# source://net-pop//lib/net/pop.rb#526
|
389
|
+
def start(account, password); end
|
390
|
+
|
391
|
+
# +true+ if the POP3 session has started.
|
392
|
+
#
|
393
|
+
# @return [Boolean]
|
394
|
+
#
|
395
|
+
# source://net-pop//lib/net/pop.rb#514
|
396
|
+
def started?; end
|
397
|
+
|
398
|
+
# does this instance use SSL?
|
399
|
+
#
|
400
|
+
# @return [Boolean]
|
401
|
+
#
|
402
|
+
# source://net-pop//lib/net/pop.rb#441
|
403
|
+
def use_ssl?; end
|
404
|
+
|
405
|
+
private
|
406
|
+
|
407
|
+
# Returns the current command.
|
408
|
+
#
|
409
|
+
# Raises IOError if there is no active socket
|
410
|
+
#
|
411
|
+
# @raise [IOError]
|
412
|
+
#
|
413
|
+
# source://net-pop//lib/net/pop.rb#615
|
414
|
+
def command; end
|
415
|
+
|
416
|
+
# nil's out the:
|
417
|
+
# - mails
|
418
|
+
# - number counter for mails
|
419
|
+
# - number counter for bytes
|
420
|
+
# - quits the current command, if any
|
421
|
+
#
|
422
|
+
# source://net-pop//lib/net/pop.rb#599
|
423
|
+
def do_finish; end
|
424
|
+
|
425
|
+
# internal method for Net::POP3.start
|
426
|
+
#
|
427
|
+
# source://net-pop//lib/net/pop.rb#542
|
428
|
+
def do_start(account, password); end
|
429
|
+
|
430
|
+
# Does nothing
|
431
|
+
#
|
432
|
+
# source://net-pop//lib/net/pop.rb#584
|
433
|
+
def on_connect; end
|
434
|
+
|
435
|
+
class << self
|
436
|
+
# Returns the APOP class if +isapop+ is true; otherwise, returns
|
437
|
+
# the POP class. For example:
|
438
|
+
#
|
439
|
+
# # Example 1
|
440
|
+
# pop = Net::POP3::APOP($is_apop).new(addr, port)
|
441
|
+
#
|
442
|
+
# # Example 2
|
443
|
+
# Net::POP3::APOP($is_apop).start(addr, port) do |pop|
|
444
|
+
# ....
|
445
|
+
# end
|
446
|
+
#
|
447
|
+
# source://net-pop//lib/net/pop.rb#238
|
448
|
+
def APOP(isapop); end
|
449
|
+
|
450
|
+
# Opens a POP3 session, attempts authentication, and quits.
|
451
|
+
#
|
452
|
+
# This method raises POPAuthenticationError if authentication fails.
|
453
|
+
#
|
454
|
+
# === Example: normal POP3
|
455
|
+
#
|
456
|
+
# Net::POP3.auth_only('pop.example.com', 110,
|
457
|
+
# 'YourAccount', 'YourPassword')
|
458
|
+
#
|
459
|
+
# === Example: APOP
|
460
|
+
#
|
461
|
+
# Net::POP3.auth_only('pop.example.com', 110,
|
462
|
+
# 'YourAccount', 'YourPassword', true)
|
463
|
+
#
|
464
|
+
# source://net-pop//lib/net/pop.rb#305
|
465
|
+
def auth_only(address, port = T.unsafe(nil), account = T.unsafe(nil), password = T.unsafe(nil), isapop = T.unsafe(nil)); end
|
466
|
+
|
467
|
+
# returns the :ca_file or :ca_path from POP3.ssl_params
|
468
|
+
#
|
469
|
+
# source://net-pop//lib/net/pop.rb#377
|
470
|
+
def certs; end
|
471
|
+
|
472
|
+
# Constructs proper parameters from arguments
|
473
|
+
#
|
474
|
+
# source://net-pop//lib/net/pop.rb#337
|
475
|
+
def create_ssl_params(verify_or_params = T.unsafe(nil), certs = T.unsafe(nil)); end
|
476
|
+
|
477
|
+
# The default port for POP3 connections, port 110
|
478
|
+
#
|
479
|
+
# source://net-pop//lib/net/pop.rb#210
|
480
|
+
def default_pop3_port; end
|
481
|
+
|
482
|
+
# The default port for POP3S connections, port 995
|
483
|
+
#
|
484
|
+
# source://net-pop//lib/net/pop.rb#215
|
485
|
+
def default_pop3s_port; end
|
486
|
+
|
487
|
+
# returns the port for POP3
|
488
|
+
#
|
489
|
+
# source://net-pop//lib/net/pop.rb#205
|
490
|
+
def default_port; end
|
491
|
+
|
492
|
+
# Starts a POP3 session and deletes all messages on the server.
|
493
|
+
# If a block is given, each POPMail object is yielded to it before
|
494
|
+
# being deleted.
|
495
|
+
#
|
496
|
+
# This method raises a POPAuthenticationError if authentication fails.
|
497
|
+
#
|
498
|
+
# === Example
|
499
|
+
#
|
500
|
+
# Net::POP3.delete_all('pop.example.com', 110,
|
501
|
+
# 'YourAccount', 'YourPassword') do |m|
|
502
|
+
# file.write m.pop
|
503
|
+
# end
|
504
|
+
#
|
505
|
+
# source://net-pop//lib/net/pop.rb#283
|
506
|
+
def delete_all(address, port = T.unsafe(nil), account = T.unsafe(nil), password = T.unsafe(nil), isapop = T.unsafe(nil), &block); end
|
507
|
+
|
508
|
+
# Disable SSL for all new instances.
|
509
|
+
#
|
510
|
+
# source://net-pop//lib/net/pop.rb#355
|
511
|
+
def disable_ssl; end
|
512
|
+
|
513
|
+
# :call-seq:
|
514
|
+
# Net::POP.enable_ssl(params = {})
|
515
|
+
#
|
516
|
+
# Enable SSL for all new instances.
|
517
|
+
# +params+ is passed to OpenSSL::SSLContext#set_params.
|
518
|
+
#
|
519
|
+
# source://net-pop//lib/net/pop.rb#332
|
520
|
+
def enable_ssl(*args); end
|
521
|
+
|
522
|
+
# Starts a POP3 session and iterates over each POPMail object,
|
523
|
+
# yielding it to the +block+.
|
524
|
+
# This method is equivalent to:
|
525
|
+
#
|
526
|
+
# Net::POP3.start(address, port, account, password) do |pop|
|
527
|
+
# pop.each_mail do |m|
|
528
|
+
# yield m
|
529
|
+
# end
|
530
|
+
# end
|
531
|
+
#
|
532
|
+
# This method raises a POPAuthenticationError if authentication fails.
|
533
|
+
#
|
534
|
+
# === Example
|
535
|
+
#
|
536
|
+
# Net::POP3.foreach('pop.example.com', 110,
|
537
|
+
# 'YourAccount', 'YourPassword') do |m|
|
538
|
+
# file.write m.pop
|
539
|
+
# m.delete if $DELETE
|
540
|
+
# end
|
541
|
+
#
|
542
|
+
# source://net-pop//lib/net/pop.rb#262
|
543
|
+
def foreach(address, port = T.unsafe(nil), account = T.unsafe(nil), password = T.unsafe(nil), isapop = T.unsafe(nil), &block); end
|
544
|
+
|
545
|
+
# source://net-pop//lib/net/pop.rb#219
|
546
|
+
def socket_type; end
|
547
|
+
|
548
|
+
# returns the SSL Parameters
|
549
|
+
#
|
550
|
+
# see also POP3.enable_ssl
|
551
|
+
#
|
552
|
+
# source://net-pop//lib/net/pop.rb#362
|
553
|
+
def ssl_params; end
|
554
|
+
|
555
|
+
# Creates a new POP3 object and open the connection. Equivalent to
|
556
|
+
#
|
557
|
+
# Net::POP3.new(address, port, isapop).start(account, password)
|
558
|
+
#
|
559
|
+
# If +block+ is provided, yields the newly-opened POP3 object to it,
|
560
|
+
# and automatically closes it at the end of the session.
|
561
|
+
#
|
562
|
+
# === Example
|
563
|
+
#
|
564
|
+
# Net::POP3.start(addr, port, account, password) do |pop|
|
565
|
+
# pop.each_mail do |m|
|
566
|
+
# file.write m.pop
|
567
|
+
# m.delete
|
568
|
+
# end
|
569
|
+
# end
|
570
|
+
#
|
571
|
+
# source://net-pop//lib/net/pop.rb#401
|
572
|
+
def start(address, port = T.unsafe(nil), account = T.unsafe(nil), password = T.unsafe(nil), isapop = T.unsafe(nil), &block); end
|
573
|
+
|
574
|
+
# returns +true+ if POP3.ssl_params is set
|
575
|
+
#
|
576
|
+
# @return [Boolean]
|
577
|
+
#
|
578
|
+
# source://net-pop//lib/net/pop.rb#367
|
579
|
+
def use_ssl?; end
|
580
|
+
|
581
|
+
# returns whether verify_mode is enable from POP3.ssl_params
|
582
|
+
#
|
583
|
+
# source://net-pop//lib/net/pop.rb#372
|
584
|
+
def verify; end
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
# version of this library
|
589
|
+
#
|
590
|
+
# source://net-pop//lib/net/pop.rb#198
|
591
|
+
Net::POP3::VERSION = T.let(T.unsafe(nil), String)
|
592
|
+
|
593
|
+
# source://net-pop//lib/net/pop.rb#892
|
594
|
+
class Net::POP3Command
|
595
|
+
# @return [POP3Command] a new instance of POP3Command
|
596
|
+
#
|
597
|
+
# source://net-pop//lib/net/pop.rb#894
|
598
|
+
def initialize(sock); end
|
599
|
+
|
600
|
+
# @raise [POPAuthenticationError]
|
601
|
+
#
|
602
|
+
# source://net-pop//lib/net/pop.rb#914
|
603
|
+
def apop(account, password); end
|
604
|
+
|
605
|
+
# source://net-pop//lib/net/pop.rb#907
|
606
|
+
def auth(account, password); end
|
607
|
+
|
608
|
+
# source://net-pop//lib/net/pop.rb#962
|
609
|
+
def dele(num); end
|
610
|
+
|
611
|
+
# source://net-pop//lib/net/pop.rb#903
|
612
|
+
def inspect; end
|
613
|
+
|
614
|
+
# source://net-pop//lib/net/pop.rb#924
|
615
|
+
def list; end
|
616
|
+
|
617
|
+
# source://net-pop//lib/net/pop.rb#983
|
618
|
+
def quit; end
|
619
|
+
|
620
|
+
# source://net-pop//lib/net/pop.rb#955
|
621
|
+
def retr(num, &block); end
|
622
|
+
|
623
|
+
# source://net-pop//lib/net/pop.rb#944
|
624
|
+
def rset; end
|
625
|
+
|
626
|
+
# Returns the value of attribute socket.
|
627
|
+
#
|
628
|
+
# source://net-pop//lib/net/pop.rb#901
|
629
|
+
def socket; end
|
630
|
+
|
631
|
+
# source://net-pop//lib/net/pop.rb#937
|
632
|
+
def stat; end
|
633
|
+
|
634
|
+
# source://net-pop//lib/net/pop.rb#948
|
635
|
+
def top(num, lines = T.unsafe(nil), &block); end
|
636
|
+
|
637
|
+
# source://net-pop//lib/net/pop.rb#966
|
638
|
+
def uidl(num = T.unsafe(nil)); end
|
639
|
+
|
640
|
+
private
|
641
|
+
|
642
|
+
# @raise [POPError]
|
643
|
+
#
|
644
|
+
# source://net-pop//lib/net/pop.rb#1003
|
645
|
+
def check_response(res); end
|
646
|
+
|
647
|
+
# @raise [POPAuthenticationError]
|
648
|
+
#
|
649
|
+
# source://net-pop//lib/net/pop.rb#1008
|
650
|
+
def check_response_auth(res); end
|
651
|
+
|
652
|
+
# source://net-pop//lib/net/pop.rb#1013
|
653
|
+
def critical; end
|
654
|
+
|
655
|
+
# source://net-pop//lib/net/pop.rb#994
|
656
|
+
def get_response(fmt, *fargs); end
|
657
|
+
|
658
|
+
# source://net-pop//lib/net/pop.rb#989
|
659
|
+
def getok(fmt, *fargs); end
|
660
|
+
|
661
|
+
# source://net-pop//lib/net/pop.rb#999
|
662
|
+
def recv_response; end
|
663
|
+
end
|
664
|
+
|
665
|
+
# source://net-pop//lib/net/pop.rb#724
|
666
|
+
Net::POP3Session = Net::POP3
|
667
|
+
|
668
|
+
# POP3 authentication error.
|
669
|
+
#
|
670
|
+
# source://net-pop//lib/net/pop.rb#40
|
671
|
+
class Net::POPAuthenticationError < ::Net::ProtoAuthError; end
|
672
|
+
|
673
|
+
# Unexpected response from the server.
|
674
|
+
#
|
675
|
+
# source://net-pop//lib/net/pop.rb#43
|
676
|
+
class Net::POPBadResponse < ::Net::POPError; end
|
677
|
+
|
678
|
+
# Non-authentication POP3 protocol error
|
679
|
+
# (reply code "-ERR", except authentication).
|
680
|
+
#
|
681
|
+
# source://net-pop//lib/net/pop.rb#37
|
682
|
+
class Net::POPError < ::Net::ProtocolError; end
|
683
|
+
|
684
|
+
# This class represents a message which exists on the POP server.
|
685
|
+
# Instances of this class are created by the POP3 class; they should
|
686
|
+
# not be directly created by the user.
|
687
|
+
#
|
688
|
+
# source://net-pop//lib/net/pop.rb#744
|
689
|
+
class Net::POPMail
|
690
|
+
# @return [POPMail] a new instance of POPMail
|
691
|
+
#
|
692
|
+
# source://net-pop//lib/net/pop.rb#746
|
693
|
+
def initialize(num, len, pop, cmd); end
|
694
|
+
|
695
|
+
# This method fetches the message. If called with a block, the
|
696
|
+
# message is yielded to the block one chunk at a time. If called
|
697
|
+
# without a block, the message is returned as a String. The optional
|
698
|
+
# +dest+ argument will be prepended to the returned String; this
|
699
|
+
# argument is essentially obsolete.
|
700
|
+
#
|
701
|
+
# === Example without block
|
702
|
+
#
|
703
|
+
# POP3.start('pop.example.com', 110,
|
704
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
705
|
+
# n = 1
|
706
|
+
# pop.mails.each do |popmail|
|
707
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
708
|
+
# f.write popmail.pop
|
709
|
+
# end
|
710
|
+
# popmail.delete
|
711
|
+
# n += 1
|
712
|
+
# end
|
713
|
+
# end
|
714
|
+
#
|
715
|
+
# === Example with block
|
716
|
+
#
|
717
|
+
# POP3.start('pop.example.com', 110,
|
718
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
719
|
+
# n = 1
|
720
|
+
# pop.mails.each do |popmail|
|
721
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
722
|
+
# popmail.pop do |chunk| ####
|
723
|
+
# f.write chunk
|
724
|
+
# end
|
725
|
+
# end
|
726
|
+
# n += 1
|
727
|
+
# end
|
728
|
+
# end
|
729
|
+
#
|
730
|
+
# This method raises a POPError if an error occurs.
|
731
|
+
#
|
732
|
+
# source://net-pop//lib/net/pop.rb#817
|
733
|
+
def all(dest = T.unsafe(nil), &block); end
|
734
|
+
|
735
|
+
# Marks a message for deletion on the server. Deletion does not
|
736
|
+
# actually occur until the end of the session; deletion may be
|
737
|
+
# cancelled for _all_ marked messages by calling POP3#reset().
|
738
|
+
#
|
739
|
+
# This method raises a POPError if an error occurs.
|
740
|
+
#
|
741
|
+
# === Example
|
742
|
+
#
|
743
|
+
# POP3.start('pop.example.com', 110,
|
744
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
745
|
+
# n = 1
|
746
|
+
# pop.mails.each do |popmail|
|
747
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
748
|
+
# f.write popmail.pop
|
749
|
+
# end
|
750
|
+
# popmail.delete ####
|
751
|
+
# n += 1
|
752
|
+
# end
|
753
|
+
# end
|
754
|
+
#
|
755
|
+
# source://net-pop//lib/net/pop.rb#861
|
756
|
+
def delete; end
|
757
|
+
|
758
|
+
# Marks a message for deletion on the server. Deletion does not
|
759
|
+
# actually occur until the end of the session; deletion may be
|
760
|
+
# cancelled for _all_ marked messages by calling POP3#reset().
|
761
|
+
#
|
762
|
+
# This method raises a POPError if an error occurs.
|
763
|
+
#
|
764
|
+
# === Example
|
765
|
+
#
|
766
|
+
# POP3.start('pop.example.com', 110,
|
767
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
768
|
+
# n = 1
|
769
|
+
# pop.mails.each do |popmail|
|
770
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
771
|
+
# f.write popmail.pop
|
772
|
+
# end
|
773
|
+
# popmail.delete ####
|
774
|
+
# n += 1
|
775
|
+
# end
|
776
|
+
# end
|
777
|
+
#
|
778
|
+
# source://net-pop//lib/net/pop.rb#866
|
779
|
+
def delete!; end
|
780
|
+
|
781
|
+
# True if the mail has been deleted.
|
782
|
+
#
|
783
|
+
# @return [Boolean]
|
784
|
+
#
|
785
|
+
# source://net-pop//lib/net/pop.rb#869
|
786
|
+
def deleted?; end
|
787
|
+
|
788
|
+
# Fetches the message header.
|
789
|
+
#
|
790
|
+
# The optional +dest+ argument is obsolete.
|
791
|
+
#
|
792
|
+
# This method raises a POPError if an error occurs.
|
793
|
+
#
|
794
|
+
# source://net-pop//lib/net/pop.rb#837
|
795
|
+
def header(dest = T.unsafe(nil)); end
|
796
|
+
|
797
|
+
# Provide human-readable stringification of class state.
|
798
|
+
#
|
799
|
+
# source://net-pop//lib/net/pop.rb#763
|
800
|
+
def inspect; end
|
801
|
+
|
802
|
+
# The length of the message in octets.
|
803
|
+
#
|
804
|
+
# source://net-pop//lib/net/pop.rb#759
|
805
|
+
def length; end
|
806
|
+
|
807
|
+
# This method fetches the message. If called with a block, the
|
808
|
+
# message is yielded to the block one chunk at a time. If called
|
809
|
+
# without a block, the message is returned as a String. The optional
|
810
|
+
# +dest+ argument will be prepended to the returned String; this
|
811
|
+
# argument is essentially obsolete.
|
812
|
+
#
|
813
|
+
# === Example without block
|
814
|
+
#
|
815
|
+
# POP3.start('pop.example.com', 110,
|
816
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
817
|
+
# n = 1
|
818
|
+
# pop.mails.each do |popmail|
|
819
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
820
|
+
# f.write popmail.pop
|
821
|
+
# end
|
822
|
+
# popmail.delete
|
823
|
+
# n += 1
|
824
|
+
# end
|
825
|
+
# end
|
826
|
+
#
|
827
|
+
# === Example with block
|
828
|
+
#
|
829
|
+
# POP3.start('pop.example.com', 110,
|
830
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
831
|
+
# n = 1
|
832
|
+
# pop.mails.each do |popmail|
|
833
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
834
|
+
# popmail.pop do |chunk| ####
|
835
|
+
# f.write chunk
|
836
|
+
# end
|
837
|
+
# end
|
838
|
+
# n += 1
|
839
|
+
# end
|
840
|
+
# end
|
841
|
+
#
|
842
|
+
# This method raises a POPError if an error occurs.
|
843
|
+
#
|
844
|
+
# source://net-pop//lib/net/pop.rb#818
|
845
|
+
def mail(dest = T.unsafe(nil), &block); end
|
846
|
+
|
847
|
+
# The sequence number of the message on the server.
|
848
|
+
#
|
849
|
+
# source://net-pop//lib/net/pop.rb#756
|
850
|
+
def number; end
|
851
|
+
|
852
|
+
# This method fetches the message. If called with a block, the
|
853
|
+
# message is yielded to the block one chunk at a time. If called
|
854
|
+
# without a block, the message is returned as a String. The optional
|
855
|
+
# +dest+ argument will be prepended to the returned String; this
|
856
|
+
# argument is essentially obsolete.
|
857
|
+
#
|
858
|
+
# === Example without block
|
859
|
+
#
|
860
|
+
# POP3.start('pop.example.com', 110,
|
861
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
862
|
+
# n = 1
|
863
|
+
# pop.mails.each do |popmail|
|
864
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
865
|
+
# f.write popmail.pop
|
866
|
+
# end
|
867
|
+
# popmail.delete
|
868
|
+
# n += 1
|
869
|
+
# end
|
870
|
+
# end
|
871
|
+
#
|
872
|
+
# === Example with block
|
873
|
+
#
|
874
|
+
# POP3.start('pop.example.com', 110,
|
875
|
+
# 'YourAccount', 'YourPassword') do |pop|
|
876
|
+
# n = 1
|
877
|
+
# pop.mails.each do |popmail|
|
878
|
+
# File.open("inbox/#{n}", 'w') do |f|
|
879
|
+
# popmail.pop do |chunk| ####
|
880
|
+
# f.write chunk
|
881
|
+
# end
|
882
|
+
# end
|
883
|
+
# n += 1
|
884
|
+
# end
|
885
|
+
# end
|
886
|
+
#
|
887
|
+
# This method raises a POPError if an error occurs.
|
888
|
+
#
|
889
|
+
# source://net-pop//lib/net/pop.rb#805
|
890
|
+
def pop(dest = T.unsafe(nil), &block); end
|
891
|
+
|
892
|
+
# The length of the message in octets.
|
893
|
+
#
|
894
|
+
# source://net-pop//lib/net/pop.rb#760
|
895
|
+
def size; end
|
896
|
+
|
897
|
+
# Fetches the message header and +lines+ lines of body.
|
898
|
+
#
|
899
|
+
# The optional +dest+ argument is obsolete.
|
900
|
+
#
|
901
|
+
# This method raises a POPError if an error occurs.
|
902
|
+
#
|
903
|
+
# source://net-pop//lib/net/pop.rb#825
|
904
|
+
def top(lines, dest = T.unsafe(nil)); end
|
905
|
+
|
906
|
+
# source://net-pop//lib/net/pop.rb#885
|
907
|
+
def uid=(uid); end
|
908
|
+
|
909
|
+
# Returns the unique-id of the message.
|
910
|
+
# Normally the unique-id is a hash string of the message.
|
911
|
+
#
|
912
|
+
# This method raises a POPError if an error occurs.
|
913
|
+
#
|
914
|
+
# source://net-pop//lib/net/pop.rb#883
|
915
|
+
def uidl; end
|
916
|
+
|
917
|
+
# Returns the unique-id of the message.
|
918
|
+
# Normally the unique-id is a hash string of the message.
|
919
|
+
#
|
920
|
+
# This method raises a POPError if an error occurs.
|
921
|
+
#
|
922
|
+
# source://net-pop//lib/net/pop.rb#877
|
923
|
+
def unique_id; end
|
924
|
+
end
|
925
|
+
|
926
|
+
# source://net-pop//lib/net/pop.rb#723
|
927
|
+
Net::POPSession = Net::POP3
|