Skip to content

Commit

Permalink
Merge pull request #1160 from tdiary/support-rack-3-1
Browse files Browse the repository at this point in the history
Support Rack 3.1
  • Loading branch information
hsbt authored Jan 16, 2025
2 parents 2306401 + b32774c commit 1e36f03
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'rack', "< 3.1"
gem 'rack'
gem 'rackup'
gem 'hikidoc'
gem 'fastimage'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ GEM
power_assert (2.0.5)
public_suffix (6.0.1)
racc (1.8.1)
rack (3.0.11)
rack (3.1.8)
rack-test (2.2.0)
rack (>= 1.3)
racksh (1.0.1)
Expand Down Expand Up @@ -175,7 +175,7 @@ DEPENDENCIES
mime-types
octokit
pit
rack (< 3.1)
rack
racksh
rackup
rake
Expand Down
2 changes: 1 addition & 1 deletion lib/tdiary/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def update
private

def adopt_rack_request_to_plain_old_tdiary_style( env )
body = env["rack.input"].read
body = env["rack.input"]&.read || ""
env["rack.input"] = StringIO.new(body)
req = TDiary::Request.new( env )
req.params # fill params to tdiary_request
Expand Down
4 changes: 2 additions & 2 deletions lib/tdiary/rack/static.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'rack/file'
require 'rack/files'

module TDiary
module Rack
class Static
def initialize( app, base_dir )
@app = app
@file = base_dir.map{|dir| ::Rack::File.new(dir) }
@file = base_dir.map{|dir| ::Rack::Files.new(dir) }
end

def call( env )
Expand Down
1 change: 1 addition & 0 deletions lib/tdiary/tasks/jasmine.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
begin
require_relative "../../rack/server"
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
Expand Down

0 comments on commit 1e36f03

Please sign in to comment.