Class: Machete::App
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #homepage_html ⇒ Object
-
#initialize(app_name, cmd = '') ⇒ App
constructor
A new instance of App.
- #push(with_db) ⇒ Object
- #url ⇒ Object
Methods included from SystemHelper
Methods included from Logger
Constructor Details
#initialize(app_name, cmd = '') ⇒ App
Returns a new instance of App.
10 11 12 13 |
# File 'lib/machete/app.rb', line 10 def initialize(app_name, cmd='') @app_name = app_name @cmd = cmd end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
8 9 10 |
# File 'lib/machete/app.rb', line 8 def app_name @app_name end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
8 9 10 |
# File 'lib/machete/app.rb', line 8 def output @output end |
Instance Method Details
#homepage_html ⇒ Object
27 28 29 |
# File 'lib/machete/app.rb', line 27 def homepage_html HTTParty.get("http://#{url}").body end |
#push(with_db) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# 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 ⇒ Object
31 32 33 |
# File 'lib/machete/app.rb', line 31 def url run_cmd("cf app #{app_name} | grep url").split(' ').last end |