Created
May 28, 2017 22:20
-
-
Save dillonhafer/8f24f51ab26e5dbb340eda58361f913a to your computer and use it in GitHub Desktop.
Get the development server host and port in Rails 3,4,5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 5.1 | |
require 'rails/commands/server/server_command' | |
# Rails 5.0 | |
require 'rails/commands/server' | |
def __host_and_port__ | |
options = Rails::Server::Options.new.parse!(ARGV) | |
options.values_at(:Host, :Port) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment