net-imap 0.3.4 → 0.3.7

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: 7942e0dcda47ac417806fb03aec58b66b8bac3ccf51f53f2f7ac2c6a588e35af
4
- data.tar.gz: 38530b6af862085a9d1ff3c59c6536152acc15bb7d925d8547cd4feebea42872
3
+ metadata.gz: 30f6313663bc3f6e896e6166ad97a16296b52e59f9f2ef93f5b6ceb8a3031caa
4
+ data.tar.gz: e916c89df8b3d7bbf7c310c0299a6b7134caf71a0514091f4f87a171247750a2
5
5
  SHA512:
6
- metadata.gz: 5bd29fb28b2b3ed9b1a0589e38f8844c47e671006d50deb4462fe5e8cfd97ad923ef0af3114a094d31cbb5943ff0ac9a15e549e67ac08be68eb04a0915eae67f
7
- data.tar.gz: 7562e44288caa3538203d415f4d0b1dc4a44a77428e40c4b44046b86fb26b1abc2a4226229f4f494e54f21240cc96dea9106afded971829ec5873f507adab7c9
6
+ metadata.gz: f19ca9b2808b3d293b1a6ffef2c8b3287f1f69471c914bf775d51b3259d3dc837cee635d647c575dab70795b06b54c37214d2c51e9138a2093df5d3e20d5b478
7
+ data.tar.gz: d6c5b5c78de3f328486d4e107f1d6c336bb13be4738ad0d1b4e3b7b9b6af89f1a7bc77d09a7a27bd9f61160f38f4a5dc6c3a1ec5ae3f9f33705d6c52188e41f5
@@ -3,11 +3,18 @@ name: ubuntu
3
3
  on: [push, pull_request]
4
4
 
5
5
  jobs:
6
+ ruby-versions:
7
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
8
+ with:
9
+ engine: cruby
10
+ min_version: 2.6
11
+
6
12
  build:
13
+ needs: ruby-versions
7
14
  name: build (${{ matrix.ruby }} / ${{ matrix.os }})
8
15
  strategy:
9
16
  matrix:
10
- ruby: [ head, '3.1', '3.0', '2.7' ]
17
+ ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
11
18
  os: [ ubuntu-latest, macos-latest ]
12
19
  experimental: [false]
13
20
  include:
@@ -15,7 +15,7 @@ class Net::IMAP::DigestMD5Authenticator
15
15
  @stage = STAGE_TWO
16
16
  sparams = {}
17
17
  c = StringScanner.new(challenge)
18
- while c.scan(/(?:\s*,)?\s*(\w+)=("(?:[^\\"]+|\\.)*"|[^,]+)\s*/)
18
+ while c.scan(/(?:\s*,)?\s*(\w+)=("(?:[^\\"]|\\.)*"|[^,]+)\s*/)
19
19
  k, v = c[1], c[2]
20
20
  if v =~ /^"(.*)"$/
21
21
  v = $1
@@ -26,7 +26,7 @@ class Net::IMAP::DigestMD5Authenticator
26
26
  sparams[k] = v
27
27
  end
28
28
 
29
- raise Net::IMAP::DataFormatError, "Bad Challenge: '#{challenge}'" unless c.eos?
29
+ raise Net::IMAP::DataFormatError, "Bad Challenge: '#{challenge}'" unless c.eos? and sparams['qop']
30
30
  raise Net::IMAP::Error, "Server does not support auth (qop = #{sparams['qop'].join(',')})" unless sparams['qop'].include?("auth")
31
31
 
32
32
  response = {
@@ -7,7 +7,7 @@ class Net::IMAP::XOauth2Authenticator
7
7
 
8
8
  private
9
9
 
10
- def initialize(user, oauth2_token)
10
+ def initialize(user, oauth2_token, **_)
11
11
  @user = user
12
12
  @oauth2_token = oauth2_token
13
13
  end
@@ -54,9 +54,9 @@ module Net
54
54
  # Net::IMAP does _not_ automatically encode and decode
55
55
  # mailbox names to and from UTF-7.
56
56
  def self.decode_utf7(s)
57
- return s.gsub(/&([^-]+)?-/n) {
58
- if $1
59
- ($1.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
57
+ return s.gsub(/&([A-Za-z0-9+,]+)?-/n) {
58
+ if base64 = $1
59
+ (base64.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
60
60
  else
61
61
  "&"
62
62
  end
data/lib/net/imap.rb CHANGED
@@ -511,10 +511,8 @@ module Net
511
511
  #
512
512
  # - #greeting: The server's initial untagged response, which can indicate a
513
513
  # pre-authenticated connection.
514
- # - #responses: The untagged responses, as a hash. Keys are the untagged
515
- # response type (e.g. "OK", "FETCH", "FLAGS") and response code (e.g.
516
- # "ALERT", "UIDVALIDITY", "UIDNEXT", "TRYCREATE", etc). Values are arrays
517
- # of UntaggedResponse or ResponseCode.
514
+ # - #responses: A hash with arrays of unhandled <em>non-+nil+</em>
515
+ # UntaggedResponse and ResponseCode +#data+, keyed by +#name+.
518
516
  # - #add_response_handler: Add a block to be called inside the receiver thread
519
517
  # with every server response.
520
518
  # - #remove_response_handler: Remove a previously added response handler.
@@ -701,7 +699,7 @@ module Net
701
699
  # * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
702
700
  #
703
701
  class IMAP < Protocol
704
- VERSION = "0.3.4"
702
+ VERSION = "0.3.7"
705
703
 
706
704
  include MonitorMixin
707
705
  if defined?(OpenSSL::SSL)
@@ -712,7 +710,9 @@ module Net
712
710
  # Returns the initial greeting the server, an UntaggedResponse.
713
711
  attr_reader :greeting
714
712
 
715
- # Returns recorded untagged responses.
713
+ # Returns a hash with arrays of unhandled <em>non-+nil+</em>
714
+ # UntaggedResponse#data keyed by UntaggedResponse#name, and
715
+ # ResponseCode#data keyed by ResponseCode#name.
716
716
  #
717
717
  # For example:
718
718
  #
data/net-imap.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
27
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
- `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features)/}) }
28
+ `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features|rfcs)/}) }
29
29
  end
30
30
  spec.bindir = "exe"
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-imap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-12-23 00:00:00.000000000 Z
12
+ date: 2023-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-protocol
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.4.0.dev
133
+ rubygems_version: 3.4.10
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Ruby client api for Internet Message Access Protocol