Skip to content

Commit

Permalink
Use action dispatch (#55)
Browse files Browse the repository at this point in the history
* Fix to use ActionDispatch

* Update apollo_upload_server version
  • Loading branch information
ham0215 authored Aug 4, 2022
1 parent e0ed63a commit cc6aed3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
36 changes: 33 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
PATH
remote: .
specs:
apollo_upload_server (2.1.2)
activesupport (>= 7.0.3.1)
apollo_upload_server (2.1.3)
actionpack (>= 7.0.3.1)
graphql (>= 1.8)
rack (>= 2.2.1)

GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.3.1)
actionview (= 7.0.3.1)
activesupport (= 7.0.3.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.3.1)
activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
builder (3.2.4)
concurrent-ruby (1.1.10)
crass (1.0.6)
diff-lcs (1.3)
erubi (1.11.0)
graphql (2.0.12)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mini_portile2 (2.8.0)
minitest (5.16.2)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
racc (1.6.0)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rake (13.0.1)
rspec (3.8.0)
rspec-core (~> 3.8.0)
Expand Down
3 changes: 1 addition & 2 deletions apollo_upload_server.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ['lib']

spec.add_dependency 'rack', '>= 2.2.1'
spec.add_dependency 'actionpack', '>=7.0.3.1'
spec.add_dependency 'graphql', '>= 1.8'
spec.add_dependency 'activesupport', '>= 7.0.3.1'

spec.add_development_dependency 'bundler', '~> 2.1'
spec.add_development_dependency 'rake', '~> 13.0'
Expand Down
3 changes: 1 addition & 2 deletions lib/apollo_upload_server/middleware.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'apollo_upload_server/graphql_data_builder'
require "active_support/configurable"
require 'rack'

module ApolloUploadServer
class Middleware
Expand All @@ -20,7 +19,7 @@ def call(env)
return @app.call(env)
end

request = Rack::Request.new(env)
request = ActionDispatch::Request.new(env)
params = request.params

if params['operations'].present? && params['map'].present?
Expand Down
2 changes: 1 addition & 1 deletion lib/apollo_upload_server/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ApolloUploadServer
VERSION = '2.1.2'.freeze
VERSION = '2.1.3'.freeze
end
4 changes: 2 additions & 2 deletions lib/apollo_upload_server/wrappers/uploaded_file.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

require 'delegate'
require 'rack'
require 'action_dispatch/http/upload'

module ApolloUploadServer
module Wrappers
class UploadedFile < DelegateClass(Rack::Multipart::UploadedFile)
class UploadedFile < DelegateClass(::ActionDispatch::Http::UploadedFile)
def initialize(wrapped_foo)
super
end
Expand Down
2 changes: 1 addition & 1 deletion spec/apollo_upload_server/middleware_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'rack'
require 'action_dispatch'
require 'apollo_upload_server/middleware'

describe ApolloUploadServer::Middleware do
Expand Down

0 comments on commit cc6aed3

Please sign in to comment.