emailbutler 0.8.6 → 0.8.7

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: 0bd13652cc6d27528cda94c0245808f10ac00a71b903a59a85bf1b5f703d540e
4
- data.tar.gz: d1e3a64b3b54906385f69231a2e4ecbc2eb417b06226d43954686e06dc55ccae
3
+ metadata.gz: 6d2a3373982fc294f940d204d736908d90a44adb535704038107d54eaecc3977
4
+ data.tar.gz: a63f6597ee66c69a2bfe9b615053d33ee6f0b340c0e83d988c4e8f50527fd97d
5
5
  SHA512:
6
- metadata.gz: aff55f8d47be9a08766807f4e83ada5e7ae11bb8dc8eedbf0940613222aa768c2ae2ebe6c9af6697fff543e0da256f66eb529c2cd0249981ea51a3bea5f69d36
7
- data.tar.gz: 2e012d481612783002bf5f8800b0fbfb2ba8c5366f3867d73fa1aeb19cae687367718ef25db3aa7aad268b5d86560f55c406be64a5e0d3915b261236191375ca
6
+ metadata.gz: aa25b1344a1971afc332ff9af574906f83e433b1e341f92be98c981a2d69dcb51280376cc1aec6160b81a503a4b414875b8a9b5f1b3b5a7ff375dfd8ebe3ab97
7
+ data.tar.gz: d17fed2150c3c17c2e67e718281854261959de1db36b1aa48c2ab3349dd4268c455629f39c4e1cf93df134dbe1fed4d7cd7ef7036cf5412c8f86b3e6ae0bbfef
@@ -9,7 +9,7 @@ module Emailbutler
9
9
  ].freeze
10
10
  AVAILABLE_PROVIDERS = %w[sendgrid smtp2go resend mailjet mailtrap mandrill].freeze
11
11
 
12
- attr_accessor :adapter, :providers, :ui_username, :ui_password, :ui_secured_environments
12
+ attr_reader :adapter, :providers, :ui_username, :ui_password, :ui_secured_environments
13
13
 
14
14
  def initialize
15
15
  @adapter = nil
@@ -23,44 +23,38 @@ module Emailbutler
23
23
  end
24
24
 
25
25
  def validate
26
- validate_adapter
27
- validate_providers
28
- validate_secured_environments
29
- validate_username
30
- validate_password
26
+ raise InitializeError, 'Invalid adapter' if adapter.nil?
31
27
  end
32
28
 
33
- private
29
+ def adapter=(value)
30
+ raise InitializeError, 'Adapter must be present' if value.nil?
31
+ raise InitializeError, 'Invalid adapter' if AVAILABLE_ADAPTERS.exclude?(value.class.name)
34
32
 
35
- def validate_adapter
36
- raise InitializeError, 'Adapter must be present' if adapter.nil?
37
- raise InitializeError, 'Invalid adapter' if AVAILABLE_ADAPTERS.exclude?(adapter.class.name)
33
+ @adapter = value
38
34
  end
39
35
 
40
- def validate_providers
41
- raise InitializeError, 'Providers list must be array' unless providers.is_a?(Array)
36
+ def providers=(value)
37
+ raise InitializeError, 'Providers list must be array' unless value.is_a?(Array)
42
38
 
43
- return unless providers.any? { |provider| AVAILABLE_PROVIDERS.exclude?(provider) }
39
+ if value.any? { |provider| AVAILABLE_PROVIDERS.exclude?(provider) }
40
+ raise InitializeError, 'Providers list contain invalid element'
41
+ end
44
42
 
45
- raise InitializeError, 'Providers list contain invalid element'
43
+ @providers = value
46
44
  end
47
45
 
48
- def validate_secured_environments
49
- raise InitializeError, 'Environments list must be array' unless ui_secured_environments.is_a?(Array)
50
- end
51
-
52
- def validate_username
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?
46
+ def ui_secured_environments=(value)
47
+ raise InitializeError, 'Environments list must be array' unless value.is_a?(Array)
55
48
 
56
- raise InitializeError, 'Username must be string'
49
+ @ui_secured_environments = value
57
50
  end
58
51
 
59
- def validate_password
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?
52
+ def ui_username=(value)
53
+ @ui_username = value if value.is_a?(String)
54
+ end
62
55
 
63
- raise InitializeError, 'Password must be string'
56
+ def ui_password=(value)
57
+ @ui_password = value if value.is_a?(String)
64
58
  end
65
59
  end
66
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emailbutler
4
- VERSION = '0.8.6'
4
+ VERSION = '0.8.7'
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.6
4
+ version: 0.8.7
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-10-04 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-container