Parent

Methods

IcalIcsServlet

Public Instance Methods

do_GET(req, resp) click to toggle source
# File lib/vpim/agent/scraps.rb, line 151
  def do_GET(req, resp)
    body = ''
#   body << @options.inspect

    folder, include, exclude = *@options

    path = req.path_info

#   body << "\n"
#   body << "path=#{path.inspect}\n"

    all = Dir.entries(folder).select do |f| f =~ /\.ics$/ end

    if include
      all.reject! do |f| !(f =~ include) end
    end
    if exclude
      all.reject! do |f| f =~ exclude end
    end

#   body << "#{all.inspect}\n"

    if(path == '')
      body << "<ul>\n"
      all.each do |f|
        n = f.sub('.ics', '')
        body << "<li><a href=\"webcal://#{$host}:#{$port}/calfile/#{f}\">#{n}</a>\n"
      end
      body << "</ul>\n"
    end

    resp.body = body
    resp['content-type'] = 'text/html'
    raise WEBrick::HTTPStatus::OK
  end

[Validate]

Generated with the Darkfish Rdoc Generator 2.