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



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

#memory(runtime = nil) ⇒ Object



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

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)


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

def prompt_for_runtime?
  true
end

#require_start_command?Boolean

Returns:

  • (Boolean)


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

def require_start_command?
  true
end

#require_url?Boolean

Returns:

  • (Boolean)


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

def require_url?
  false
end