onlyoffice_gmail_helper 0.4.0 → 0.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 810cafbad02d1812bf9d434b968b27a7e5f3fdb6d7dbcb9656e818965d510aed
|
4
|
+
data.tar.gz: 8a56b815fed84c218a7cff3b9cf91f84291ca811d2fa565133195fd22df11c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778737c42270a4866c72be3b232dbd62582d7e3aed90ec8aad0bca6033396cfa23d74a97f2de83bf490ac3c00000e3c78450b0954fccde0cdd8ff5656c4a40b8
|
7
|
+
data.tar.gz: 89c737493729135e8d1b31127cb4b59522608aadabcbc2c4547acfa2a6c24198111fa6538630ad5edb9907e5f3ecbe0303249e745c516ad5a566fc4052b121ad
|
@@ -19,12 +19,16 @@ module OnlyofficeGmailHelper
|
|
19
19
|
# Read keys from env variables
|
20
20
|
# @return [Hash]
|
21
21
|
def self.read_env_defaults
|
22
|
-
return false unless ENV
|
22
|
+
return false unless ENV.key?('GMAIL_USER') && ENV.key?('GMAIL_PASSWORD')
|
23
23
|
|
24
|
+
# rubocop:disable Style/FetchEnvVar
|
24
25
|
{ user: ENV['GMAIL_USER'], password: ENV['GMAIL_PASSWORD'] }
|
26
|
+
# rubocop:enable Style/FetchEnvVar
|
25
27
|
end
|
26
28
|
|
27
|
-
# @return [MailAccount] default account
|
28
|
-
|
29
|
+
# @return [MailAccount] default account for GMail
|
30
|
+
def self.default_account
|
31
|
+
@default_account ||= MailAccount.new(read_defaults[:user], read_defaults[:password])
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|
@@ -21,9 +21,9 @@ module OnlyofficeGmailHelper
|
|
21
21
|
# @return [String] default label
|
22
22
|
attr_accessor :label
|
23
23
|
|
24
|
-
def initialize(user =
|
25
|
-
@user = user
|
26
|
-
@password = password
|
24
|
+
def initialize(user = nil, password = nil, timeout_for_mail = 10, label = nil)
|
25
|
+
@user = user || EmailAccount.default_account.login
|
26
|
+
@password = password || EmailAccount.default_account.password
|
27
27
|
@gmail = Gmail.new(user, password)
|
28
28
|
@imap = @gmail.instance_variable_get(:@imap)
|
29
29
|
@timeout_for_mail = timeout_for_mail
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_gmail_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gmail
|
@@ -230,14 +230,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
230
|
requirements:
|
231
231
|
- - ">="
|
232
232
|
- !ruby/object:Gem::Version
|
233
|
-
version: '2.
|
233
|
+
version: '2.7'
|
234
234
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
235
|
requirements:
|
236
236
|
- - ">="
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.3.
|
240
|
+
rubygems_version: 3.3.18
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: ONLYOFFICE Helper Gem for GMail
|