Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependency on webrick #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* remove dependency on Webrick

=== v1.1.2
* tests pass on Ruby 3
* do not assume lock owner has a href child, preserve any owner value as-is
Expand Down
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ gem 'puma'
gem 'minitest'
gem 'byebug', platforms: :mri
gem 'ruby-prof'

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
# necessary for the file resource.
gem 'webrick'
end
5 changes: 2 additions & 3 deletions lib/dav4rack/resources/file_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# frozen_string_literal: true

require 'pstore'
require 'webrick/httputils'
require 'dav4rack/file_resource_lock'
require 'dav4rack/security_utils'
require 'rack/mime'

module DAV4Rack

class FileResource < Resource

include WEBrick::HTTPUtils
include DAV4Rack::Utils

# If this is a collection, return the child resources.
Expand Down Expand Up @@ -55,7 +54,7 @@ def content_type
if stat.directory?
"text/html"
else
mime_type(file_path, DefaultMimeTypes)
::Rack::Mime.mime_type(File.extname(file_path))
end
end

Expand Down