File tree 3 files changed +7
-13
lines changed
3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,6 @@ def accessory_names
76
76
config . accessories &.collect ( &:name ) || [ ]
77
77
end
78
78
79
- def accessories_on ( host )
80
- config . accessories . select { |accessory | accessory . hosts . include? ( host . to_s ) } . map ( &:name )
81
- end
82
-
83
-
84
79
def app ( role : nil , host : nil )
85
80
Kamal ::Commands ::App . new ( config , role : role , host : host )
86
81
end
@@ -129,7 +124,6 @@ def alias(name)
129
124
config . aliases [ name ]
130
125
end
131
126
132
-
133
127
def with_verbosity ( level )
134
128
old_level = self . verbosity
135
129
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class Kamal::Configuration::Role
10
10
def initialize ( name , config :)
11
11
@name , @config = name . inquiry , config
12
12
validate! \
13
- specializations ,
13
+ role_config ,
14
14
example : validation_yml [ "servers" ] [ "workers" ] ,
15
15
context : "servers/#{ name } " ,
16
16
with : Kamal ::Configuration ::Validator ::Role
@@ -204,11 +204,11 @@ def default_labels
204
204
end
205
205
206
206
def specializations
207
- if config . raw_config . servers . is_a? ( Array ) || config . raw_config . servers [ name ] . is_a? ( Array )
208
- { }
209
- else
210
- config . raw_config . servers [ name ]
211
- end
207
+ @specializations ||= role_config . is_a? ( Array ) ? { } : role_config
208
+ end
209
+
210
+ def role_config
211
+ @role_config ||= config . raw_config . servers . is_a? ( Array ) ? { } : config . raw_config . servers [ name ]
212
212
end
213
213
214
214
def custom_labels
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ def validate!
3
3
validate_type! config , Array , Hash
4
4
5
5
if config . is_a? ( Array )
6
- validate_servers! "servers" , config
6
+ validate_servers! ( config )
7
7
else
8
8
super
9
9
end
You can’t perform that action at this time.
0 commit comments