Module: Opener::Webservice::Configuration
- Defined in:
- lib/opener/webservice/configuration.rb
Overview
Module for storing global configuration settings such as whether or not to enable authentication.
Class Method Summary collapse
-
.authentication? ⇒ TrueClass|FalseClass
Returns ‘true` if authentication should be enabled.
-
.authentication_endpoint ⇒ String
Returns the authentication endpoint to use.
-
.authentication_secret ⇒ String
Returns the field name of the authentication secret.
-
.authentication_token ⇒ String
Returns the field name of the authentication token.
-
.configure_rollbar ⇒ Object
Configures Rollbar.
- .environment ⇒ String
-
.output_bucket ⇒ String
Name of the S3 bucket to store output in.
-
.rollbar? ⇒ TrueClass|FalseClass
Returns ‘true` if Rollbar error tracking should be enabled.
-
.syslog? ⇒ TrueClass|FalseClass
Returns ‘true` if Syslog should be enabled.
Class Method Details
.authentication? ⇒ TrueClass|FalseClass
Returns ‘true` if authentication should be enabled.
13 14 15 |
# File 'lib/opener/webservice/configuration.rb', line 13 def self.authentication? return !!authentication_endpoint && !authentication_endpoint.empty? end |
.authentication_endpoint ⇒ String
Returns the authentication endpoint to use.
22 23 24 |
# File 'lib/opener/webservice/configuration.rb', line 22 def self.authentication_endpoint return ENV['AUTHENTICATION_ENDPOINT'] end |
.authentication_secret ⇒ String
Returns the field name of the authentication secret.
31 32 33 |
# File 'lib/opener/webservice/configuration.rb', line 31 def self.authentication_secret return ENV['AUTHENTICATION_SECRET'] || 'secret' end |
.authentication_token ⇒ String
Returns the field name of the authentication token.
40 41 42 |
# File 'lib/opener/webservice/configuration.rb', line 40 def self.authentication_token return ENV['AUTHENTICATION_TOKEN'] || 'token' end |
.configure_rollbar ⇒ Object
Configures Rollbar.
74 75 76 77 78 79 80 |
# File 'lib/opener/webservice/configuration.rb', line 74 def self. Rollbar.configure do |config| config.access_token = ENV['ROLLBAR_TOKEN'] config.enabled = config.environment = environment end end |
.environment ⇒ String
85 86 87 |
# File 'lib/opener/webservice/configuration.rb', line 85 def self.environment return ENV['RACK_ENV'] || ENV['RAILS_ENV'] end |
.output_bucket ⇒ String
Name of the S3 bucket to store output in.
49 50 51 |
# File 'lib/opener/webservice/configuration.rb', line 49 def self.output_bucket return ENV['OUTPUT_BUCKET'] end |
.rollbar? ⇒ TrueClass|FalseClass
Returns ‘true` if Rollbar error tracking should be enabled.
67 68 69 |
# File 'lib/opener/webservice/configuration.rb', line 67 def self. return !!ENV['ROLLBAR_TOKEN'] end |
.syslog? ⇒ TrueClass|FalseClass
Returns ‘true` if Syslog should be enabled.
58 59 60 |
# File 'lib/opener/webservice/configuration.rb', line 58 def self.syslog? return !!ENV['ENABLE_SYSLOG'] && !ENV['ENABLE_SYSLOG'].empty? end |