Class: FaaStRuby::ProjectConfig
- Inherits:
-
Object
- Object
- FaaStRuby::ProjectConfig
- Defined in:
- lib/faastruby/server/project_config.rb
Class Method Summary collapse
- .catch_all ⇒ Object
- .deploy_environment_secrets ⇒ Object
- .functions_dir(absolute: true) ⇒ Object
- .project_config ⇒ Object
- .public_dir(absolute: true) ⇒ Object
- .public_dir? ⇒ Boolean
- .root_to ⇒ Object
- .secrets ⇒ Object
- .secrets_for_function(function_name) ⇒ Object
Class Method Details
.catch_all ⇒ Object
28 29 30 |
# File 'lib/faastruby/server/project_config.rb', line 28 def self.catch_all project_config['catch_all'] || 'catch-all' end |
.deploy_environment_secrets ⇒ Object
36 37 38 |
# File 'lib/faastruby/server/project_config.rb', line 36 def self.deploy_environment_secrets secrets[DEPLOY_ENVIRONMENT] || {} end |
.functions_dir(absolute: true) ⇒ Object
14 15 16 17 18 |
# File 'lib/faastruby/server/project_config.rb', line 14 def self.functions_dir(absolute: true) path = "#{SERVER_ROOT}/#{project_config['functions_dir'] || 'functions'}" if absolute path ||= project_config['functions_dir'] || 'functions' path.gsub(/\/$/, '') end |
.project_config ⇒ Object
20 21 22 |
# File 'lib/faastruby/server/project_config.rb', line 20 def self.project_config YAML.load(File.read(PROJECT_YAML_FILE))['project'] end |
.public_dir(absolute: true) ⇒ Object
4 5 6 7 8 |
# File 'lib/faastruby/server/project_config.rb', line 4 def self.public_dir(absolute: true) path = "#{SERVER_ROOT}/#{project_config['public_dir'] || 'public'}" if absolute path ||= project_config['public_dir'] || 'public' path.gsub(/\/$/, '') end |
.public_dir? ⇒ Boolean
10 11 12 |
# File 'lib/faastruby/server/project_config.rb', line 10 def self.public_dir? File.directory? "#{SERVER_ROOT}/#{project_config['public_dir'] || 'public'}" end |
.root_to ⇒ Object
24 25 26 |
# File 'lib/faastruby/server/project_config.rb', line 24 def self.root_to project_config['root_to'] || 'root' end |
.secrets ⇒ Object
32 33 34 |
# File 'lib/faastruby/server/project_config.rb', line 32 def self.secrets YAML.load(File.read(SECRETS_FILE))['secrets'] || {} end |
.secrets_for_function(function_name) ⇒ Object
40 41 42 |
# File 'lib/faastruby/server/project_config.rb', line 40 def self.secrets_for_function(function_name) deploy_environment_secrets[function_name] || {} end |