Class: Homesteading::Open
- Defined in:
- lib/homesteading/commands/open.rb
Constant Summary
Constants inherited from Command
Instance Method Summary collapse
Methods inherited from Command
Instance Method Details
#default ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/homesteading/commands/open.rb', line 7 def default puts puts "* Opening deployed site in browser..." app_dir = Dir[Dir.pwd + "/homesteading-router*"].first if File.exist?(app_dir + "/.git") git_url = Git.open(app_dir).remote("heroku").url unless git_url.nil? heroku_app = git_url.split(":").last.split(".").first url = "http://#{heroku_app}.herokuapp.com" end system "open #{url}" end puts end |