lib/orchestration/services/mixins/configuration_base.rb in orchestration-0.4.5 vs lib/orchestration/services/mixins/configuration_base.rb in orchestration-0.4.6
- old
+ new
@@ -1,11 +1,11 @@
# frozen_string_literal: true
module Orchestration
module Services
module ConfigurationBase
- attr_reader :service_name, :env
+ attr_reader :service_name, :env, :error
def self.included(base)
base.extend(ClassMethods)
end
@@ -29,9 +29,17 @@
def host
return '127.0.0.1' if %w[test development].include?(@env.environment)
@service_name
+ end
+
+ def configured?
+ port
+ true
+ rescue KeyError => error
+ @error = error
+ false
end
def port
return @env.app_port if @service_name == 'app'