Class: VMC::Cli::StandaloneFramework

Inherits:
Framework show all
Defined in:
lib/cli/frameworks.rb

Constant Summary

Constants inherited from Framework

Framework::DEFAULT_FRAMEWORK, Framework::DEFAULT_MEM, Framework::FRAMEWORKS, Framework::JAVAWEB_APPSERVERS

Instance Attribute Summary

Attributes inherited from Framework

#console, #description, #exec, #name

Instance Method Summary collapse

Methods inherited from Framework

create, detect, detect_framework_from_war, detect_framework_from_zip, detect_framework_from_zip_contents, #initialize, javaweb_appservers, known_frameworks, lookup, lookup_by_framework, #to_s

Constructor Details

This class inherits a constructor from VMC::Cli::Framework

Instance Method Details

#default_runtime(path) ⇒ Object



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/cli/frameworks.rb', line 237

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

#memory(runtime = nil) ⇒ Object



260
261
262
263
264
265
# File 'lib/cli/frameworks.rb', line 260

def memory(runtime=nil)
  default_mem = @memory
  default_mem = '128M' if runtime =~ /\Aruby/ || runtime == "php"
  default_mem = '512M' if runtime == "java" || runtime == "java7"
  default_mem
end

#prompt_for_runtime?Boolean

Returns:

  • (Boolean)


233
234
235
# File 'lib/cli/frameworks.rb', line 233

def prompt_for_runtime?
  true
end

#require_start_command?Boolean

Returns:

  • (Boolean)


229
230
231
# File 'lib/cli/frameworks.rb', line 229

def require_start_command?
  true
end

#require_url?Boolean

Returns:

  • (Boolean)


225
226
227
# File 'lib/cli/frameworks.rb', line 225

def require_url?
  false
end