imap-backup 9.3.0 → 9.3.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
2
  SHA256:
3
- metadata.gz: 87355fbc67849a32cdb0def02245d0101198089a15e8fcffbeadcb717413af26
4
- data.tar.gz: 55c13492ab22718193472e76a5d79ee30c3d3ee444ca1240220c687939c07339
3
+ metadata.gz: 35c15f0cf7b9909868b55bb5c9ec928cb5c22e6943a9856fbf52b1bd9fb0212b
4
+ data.tar.gz: d4cfaf196b031f91c0e745a55def95cdc480906c7b387a888949c80bc607867f
5
5
  SHA512:
6
- metadata.gz: a4583f55d69565cf81552a0ba295ba21983be0d2ad2d3a83f65e0d1c7970df6cd73ced117b625de04d858e7d71c39f386b020ce437e10fa6c9d7b734b13e3715
7
- data.tar.gz: a02472800916ad71c7f8129084bb1a2920624c0c87fc672bebb009990e21ecf1055d8d0a8d80b42481038f3694bab3ad32c4386006a108f2dd928553420c9606
6
+ metadata.gz: bca6edbdf041a3795d9f97ba1df9f63feaeee7d024df73da389990cc2a235b73a0379096261b1c515344746cb256380f79c7b2a99abdd78b2a279049b6184bbf
7
+ data.tar.gz: 966e04781677d2f281810a2160a5f56dfea17dd69c7694948cf8a36e96616685708d5c599e8bb661f7441fbdf7a0accc66fbcbb9d278bbe375c685af62e8a0b7
data/docs/development.md CHANGED
@@ -21,6 +21,12 @@ 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
+
24
30
  ```sh
25
31
  $ rake
26
32
  ```
@@ -20,8 +20,31 @@ module Imap::Backup
20
20
 
21
21
  include Helpers
22
22
 
23
+ VERSION_ARGUMENTS = %w(-v --version).freeze
24
+
23
25
  default_task :backup
24
26
 
27
+ 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
+ # By default, commands like `imap-backup help foo bar`
35
+ # are handled by listing all `foo` methods, whereas the user
36
+ # probably wants the detailed help for the `bar` method.
37
+ # Move initial "help" argument to after any subcommand,
38
+ # so we get help for the requested subcommand method.
39
+ first_argument_is_help = ARGV[0] == "help"
40
+ second_argument_is_subcommand = subcommands.include?(ARGV[1])
41
+ if first_argument_is_help && second_argument_is_subcommand
42
+ help, subcommand = ARGV.shift(2)
43
+ ARGV.unshift(subcommand, help)
44
+ end
45
+ super
46
+ end
47
+
25
48
  def self.exit_on_failure?
26
49
  true
27
50
  end
@@ -212,5 +235,10 @@ module Imap::Backup
212
235
 
213
236
  desc "utils SUBCOMMAND [OPTIONS]", "Various utilities"
214
237
  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
215
243
  end
216
244
  end
@@ -30,14 +30,20 @@ module Imap::Backup
30
30
  def initialize(path, folder)
31
31
  @path = path
32
32
  @folder = folder
33
+ @validated = nil
33
34
  end
34
35
 
35
36
  # Returns true if there are existing, valid files
36
37
  # false otherwise (in which case any existing files are deleted)
37
38
  def validate!
39
+ return if @validated
40
+
38
41
  optionally_migrate2to3
39
42
 
40
- return true if imap.valid? && mbox.valid?
43
+ if imap.valid? && mbox.valid?
44
+ @validated = true
45
+ return true
46
+ end
41
47
 
42
48
  delete
43
49
 
@@ -113,7 +119,7 @@ module Imap::Backup
113
119
  # NOOP
114
120
  nil
115
121
  else
116
- apply_new_uid_validity value
122
+ apply_new_uid_validity(value)
117
123
  end
118
124
  end
119
125
 
@@ -3,7 +3,7 @@ module Imap; end
3
3
  module Imap::Backup
4
4
  MAJOR = 9
5
5
  MINOR = 3
6
- REVISION = 0
6
+ REVISION = 2
7
7
  PRE = nil
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.0
4
+ version: 9.3.2
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-04-23 00:00:00.000000000 Z
11
+ date: 2023-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline