imap-backup 9.0.0.rc1 → 9.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/development.md +10 -0
- data/lib/imap/backup/cli.rb +1 -8
- data/lib/imap/backup/migrator.rb +1 -21
- data/lib/imap/backup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3265f2db3d9cf928f1f89f0bc3ed7ef9b97f81ece419c17b2000433889a558f
|
4
|
+
data.tar.gz: '0886830e13d3ad8cf02e2ca152733d14031444a2d17eb0b43dc1121cfb822280'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b790f8f237496fc0c10d4a50293d628931020e96da738ad2588b014138efdda25ea172a976e92a1b142ed316072cd46341369206604b9e6a5a2ed5b40b5459ac
|
7
|
+
data.tar.gz: 60551fd6309b09bc4efb4f5537f5e1c1ec5c7439d17fec8c1657e7a17b31620eabe8e1e0c049de3a430d4706e4334c9954c13ce329fcc32f6c80889b7467c25f
|
data/docs/development.md
CHANGED
@@ -4,6 +4,11 @@
|
|
4
4
|
* Restartable - calculate start point based on already downloaded messages
|
5
5
|
* Standalone - do not rely on an email client or MTA
|
6
6
|
|
7
|
+
# Development
|
8
|
+
|
9
|
+
A setup for developing under any available Ruby version is
|
10
|
+
available in the container directory.
|
11
|
+
|
7
12
|
# Testing
|
8
13
|
|
9
14
|
## Feature Specs
|
@@ -56,6 +61,11 @@ uids = imap.uid_search(["ALL"]).sort
|
|
56
61
|
fetch_data_items = imap.uid_fetch(uids, ["BODY[]"])
|
57
62
|
```
|
58
63
|
|
64
|
+
# Older Ruby Versions
|
65
|
+
|
66
|
+
Dockerfiles are available for all the supported Ruby versions,
|
67
|
+
see the `docker` directory.
|
68
|
+
|
59
69
|
# Contributing
|
60
70
|
|
61
71
|
1. Fork it
|
data/lib/imap/backup/cli.rb
CHANGED
@@ -75,14 +75,7 @@ module Imap::Backup
|
|
75
75
|
When one or other account uses a delimiter other than `/` (i.e. `.`),
|
76
76
|
use the `--source-delimiter=` and/or `--destination-delimiter=` options.
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
Before migrating each folder, `imap-backup` checks if the destination
|
81
|
-
folder is empty.
|
82
|
-
|
83
|
-
If it finds a non-empty destination folder, it halts with an error.
|
84
|
-
|
85
|
-
If you are sure that these destination emails can be deleted,
|
78
|
+
If you you want to delete existing emails in destination folders,
|
86
79
|
use the `--reset` option. In this case, all existing emails are
|
87
80
|
deleted before uploading the migrated emails.
|
88
81
|
DESC
|
data/lib/imap/backup/migrator.rb
CHANGED
@@ -13,7 +13,7 @@ module Imap::Backup
|
|
13
13
|
def run
|
14
14
|
count = serializer.uids.count
|
15
15
|
folder.create
|
16
|
-
|
16
|
+
folder.clear if reset
|
17
17
|
|
18
18
|
Logger.logger.debug "[#{folder.name}] #{count} to migrate"
|
19
19
|
serializer.each_message(serializer.uids).with_index do |message, i|
|
@@ -31,25 +31,5 @@ module Imap::Backup
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def ensure_destination_empty!
|
38
|
-
if reset
|
39
|
-
folder.clear
|
40
|
-
else
|
41
|
-
fail_if_destination_not_empty!
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def fail_if_destination_not_empty!
|
46
|
-
return if folder.uids.empty?
|
47
|
-
|
48
|
-
raise <<~ERROR
|
49
|
-
The destination folder '#{folder.name}' is not empty.
|
50
|
-
Pass the --reset flag if you want to clear existing emails from destination
|
51
|
-
folders before uploading.
|
52
|
-
ERROR
|
53
|
-
end
|
54
34
|
end
|
55
35
|
end
|
data/lib/imap/backup/version.rb
CHANGED
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.0.
|
4
|
+
version: 9.0.1.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|