We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 85a5171 + 3f95c2c commit 0d48376Copy full SHA for 0d48376
.github/workflows/ruby.yml
@@ -14,7 +14,7 @@ jobs:
14
matrix:
15
ruby-version: ['3.0', '3.1', '3.2']
16
activesupport-version: ['6', '7']
17
- sinatra-version: ['2', '3']
+ sinatra-version: ['2', '3', '4']
18
env:
19
ACTIVESUPPORT_MAJOR: ${{ matrix.activesupport-version }}
20
SINATRA_MAJOR: ${{ matrix.sinatra-version }}
CHANGELOG.md
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
4
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
5
6
## [Unreleased] - 🔜
7
+### Added
8
+- Add support for Sinatra 4 ([#361](https://github.com/interagent/pliny/pull/361))
9
+
10
### Changed
11
- Switched branch from master to main ([#362](https://github.com/interagent/pliny/pull/362))
12
lib/pliny/errors.rb
@@ -4,7 +4,7 @@ class Error < StandardError
attr_accessor :id
def self.render(error)
- headers = { "Content-Type" => "application/json; charset=utf-8" }
+ headers = { "content-type" => "application/json; charset=utf-8" }
data = { id: error.id, message: error.message }
[error.status, headers, [MultiJson.encode(data)]]
end
lib/pliny/middleware/cors.rb
@@ -44,12 +44,12 @@ def allow_headers
44
45
def cors_headers(env)
46
{
47
- 'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
48
- 'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
49
- 'Access-Control-Allow-Headers' => allow_headers.join(', '),
50
- 'Access-Control-Allow-Credentials' => "true",
51
- 'Access-Control-Max-Age' => "1728000",
52
- 'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
+ 'access-control-allow-origin' => env["HTTP_ORIGIN"],
+ 'access-control-allow-methods' => ALLOW_METHODS.join(', '),
+ 'access-control-allow-headers' => allow_headers.join(', '),
+ 'access-control-allow-credentials' => "true",
+ 'access-control-max-age' => "1728000",
+ 'access-control-expose-headers' => EXPOSE_HEADERS.join(', ')
53
}
54
55
lib/pliny/middleware/versioning.rb
@@ -26,7 +26,7 @@ def detect_api_version(env)
26
error = { id: :bad_version, message: <<-eos }
27
Please specify a version along with the MIME type. For example, `Accept: application/vnd.#{@app_name}+json; version=1`.
28
eos
29
- return [400, { "Content-Type" => "application/json; charset=utf-8" },
+ return [400, { "content-type" => "application/json; charset=utf-8" },
30
[MultiJson.encode(error)]]
31
32
pliny.gemspec
@@ -20,15 +20,15 @@ Gem::Specification.new do |gem|
gem.add_dependency "prmd", "~> 0.11", ">= 0.11.4"
21
22
23
- gem.add_dependency "sinatra", ">= 2.0", "< 4.0"
+ gem.add_dependency "sinatra", ">= 2.0", "< 5.0"
24
gem.add_dependency "http_accept", "~> 0.1", ">= 0.1.5"
25
gem.add_dependency "sinatra-router", "~> 0.2", ">= 0.2.4"
gem.add_dependency "thor", ">= 0.19", "< 2.0"
gem.add_development_dependency "rake", "~> 13.0"
- gem.add_development_dependency "rack-test", "~> 1.1.0"
+ gem.add_development_dependency "rack-test", "~> 2"
gem.add_development_dependency "rspec", "~> 3.1", ">= 3.1.0"
- gem.add_development_dependency "sinatra-contrib", ">= 2.0", "< 4.0"
+ gem.add_development_dependency "sinatra-contrib", ">= 2.0", "< 5.0"
gem.add_development_dependency "timecop", "~> 0.7", ">= 0.7.1"
33
gem.add_development_dependency "pry"
34
gem.add_development_dependency "pry-byebug"
0 commit comments