Class: FontProcessor::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/fontprocessor/config.rb

Class Method Summary collapse

Class Method Details

.airbrake_api_keyObject

Public: The Airbrake API key from from /etc/typekit.yml



38
39
40
# File 'lib/fontprocessor/config.rb', line 38

def airbrake_api_key
  config["airbrake_api_key"]
end

.environmentObject

Public: The environment fontprocessor is running in. One of “development”, “test”, “staging” or “production”



44
45
46
# File 'lib/fontprocessor/config.rb', line 44

def environment
  ENV['ENV'] || 'development'
end

.flex_sdk_pathObject

Public: The environment fontprocessor is running in. One of “development”, “test”, “staging” or “production”



50
51
52
# File 'lib/fontprocessor/config.rb', line 50

def flex_sdk_path
  ENV['FLEX_SDK_HOME'] or raise "Environment variable 'FLEX_SDK_HOME' is undefined but is required."
end

.loggerObject

Public: The logger to write messages to. In production and development it’s STDOUT and during testing its an in memory buffer.



60
61
62
63
64
65
66
# File 'lib/fontprocessor/config.rb', line 60

def logger
  if defined? RSpec
    StringIO.new
  else
    STDOUT
  end
end

.mongo_dbObject

Public: The mongo database name from config/environment.yml



22
23
24
# File 'lib/fontprocessor/config.rb', line 22

def mongo_db
  typekit_config['mongo_db'] || config['mongo_db']
end

.mongo_hostObject

Public: The mongo server. typekit.yml will override config/environment.yml



17
18
19
# File 'lib/fontprocessor/config.rb', line 17

def mongo_host
  typekit_config['mongo_host'] || config['mongo_host']
end

.redis_serverObject

Public: The redis server and port. typekit.yml will override config/environment.yml



11
12
13
# File 'lib/fontprocessor/config.rb', line 11

def redis_server
  typekit_config['redis_server'] || config['redis_server']
end

.s3_clientObject



54
55
56
# File 'lib/fontprocessor/config.rb', line 54

def s3_client
  @s3_client ||= Aws::S3::Client.new(region: 'us-east-1')
end

.s3_processed_bucketObject

Public: The S3 processed font file bucket from config/environment.yml



32
33
34
# File 'lib/fontprocessor/config.rb', line 32

def s3_processed_bucket
  typekit_config['s3_processed_bucket'] || config['s3_processed_bucket']
end

.s3_source_bucketObject

Public: The S3 source font file bucket from config/environment.yml



27
28
29
# File 'lib/fontprocessor/config.rb', line 27

def s3_source_bucket
  typekit_config['s3_source_bucket'] || config['s3_source_bucket']
end