211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
# File 'lib/conan/stackato.rb', line 211
def initialize(list_json, base_name, active_urls, inactive_urls, options)
app_list = JSON.parse(list_json)
active_app_names = []
inactive_app_names = []
app_list.each do |app_hash|
if !(app_hash.has_key? 'name' and app_hash.has_key? 'uris')
raise "Stackato list json is malformed: " + list_json
end
app_name = app_hash['name']
app_uris = app_hash['uris']
if app_name.start_with? base_name
if app_uris.sort == active_urls.sort
active_app_names << app_name
elsif app_uris.sort == inactive_urls.sort
inactive_app_names << app_name
else
unless options[:stfu]
raise "Stackato app '#{app_name}' needs to be mapped exclusively to either the active or inactive set of URLs. Please reconcile before continuing."
end
end
end
end
if active_app_names.length > 1
raise "More than one app is mapped to the active URL(s). Please reconcile before continuing."
end
if inactive_app_names.length > 1
raise "More than one app is mapped to the inactive URL(s). Please reconcile before continuing."
end
@active_app_name = active_app_names.first
@inactive_app_name = inactive_app_names.first
end
|