             url = github.to_api_url site, "/repos/#{user}/#{repo}/contents/#{segments.join '/'}", {ref}
 
       save_gist: (gist, options={}) ->
-        github_host = options.github ? github.default()
-        gh = settings.get 'sites', github_host
-        http.post github.to_api_url(gh, '/gists'), gist
+        site = github.get_site options.github
+        http.post github.to_api_url(site, '/gists'), gist
 
       to_api_url: (site, path, params={}) ->
         result = URI("#{site.api_base_url}#{path}").setQuery(params)

        else
          host = hostname

        settings.get 'sites', host

      default: -> settings.get 'default'

      get_repo_contents: (url) ->
        http.get(url)

          github.to_api_url site, "/gists/#{id}"
        gist = gist.toString()
        if gist.indexOf('http') != 0
          site = github.get_site()
          build_url site, gist
        else
          site = github.get_site_from_url gist
