imap-backup 9.3.2 → 9.4.0.pre1

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: 35c15f0cf7b9909868b55bb5c9ec928cb5c22e6943a9856fbf52b1bd9fb0212b
4
- data.tar.gz: d4cfaf196b031f91c0e745a55def95cdc480906c7b387a888949c80bc607867f
3
+ metadata.gz: bd7a94d72f09a4364d3fd424b2e7fabbf4885726b07f0ffbb3e28a6a08e1507f
4
+ data.tar.gz: ddc3624e1e7441422b93be0d5b651b80b4e7f78268e267573338cec557de2ae2
5
5
  SHA512:
6
- metadata.gz: bca6edbdf041a3795d9f97ba1df9f63feaeee7d024df73da389990cc2a235b73a0379096261b1c515344746cb256380f79c7b2a99abdd78b2a279049b6184bbf
7
- data.tar.gz: 966e04781677d2f281810a2160a5f56dfea17dd69c7694948cf8a36e96616685708d5c599e8bb661f7441fbdf7a0accc66fbcbb9d278bbe375c685af62e8a0b7
6
+ metadata.gz: '09734ca2ee62e60830358a0d5404d2a5d4f8b8f47b1002cf5373c41a6f4f42cbd3487c66fd7c964c193b41b5b99fa81a173ae3061d43ebcfd8ca56eaee66010d'
7
+ data.tar.gz: 1ebccf8170e1830222ba9f720be48668b067288bfe89754a98f0bc0146ed96086e8df2fb943c4ecd4f7ed7c4d75297b456a61f96225701e74d79c7aaba39529d
data/docs/development.md CHANGED
@@ -21,12 +21,6 @@ Before running the test suite, it needs to be started:
21
21
  $ docker-compose up -d
22
22
  ```
23
23
 
24
- or, with Podman
25
-
26
- ```sh
27
- $ podman-compose -f docker-compose.yml up -d
28
- ```
29
-
30
24
  ```sh
31
25
  $ rake
32
26
  ```
@@ -38,7 +38,7 @@ module Email::Mboxrd
38
38
  end
39
39
 
40
40
  def subject
41
- parsed.subject
41
+ parsed.subject&.force_encoding(Encoding::ASCII_8BIT)
42
42
  end
43
43
 
44
44
  def imap_body
@@ -62,9 +62,8 @@ module Email::Mboxrd
62
62
 
63
63
  def best_from
64
64
  return first_from if first_from
65
- return parsed.sender if parsed.sender
66
- return parsed.envelope_from if parsed.envelope_from
67
- return parsed.return_path if parsed.return_path
65
+ return sender if sender
66
+ return return_path if return_path
68
67
 
69
68
  ""
70
69
  end
@@ -72,7 +71,16 @@ module Email::Mboxrd
72
71
  def first_from
73
72
  return nil if !parsed.from.is_a?(Enumerable)
74
73
 
75
- parsed.from.find { |from| from }
74
+ first = parsed.from.compact.first
75
+ first&.force_encoding(Encoding::ASCII_8BIT)
76
+ end
77
+
78
+ def return_path
79
+ parsed.return_path&.force_encoding(Encoding::ASCII_8BIT)
80
+ end
81
+
82
+ def sender
83
+ parsed.sender&.force_encoding(Encoding::ASCII_8BIT)
76
84
  end
77
85
 
78
86
  def mboxrd_body
@@ -20,17 +20,9 @@ module Imap::Backup
20
20
 
21
21
  include Helpers
22
22
 
23
- VERSION_ARGUMENTS = %w(-v --version).freeze
24
-
25
23
  default_task :backup
26
24
 
27
25
  def self.start(*args)
28
- version_argument = ARGV & VERSION_ARGUMENTS
29
- if version_argument.any?
30
- new.version
31
- exit 0
32
- end
33
-
34
26
  # By default, commands like `imap-backup help foo bar`
35
27
  # are handled by listing all `foo` methods, whereas the user
36
28
  # probably wants the detailed help for the `bar` method.
@@ -235,10 +227,5 @@ module Imap::Backup
235
227
 
236
228
  desc "utils SUBCOMMAND [OPTIONS]", "Various utilities"
237
229
  subcommand "utils", Utils
238
-
239
- desc "version", "Print the imap-backup version"
240
- def version
241
- Kernel.puts "imap-backup #{Imap::Backup::VERSION}"
242
- end
243
230
  end
244
231
  end
@@ -30,20 +30,14 @@ module Imap::Backup
30
30
  def initialize(path, folder)
31
31
  @path = path
32
32
  @folder = folder
33
- @validated = nil
34
33
  end
35
34
 
36
35
  # Returns true if there are existing, valid files
37
36
  # false otherwise (in which case any existing files are deleted)
38
37
  def validate!
39
- return if @validated
40
-
41
38
  optionally_migrate2to3
42
39
 
43
- if imap.valid? && mbox.valid?
44
- @validated = true
45
- return true
46
- end
40
+ return true if imap.valid? && mbox.valid?
47
41
 
48
42
  delete
49
43
 
@@ -119,7 +113,7 @@ module Imap::Backup
119
113
  # NOOP
120
114
  nil
121
115
  else
122
- apply_new_uid_validity(value)
116
+ apply_new_uid_validity value
123
117
  end
124
118
  end
125
119
 
@@ -222,7 +216,7 @@ module Imap::Backup
222
216
  Logger.logger.info <<~MESSAGE
223
217
  Local metadata for folder '#{folder_path}' is currently stored in the version 2 format.
224
218
 
225
- This will now be transformed into the version 3 format.
219
+ Migrating the version 3 format...
226
220
  MESSAGE
227
221
 
228
222
  migrator.run
@@ -2,8 +2,8 @@ module Imap; end
2
2
 
3
3
  module Imap::Backup
4
4
  MAJOR = 9
5
- MINOR = 3
6
- REVISION = 2
7
- PRE = nil
5
+ MINOR = 4
6
+ REVISION = 0
7
+ PRE = "pre1"
8
8
  VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.2
4
+ version: 9.4.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-08 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -300,9 +300,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
300
300
  version: '2.6'
301
301
  required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  requirements:
303
- - - ">="
303
+ - - ">"
304
304
  - !ruby/object:Gem::Version
305
- version: '0'
305
+ version: 1.3.1
306
306
  requirements: []
307
307
  rubygems_version: 3.3.7
308
308
  signing_key: