Method: VMC::Cli::StandaloneFramework#default_runtime

Defined in:
lib/cli/frameworks.rb

#default_runtime(path) ⇒ Object



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/cli/frameworks.rb', line 226

def default_runtime(path)
  if !File.directory? path
    if path =~ /\.(jar|class)$/
      return "java"
    elsif path =~ /\.(rb)$/
      return "ruby18"
    elsif path =~ /\.(zip)$/
      return detect_runtime_from_zip path
    end
  else
    Dir.chdir(path) do
      return "ruby18" if not Dir.glob('**/*.rb').empty?
      if !Dir.glob('**/*.class').empty? || !Dir.glob('**/*.jar').empty?
        return "java"
      elsif Dir.glob('*.zip').first
        zip_file = Dir.glob('*.zip').first
        return detect_runtime_from_zip zip_file
      end
    end
  end
  return nil
end