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

Changes Rack::File to Rack::Files #127

Open
wants to merge 3 commits 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/serviceworker/handlers/rack_handler.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "rack/files"

module ServiceWorker
module Handlers
class RackHandler
Expand All @@ -18,7 +20,7 @@ def file_path(path_info)
end

def file_server
@file_server ||= ::Rack::File.new(@root)
@file_server ||= ::Rack::Files.new(@root)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/serviceworker/handlers/sprockets_handler.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rack/file"
require "rack/files"

module ServiceWorker
module Handlers
Expand All @@ -22,7 +22,7 @@ def sprockets_server
end

def file_server
@file_server ||= ::Rack::File.new(::Rails.public_path)
@file_server ||= ::Rack::Files.new(::Rails.public_path)
end

def config
Expand Down
4 changes: 2 additions & 2 deletions lib/serviceworker/handlers/webpacker_handler.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rack/file"
require "rack/files"
require "webpacker"

module ServiceWorker
Expand All @@ -22,7 +22,7 @@ def call(env)
private

def file_server
@file_server ||= ::Rack::File.new(::Rails.public_path)
@file_server ||= ::Rack::Files.new(::Rails.public_path)
end
end
end
Expand Down
1 change: 1 addition & 0 deletions serviceworker-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "railties", [">= 3.1"]
spec.add_dependency "rack", [">= 2.1"]

spec.add_development_dependency "appraisal", "~> 2.3.0"
spec.add_development_dependency "minitest", "~> 5.0"
Expand Down