Class: Putpaws::ApplicationConfig
- Inherits:
-
Struct
- Object
- Struct
- Putpaws::ApplicationConfig
- Defined in:
- lib/putpaws/application_config.rb
Instance Attribute Summary collapse
-
#build_log_group_prefix ⇒ Object
Returns the value of attribute build_log_group_prefix.
-
#build_project_name_prefix ⇒ Object
Returns the value of attribute build_project_name_prefix.
-
#build_region ⇒ Object
Returns the value of attribute build_region.
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#ecs_region ⇒ Object
Returns the value of attribute ecs_region.
-
#log_group_prefix ⇒ Object
Returns the value of attribute log_group_prefix.
-
#log_region ⇒ Object
Returns the value of attribute log_region.
-
#name ⇒ Object
Returns the value of attribute name.
-
#network ⇒ Object
Returns the value of attribute network.
-
#region ⇒ Object
Returns the value of attribute region.
-
#schedules ⇒ Object
Returns the value of attribute schedules.
-
#service ⇒ Object
Returns the value of attribute service.
-
#target ⇒ Object
Returns the value of attribute target.
-
#task_name_prefix ⇒ Object
Returns the value of attribute task_name_prefix.
Class Method Summary collapse
Instance Method Summary collapse
- #build_log_command_params ⇒ Object
- #codebuild_command_params ⇒ Object
- #ecs_command_params ⇒ Object
- #log_command_params ⇒ Object
Instance Attribute Details
#build_log_group_prefix ⇒ Object
Returns the value of attribute build_log_group_prefix
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def build_log_group_prefix @build_log_group_prefix end |
#build_project_name_prefix ⇒ Object
Returns the value of attribute build_project_name_prefix
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def build_project_name_prefix @build_project_name_prefix end |
#build_region ⇒ Object
Returns the value of attribute build_region
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def build_region @build_region end |
#cluster ⇒ Object
Returns the value of attribute cluster
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def cluster @cluster end |
#ecs_region ⇒ Object
Returns the value of attribute ecs_region
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def ecs_region @ecs_region end |
#log_group_prefix ⇒ Object
Returns the value of attribute log_group_prefix
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def log_group_prefix @log_group_prefix end |
#log_region ⇒ Object
Returns the value of attribute log_region
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def log_region @log_region end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def name @name end |
#network ⇒ Object
Returns the value of attribute network
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def network @network end |
#region ⇒ Object
Returns the value of attribute region
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def region @region end |
#schedules ⇒ Object
Returns the value of attribute schedules
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def schedules @schedules end |
#service ⇒ Object
Returns the value of attribute service
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def service @service end |
#target ⇒ Object
Returns the value of attribute target
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def target @target end |
#task_name_prefix ⇒ Object
Returns the value of attribute task_name_prefix
7 8 9 |
# File 'lib/putpaws/application_config.rb', line 7 def task_name_prefix @task_name_prefix end |
Class Method Details
.all ⇒ Object
24 25 26 27 28 29 |
# File 'lib/putpaws/application_config.rb', line 24 def self.all load.map{|k,v| data = v.slice(*self.members) new(data.merge(name: k.to_s)) } end |
.find(name) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/putpaws/application_config.rb', line 31 def self.find(name) application_data = load data = application_data[name.to_sym] return nil unless data data = data.slice(*self.members) new(data.merge({name: name.to_s})) end |
.load(path_prefix: '.putpaws') ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/putpaws/application_config.rb', line 15 def self.load(path_prefix: '.putpaws') @application_data ||= begin path = Pathname.new(path_prefix).join("application.json").to_s data = File.exist?(path) ? JSON.parse(File.read(path), symbolize_names: true).to_h : {} end end |
Instance Method Details
#build_log_command_params ⇒ Object
55 56 57 58 59 60 |
# File 'lib/putpaws/application_config.rb', line 55 def build_log_command_params { region: build_region || region, log_group_prefix: build_log_group_prefix, } end |
#codebuild_command_params ⇒ Object
76 77 78 79 80 81 |
# File 'lib/putpaws/application_config.rb', line 76 def codebuild_command_params { region: build_region || region, project_name_prefix: build_project_name_prefix, } end |
#ecs_command_params ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/putpaws/application_config.rb', line 39 def ecs_command_params { region: ecs_region || region, cluster: cluster, service: service, task_name_prefix: task_name_prefix, } end |
#log_command_params ⇒ Object
48 49 50 51 52 53 |
# File 'lib/putpaws/application_config.rb', line 48 def log_command_params { region: log_region || region, log_group_prefix: log_group_prefix, } end |