Sha256: 629db02efb79dfbe9257d89d8a3e8261845f737ed970c81326b65c5965c16496

Contents?: true

Size: 864 Bytes

Versions: 23

Compression:

Stored size: 864 Bytes

Contents

require 'sinatra/base'

module Geminabox

  class Hostess < Sinatra::Base
    def serve
      send_file(File.expand_path(File.join(Server.data, *request.path_info)), :type => response['Content-Type'])
    end

    %w[/specs.4.8.gz
       /latest_specs.4.8.gz
       /prerelease_specs.4.8.gz
    ].each do |index|
      get index do
        content_type 'application/x-gzip'
        serve
      end
    end

    %w[/quick/Marshal.4.8/*.gemspec.rz
       /yaml.Z
       /Marshal.4.8.Z
    ].each do |deflated_index|
      get deflated_index do
        content_type('application/x-deflate')
        serve
      end
    end

    %w[/yaml
       /Marshal.4.8
       /specs.4.8
       /latest_specs.4.8
       /prerelease_specs.4.8
    ].each do |old_index|
      get old_index do
        serve
      end
    end

    get "/gems/*.gem" do
      serve
    end

  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
geminabox-0.13.13 lib/geminabox/hostess.rb
geminabox-0.13.11 lib/geminabox/hostess.rb
geminabox-0.13.10 lib/geminabox/hostess.rb
geminabox-0.13.9 lib/geminabox/hostess.rb
geminabox-0.13.8 lib/geminabox/hostess.rb
geminabox-0.13.7 lib/geminabox/hostess.rb
geminabox-0.13.6 lib/geminabox/hostess.rb
geminabox-0.13.5 lib/geminabox/hostess.rb
geminabox-0.13.4 lib/geminabox/hostess.rb
geminabox-0.13.3 lib/geminabox/hostess.rb
geminabox-0.13.2 lib/geminabox/hostess.rb
geminabox-0.13.1 lib/geminabox/hostess.rb
geminabox-0.13.0 lib/geminabox/hostess.rb
r5_geminabox-0.0.1 lib/geminabox/hostess.rb
geminabox-0.12.4 lib/geminabox/hostess.rb
geminabox-0.12.3 lib/geminabox/hostess.rb
geminabox-jgraichen-0.12.2.4 lib/geminabox/hostess.rb
geminabox-jgraichen-0.12.2.3 lib/geminabox/hostess.rb
geminabox-jgraichen-0.12.2.2 lib/geminabox/hostess.rb
geminabox-jgraichen-0.12.2.1 lib/geminabox/hostess.rb