class Machete::App

Attributes

app_name[R]
output[R]

Public Class Methods

new(app_name, cmd='') click to toggle source
# File lib/machete/app.rb, line 10
def initialize(app_name, cmd='')
  @app_name = app_name
  @cmd = cmd
end

Public Instance Methods

homepage_html() click to toggle source
# File lib/machete/app.rb, line 27
def homepage_html
  HTTParty.get("http://#{url}").body
end
push(with_db) click to toggle source
# File lib/machete/app.rb, line 15
def push(with_db)
  Dir.chdir("test_applications/#{app_name}")
  run_cmd("cf delete -f #{app_name}")
  if with_db
    run_cmd("cf push #{app_name} --no-start")
    run_cmd("cf bind-service #{app_name} lilelephant")
  end
  command = "cf push #{app_name} -b ruby-integration-test"
  command = command + " -c '#{@cmd}'" unless @cmd.empty?
  @output = run_cmd(command)
end
url() click to toggle source
# File lib/machete/app.rb, line 31
def url
  run_cmd("cf app #{app_name} | grep url").split(' ').last
end