Skip to content

Instantly share code, notes, and snippets.

@kuruma-gs
Created August 4, 2011 05:26
Show Gist options
  • Save kuruma-gs/1124553 to your computer and use it in GitHub Desktop.
Save kuruma-gs/1124553 to your computer and use it in GitHub Desktop.
server url constant
$RAILS = {scheme: 'http', host: 'localhost', port: '3000' }
def $RAILS.scheme; $RAILS[:scheme]; end
def $RAILS.host; $RAILS[:host]; end
def $RAILS.port; $RAILS[:port]; end
def $RAILS.authority; "#{$RAILS.host}:#{$RAILS.port}"; end
def $RAILS.uri_root; "#{$RAILS.scheme}://#{$RAILS.host}:#{$RAILS.port}"; end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment