net-imap 0.4.20 → 0.4.21

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: b965efa83b72d27d68fe55ce65f08ffeb696e4a4fb44219e6206a4b7dea4de91
4
- data.tar.gz: 3554d7a749873b2eccec2470142315afddb4a6dd359a1d2cd6cfeacffa27d3f6
3
+ metadata.gz: ab1b84ea6eac7b0d57793127bc365c79b63eb9564386427eb66cca91cf5df294
4
+ data.tar.gz: 3040f462d83f7a364fed076a730d5a9ba0512ea52ab0368765befb0e2d700dd4
5
5
  SHA512:
6
- metadata.gz: b97c154cfe1b5ce9020029908ec017f316ef36ec36a4948d637d54990ad422580c99bdb2090c4fac4533a503a9678474753d664a101896164ee729d3abaacf37
7
- data.tar.gz: 518dc7c466a5200b5945f1b21b8e8bcb4523649a3ef5678811385613834f910f5be9a193fd80dee1a8a029882b62da61c265fd3c942a874bd5cdb43c59d5ccef
6
+ metadata.gz: a7565d3002323cdaad204bbd5eceb0b64d265e61daa41d9e3c61b8ea12ff3bbbb5f5e62298138f48a96c32553b1fcf3c6dcab7cae5776a22a521abe77b6e153c
7
+ data.tar.gz: 73b9338a55d33e703c86217ee80ee7486e92dbf67b232c152d4115a89a76c4f384c39e34888d24ec8cf389af1d67ca1d1d84e3edc676ecc501495cf6b66d7dfe
@@ -676,7 +676,7 @@ module Net
676
676
  #
677
677
  # <tt>(seqset ^ other)</tt> is equivalent to <tt>((seqset | other) -
678
678
  # (seqset & other))</tt>.
679
- def ^(other) remain_frozen (self | other).subtract(self & other) end
679
+ def ^(other) remain_frozen (dup | other).subtract(self & other) end
680
680
  alias xor :^
681
681
 
682
682
  # :call-seq:
@@ -1245,14 +1245,18 @@ module Net
1245
1245
  def slice_range(range)
1246
1246
  first = range.begin || 0
1247
1247
  last = range.end || -1
1248
- last -= 1 if range.exclude_end? && range.end && last != STAR_INT
1248
+ if range.exclude_end?
1249
+ return remain_frozen_empty if last.zero?
1250
+ last -= 1 if range.end && last != STAR_INT
1251
+ end
1249
1252
  if (first * last).positive? && last < first
1250
- SequenceSet.empty
1253
+ remain_frozen_empty
1251
1254
  elsif (min = at(first))
1252
1255
  max = at(last)
1256
+ max = :* if max.nil?
1253
1257
  if max == :* then self & (min..)
1254
1258
  elsif min <= max then self & (min..max)
1255
- else SequenceSet.empty
1259
+ else remain_frozen_empty
1256
1260
  end
1257
1261
  end
1258
1262
  end
@@ -1380,6 +1384,7 @@ module Net
1380
1384
  private
1381
1385
 
1382
1386
  def remain_frozen(set) frozen? ? set.freeze : set end
1387
+ def remain_frozen_empty; frozen? ? SequenceSet.empty : SequenceSet.new end
1383
1388
 
1384
1389
  # frozen clones are shallow copied
1385
1390
  def initialize_clone(other)
data/lib/net/imap.rb CHANGED
@@ -761,7 +761,7 @@ module Net
761
761
  # * {IMAP URLAUTH Authorization Mechanism Registry}[https://www.iana.org/assignments/urlauth-authorization-mechanism-registry/urlauth-authorization-mechanism-registry.xhtml]
762
762
  #
763
763
  class IMAP < Protocol
764
- VERSION = "0.4.20"
764
+ VERSION = "0.4.21"
765
765
 
766
766
  # Aliases for supported capabilities, to be used with the #enable command.
767
767
  ENABLE_ALIASES = {
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.4.20
4
+ version: 0.4.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda