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

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, 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



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

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



250
251
252
253
254
255
# File 'lib/cli/frameworks.rb', line 250

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)


223
224
225
# File 'lib/cli/frameworks.rb', line 223

def prompt_for_runtime?
  true
end

#require_start_command?Boolean

Returns:

  • (Boolean)


219
220
221
# File 'lib/cli/frameworks.rb', line 219

def require_start_command?
  true
end

#require_url?Boolean

Returns:

  • (Boolean)


215
216
217
# File 'lib/cli/frameworks.rb', line 215

def require_url?
  false
end