imap-backup 14.6.0 → 14.6.1

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: 80b99aa3b4c713e6a88c9dbe504186fd64065a1d03d50d2d47a79de6ab14902f
4
- data.tar.gz: c7a7d6f52b36819de9f660c488a8b4dfcf75794affa56547e197aab79c56cf7b
3
+ metadata.gz: cf35a029c76b09db247f5d45e6624fe6d0d1f1453ee29edd1e02e6621eb42710
4
+ data.tar.gz: 2238c658e5306848de14ff2edffbf1275576ff1b27c0aa04c642a7c2de9d7fba
5
5
  SHA512:
6
- metadata.gz: 75e98d37c675dab0d44fe98f2689f3dd36cf30eb2968f3c6260268e733122fccf212b0e91024b4031bc2b8243011e240a8370c03681dca4b21e8a155262292f5
7
- data.tar.gz: 46ca660ed4f2f87a3285db448b6e77e052df7628e512c57d7600876abca390b5e872529c76ef1f01b4ae35035d08a4941e24dd298d3db5850f44968ccbda25c2
6
+ metadata.gz: d066629d29da0114e76d95b137caa7ba4ac26d91bda560a8a2fced551ad88f22477a67a0cfc9130365dafe7a4a60928b2ebedbc301ab6371d4aeade2de6131ab
7
+ data.tar.gz: 75ac7182884ca791e30a7058940b40c4940f4ad515677f081de8f29e7c9da72061d3ee6eee9fce02efc734803f31ab2f2a66ae25356d284ce38f66d3af2ee8eb
@@ -59,6 +59,7 @@ module Imap::Backup
59
59
  attr_reader :reset_seen_flags_after_fetch
60
60
 
61
61
  def initialize(options)
62
+ check_options!(options)
62
63
  @username = options[:username]
63
64
  @password = options[:password]
64
65
  @local_path = options[:local_path]
@@ -97,14 +98,6 @@ module Imap::Backup
97
98
  client.capability
98
99
  end
99
100
 
100
- # Indicates whether the account has been configured, and is ready
101
- # to be used
102
- #
103
- # @return [Boolean]
104
- def valid?
105
- username && password ? true : false
106
- end
107
-
108
101
  def modified?
109
102
  changes.any?
110
103
  end
@@ -245,6 +238,23 @@ module Imap::Backup
245
238
 
246
239
  attr_reader :changes
247
240
 
241
+ REQUIRED_ATTRIBUTES = %i[password username].freeze
242
+ OPTIONAL_ATTRIBUTES = %i[
243
+ connection_options download_strategy folders folder_blacklist local_path mirror_mode
244
+ multi_fetch_size reset_seen_flags_after_fetch server
245
+ ].freeze
246
+ KNOWN_ATTRIBUTES = REQUIRED_ATTRIBUTES + OPTIONAL_ATTRIBUTES
247
+
248
+ def check_options!(options)
249
+ missing_required = REQUIRED_ATTRIBUTES - options.keys
250
+ if missing_required.any?
251
+ raise ArgumentError, "Missing required options: #{missing_required.join(', ')}"
252
+ end
253
+
254
+ unknown = options.keys - KNOWN_ATTRIBUTES
255
+ raise ArgumentError, "Unknown options: #{unknown.join(', ')}" if unknown.any?
256
+ end
257
+
248
258
  def update(field, value)
249
259
  key = :"@#{field}"
250
260
  if changes[field]
@@ -28,7 +28,7 @@ module Imap::Backup
28
28
  download_strategy: download_strategy,
29
29
  folder_blacklist: folder_blacklist,
30
30
  local_path: local_path,
31
- mirror: mirror,
31
+ mirror_mode: mirror,
32
32
  reset_seen_flags_after_fetch: reset_seen_flags_after_fetch
33
33
  )
34
34
  account.connection_options = connection_options if connection_options
@@ -6,7 +6,7 @@ module Imap::Backup
6
6
  # @private
7
7
  MINOR = 6
8
8
  # @private
9
- REVISION = 0
9
+ REVISION = 1
10
10
  # @private
11
11
  PRE = nil
12
12
  # The application version
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: 14.6.0
4
+ version: 14.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
11
+ date: 2024-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -218,7 +218,7 @@ licenses:
218
218
  - MIT
219
219
  metadata:
220
220
  rubygems_mfa_required: 'true'
221
- post_install_message:
221
+ post_install_message:
222
222
  rdoc_options: []
223
223
  require_paths:
224
224
  - lib
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubygems_version: 3.5.3
237
- signing_key:
237
+ signing_key:
238
238
  specification_version: 4
239
239
  summary: Backup GMail (or other IMAP) accounts to disk
240
240
  test_files: []