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 +4 -4
- data/lib/emailbutler/configuration.rb +20 -26
- data/lib/emailbutler/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: 6d2a3373982fc294f940d204d736908d90a44adb535704038107d54eaecc3977
|
4
|
+
data.tar.gz: a63f6597ee66c69a2bfe9b615053d33ee6f0b340c0e83d988c4e8f50527fd97d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
41
|
-
raise InitializeError, 'Providers list must be array' unless
|
36
|
+
def providers=(value)
|
37
|
+
raise InitializeError, 'Providers list must be array' unless value.is_a?(Array)
|
42
38
|
|
43
|
-
|
39
|
+
if value.any? { |provider| AVAILABLE_PROVIDERS.exclude?(provider) }
|
40
|
+
raise InitializeError, 'Providers list contain invalid element'
|
41
|
+
end
|
44
42
|
|
45
|
-
|
43
|
+
@providers = value
|
46
44
|
end
|
47
45
|
|
48
|
-
def
|
49
|
-
raise InitializeError, 'Environments list must be array' unless
|
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
|
-
|
49
|
+
@ui_secured_environments = value
|
57
50
|
end
|
58
51
|
|
59
|
-
def
|
60
|
-
|
61
|
-
|
52
|
+
def ui_username=(value)
|
53
|
+
@ui_username = value if value.is_a?(String)
|
54
|
+
end
|
62
55
|
|
63
|
-
|
56
|
+
def ui_password=(value)
|
57
|
+
@ui_password = value if value.is_a?(String)
|
64
58
|
end
|
65
59
|
end
|
66
60
|
end
|
data/lib/emailbutler/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-container
|