emailbutler 0.8.5 → 0.8.6

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: 296cc3406157af31f3ec46810d33662b75f630ce784d1417c2e2ec911c314718
4
- data.tar.gz: f5829e5fa9b3d06f276fdc00615fa37495d507c65f9931ff9bbd682050debed1
3
+ metadata.gz: 0bd13652cc6d27528cda94c0245808f10ac00a71b903a59a85bf1b5f703d540e
4
+ data.tar.gz: d1e3a64b3b54906385f69231a2e4ecbc2eb417b06226d43954686e06dc55ccae
5
5
  SHA512:
6
- metadata.gz: e074e7b90157b378365d76efd5295246219336e41330f349e68dc8a3ad4cd3fad309d0549a653754a30110055016ccf3337bfe4b939c560f79c96c844551ed8b
7
- data.tar.gz: ce64d8fac91538107a2afb78ab84011de22c08eb08e726bc97dbb5da241e0178d2ed90ac92edfb007c72987bb0089c2c528e8b67fa529f3e740acde9dbc99e45
6
+ metadata.gz: aff55f8d47be9a08766807f4e83ada5e7ae11bb8dc8eedbf0940613222aa768c2ae2ebe6c9af6697fff543e0da256f66eb529c2cd0249981ea51a3bea5f69d36
7
+ data.tar.gz: 2e012d481612783002bf5f8800b0fbfb2ba8c5366f3867d73fa1aeb19cae687367718ef25db3aa7aad268b5d86560f55c406be64a5e0d3915b261236191375ca
@@ -16,8 +16,8 @@ module Emailbutler
16
16
  @providers = []
17
17
 
18
18
  # It's required to specify these 3 variables to enable basic auth to UI
19
- @ui_username = nil
20
- @ui_password = nil
19
+ @ui_username = ''
20
+ @ui_password = ''
21
21
  # Secured environments variable must directly contains environment names
22
22
  @ui_secured_environments = []
23
23
  end
@@ -25,9 +25,9 @@ module Emailbutler
25
25
  def validate
26
26
  validate_adapter
27
27
  validate_providers
28
+ validate_secured_environments
28
29
  validate_username
29
30
  validate_password
30
- validate_secured_environments
31
31
  end
32
32
 
33
33
  private
@@ -45,22 +45,22 @@ module Emailbutler
45
45
  raise InitializeError, 'Providers list contain invalid element'
46
46
  end
47
47
 
48
+ def validate_secured_environments
49
+ raise InitializeError, 'Environments list must be array' unless ui_secured_environments.is_a?(Array)
50
+ end
51
+
48
52
  def validate_username
49
- return if ui_username.blank?
50
- return if ui_username.is_a?(String)
53
+ return if ui_secured_environments.blank? && ui_username.is_a?(String)
54
+ return if ui_secured_environments.any? && ui_username.is_a?(String) && ui_username.present?
51
55
 
52
- raise InitializeError, 'Username must be nil or filled string'
56
+ raise InitializeError, 'Username must be string'
53
57
  end
54
58
 
55
59
  def validate_password
56
- return if ui_password.blank?
57
- return if ui_password.is_a?(String)
58
-
59
- raise InitializeError, 'Password must be nil or filled string'
60
- end
60
+ return if ui_secured_environments.blank? && ui_password.is_a?(String)
61
+ return if ui_secured_environments.any? && ui_password.is_a?(String) && ui_password.present?
61
62
 
62
- def validate_secured_environments
63
- raise InitializeError, 'Environments list must be array' unless ui_secured_environments.is_a?(Array)
63
+ raise InitializeError, 'Password must be string'
64
64
  end
65
65
  end
66
66
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emailbutler
4
- VERSION = '0.8.5'
4
+ VERSION = '0.8.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emailbutler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-container