Method: Externals::Ext#initialize

Defined in:
lib/externals/ext.rb

#initialize(options = {}) ⇒ Ext

Returns a new instance of Ext.



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/externals/ext.rb', line 311

def initialize options = {}
  super()

  @configuration = nil
  @projects = nil

  scm = configuration['.']
  scm = scm['scm'] if scm
  scm ||= options[:scm]

  type = configuration['.']
  type = type['type'] if type

  type ||= options[:type]

  if type
    install_project_type type
  else
    possible_project_types = self.class.project_types.select do |project_type|
      self.class.project_type_detector(project_type).detected?
    end

    if possible_project_types.size > 1
      raise "We found multiple project types that this could be: #{possible_project_types.join(',')}
Please use
 the --type option to tell ext which to use."
    else
      possible_project_types.each do |project_type|
        install_project_type project_type
      end
    end
  end
end