Sha256: 95c5cb3b715d05bd3da497204ef37d6a2367c3dfe9f38dc07cdd7a587d515b89

Contents?: true

Size: 759 Bytes

Versions: 19

Compression:

Stored size: 759 Bytes

Contents

module Skylight
  module Formatters
    module HTTP

      def self.build_opts(method, scheme, host, port, path, query)
        category    = "api.http.#{method.downcase}"
        title       = "#{method.upcase} #{host || path}"
        description = "#{method.upcase} #{build_url(scheme, host, port, path, query)}"

        { category: category, title: title, description: description }
      end

      def self.build_url(scheme, host, port, path, query)
        url = ''
        if scheme
          url << "#{scheme}://"
        end
        if host
          url << host
        end
        if port
          url << ":#{port}"
        end
        url << path
        if query
          url << "?#{query}"
        end
        url
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
skylight-0.3.8 lib/skylight/formatters/http.rb
skylight-0.3.7 lib/skylight/formatters/http.rb
skylight-0.3.6 lib/skylight/formatters/http.rb
skylight-0.3.3 lib/skylight/formatters/http.rb
skylight-0.3.2 lib/skylight/formatters/http.rb
skylight-0.3.1 lib/skylight/formatters/http.rb
skylight-0.3.0 lib/skylight/formatters/http.rb
skylight-0.2.7 lib/skylight/formatters/http.rb
skylight-0.2.6 lib/skylight/formatters/http.rb
skylight-0.3.0.rc.6 lib/skylight/formatters/http.rb
skylight-0.2.5 lib/skylight/formatters/http.rb
skylight-0.2.4 lib/skylight/formatters/http.rb
skylight-0.3.0.rc.5 lib/skylight/formatters/http.rb
skylight-0.3.0.rc.4 lib/skylight/formatters/http.rb
skylight-0.3.0.rc.3 lib/skylight/formatters/http.rb
skylight-0.2.3 lib/skylight/formatters/http.rb
skylight-0.2.2 lib/skylight/formatters/http.rb
skylight-0.2.1 lib/skylight/formatters/http.rb
skylight-0.2.0 lib/skylight/formatters/http.rb