maildir 2.2.1 → 2.2.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
- SHA1:
3
- metadata.gz: a176f1ec0ee95f1ac07a290050324663261cba6d
4
- data.tar.gz: bb6db71c09e4ff1ed2f5631c9b7d8d317949d268
2
+ SHA256:
3
+ metadata.gz: 1d68f8c618073554bf5b567868ee99e180d09caa6e9a8b157a55c3963206eccc
4
+ data.tar.gz: 1eeb22f0bf9cd1665f5d196adbe0f0c4f728d61b615afa2bc0b910ce3c7c0d59
5
5
  SHA512:
6
- metadata.gz: 155410fc05ce7dfad4ee4791e8361d34bc2297265fcfc0f539a7858d52ed69057b45d54017bf3f7973869e2c08e35364e1dff4801613d128aa58e8e7ba0a6741
7
- data.tar.gz: bd5cf2e5896568f0d53658f680d38494292c5f4a0cc271526f0ad65f8411da32aff0134f797d4280d99a65f99b8d12b7878c46e0f30b0a43a1fe82cbcf8cfb37
6
+ metadata.gz: c78e30bebe10847627ba55b71da721eae6180d53dba1b65524650060b575350e4ece1f563579061a2803481dc0bb2db90392345e938b285f7ec61780c8ce7d68
7
+ data.tar.gz: 2cff0b191670306a19444f571827fe5511beb129eb0e6940189c003e6dfbfc38378c3152694e8c6e86965c700b48cc6da9a19158de9300b5db33351bff49e977
@@ -14,7 +14,7 @@ class Maildir
14
14
  include Comparable
15
15
 
16
16
  attr_reader :path
17
- attr_accessor :serializer
17
+ attr_writer :serializer
18
18
 
19
19
  # Default serializer.
20
20
  DEFAULT_SERIALIZER = Maildir::Serializer::Base.new.freeze
@@ -41,7 +41,7 @@ class Maildir
41
41
 
42
42
  # Returns own serializer or falls back to default.
43
43
  def serializer
44
- @serializer || @@serializer
44
+ @serializer ||= @@serializer
45
45
  end
46
46
 
47
47
  # Compare maildirs by their paths.
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/object/blank'
2
+
1
3
  class Maildir::Message
2
4
  # COLON seperates the unique name from the info
3
5
  COLON = ':'
@@ -41,7 +43,8 @@ class Maildir::Message
41
43
  def initialize(maildir, key=nil)
42
44
  @maildir = maildir
43
45
  if key.nil?
44
- @dir = :tmp
46
+ @dir = :tmp
47
+ @info = nil
45
48
  @unique_name = Maildir::UniqueName.create
46
49
  else
47
50
  parse_key(key)
@@ -2,12 +2,15 @@
2
2
  class Maildir::UniqueName
3
3
  require 'thread' # For mutex support
4
4
  require 'socket' # For getting the hostname
5
+
6
+ COUNTER_MUTEX = Mutex.new
7
+
5
8
  class << self
6
9
  # Return a thread-safe increasing counter
7
10
  def counter
8
- @counter_mutex ||= Mutex.new
9
- @counter_mutex.synchronize do
10
- @counter = @counter.to_i + 1
11
+ COUNTER_MUTEX.synchronize do
12
+ @counter ||= 0
13
+ @counter = @counter.to_i.succ
11
14
  end
12
15
  end
13
16
 
@@ -1,3 +1,3 @@
1
1
  class Maildir
2
- VERSION = '2.2.1'
2
+ VERSION = '2.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maildir
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-22 00:00:00.000000000 Z
12
+ date: 2020-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -93,7 +93,6 @@ files:
93
93
  - LICENSE
94
94
  - README.rdoc
95
95
  - Rakefile
96
- - bin/rake
97
96
  - lib/maildir.rb
98
97
  - lib/maildir/message.rb
99
98
  - lib/maildir/serializer/base.rb
@@ -128,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
127
  version: 1.3.5
129
128
  requirements: []
130
129
  rubyforge_project:
131
- rubygems_version: 2.4.5
130
+ rubygems_version: 2.7.6.2
132
131
  signing_key:
133
132
  specification_version: 4
134
133
  summary: Read & write messages in the maildir format
@@ -136,5 +135,5 @@ test_files:
136
135
  - test/helper.rb
137
136
  - test/test_maildir.rb
138
137
  - test/test_message.rb
139
- - test/test_serializers.rb
140
138
  - test/test_unique_name.rb
139
+ - test/test_serializers.rb
data/bin/rake DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rake' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rake', 'rake')