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: dd7987144f401b7b528cca2ed2071b7a1591c1838270b75dd901b3253fee47c1
4
- data.tar.gz: 01470abdfea6bd393a328a561bb9859eccc46984e87220ef2378892aa920ed0d
3
+ metadata.gz: 810cafbad02d1812bf9d434b968b27a7e5f3fdb6d7dbcb9656e818965d510aed
4
+ data.tar.gz: 8a56b815fed84c218a7cff3b9cf91f84291ca811d2fa565133195fd22df11c9c
5
5
  SHA512:
6
- metadata.gz: e14c588020472c7feec2b0e657445c5a13f811eca71567834cc1fc6c706cd294bf3ed54e220b9c98abfc44a6cf1c4a7a23db423e7c68d1d9894cfcbf1451e221
7
- data.tar.gz: 84c1894dcf62d2a32a0a330fb391eb8e0767e8c4ccb15df0965c20bba30c98ea1d09056e00fbbca9b20ebdee973481181491aa26d299803ac08f258fb8bf14c8
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['GMAIL_USER'] && ENV['GMAIL_PASSWORD']
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
- GMAIL_DEFAULT = MailAccount.new(read_defaults[:user], read_defaults[:password])
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnlyofficeGmailHelper
4
- # @return [String] versio of gem
5
- VERSION = '0.4.0'
4
+ # @return [String] version of gem
5
+ VERSION = '0.5.0'
6
6
  end
@@ -21,9 +21,9 @@ module OnlyofficeGmailHelper
21
21
  # @return [String] default label
22
22
  attr_accessor :label
23
23
 
24
- def initialize(user = EmailAccount::GMAIL_DEFAULT.login, password = EmailAccount::GMAIL_DEFAULT.password, timeout_for_mail = 10, label = nil)
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.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-01-14 00:00:00.000000000 Z
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.5'
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.4
240
+ rubygems_version: 3.3.18
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: ONLYOFFICE Helper Gem for GMail