Module: GoogleSyncinator

Defined in:
lib/google_syncinator.rb

Class Method Summary collapse

Class Method Details

.initialize!Object


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/google_syncinator.rb', line 2

def self.initialize!
  env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || :development
  ENV['RACK_ENV'] ||= env.to_s

  RailsConfig.load_and_set_settings('./config/settings.yml', "./config/settings.#{env}.yml", './config/settings.local.yml')

  if defined? Raven
    Raven.configure do |config|
      config.dsn = Settings.sentry.url
    end
  end

  Sidekiq.configure_server do |config|
    config.redis = { url: Settings.redis.url, namespace: 'google-syncinator' }
  end

  Sidekiq.configure_client do |config|
    config.redis = { url: Settings.redis.url, namespace: 'google-syncinator' }
  end

  TrogdirAPIClient.configure do |config|
    config.scheme = Settings.trogdir.scheme
    config.host = Settings.trogdir.host
    config.port = Settings.trogdir.port
    config.script_name = Settings.trogdir.script_name
    config.version = Settings.trogdir.version
    config.access_id = Settings.trogdir.access_id
    config.secret_key = Settings.trogdir.secret_key
  end

  Weary::Adapter::NetHttpAdvanced.timeout = Settings.trogdir.api_timeout

  require 'active_support'
  require 'active_support/core_ext'
  require 'google/api_client'

  require './lib/email_address_options'
  require './lib/google_account'
  require './lib/log'
  require './lib/service_objects'
  require './lib/trogdir_change'
  require './lib/trogdir_person'
  require './lib/unique_email_address'
  require './lib/whitelist'
  require './lib/workers'

  true
end