sinatra 2.2.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +91 -17
- data/Gemfile +44 -64
- data/README.md +105 -402
- data/Rakefile +65 -65
- data/VERSION +1 -1
- data/examples/chat.rb +5 -3
- data/examples/rainbows.rb +3 -1
- data/examples/simple.rb +2 -0
- data/examples/stream.ru +2 -0
- data/lib/sinatra/base.rb +331 -328
- data/lib/sinatra/indifferent_hash.rb +25 -33
- data/lib/sinatra/main.rb +18 -16
- data/lib/sinatra/show_exceptions.rb +17 -15
- data/lib/sinatra/version.rb +3 -1
- data/lib/sinatra.rb +2 -0
- data/sinatra.gemspec +38 -33
- metadata +32 -24
- data/README.de.md +0 -3239
- data/README.es.md +0 -3231
- data/README.fr.md +0 -3111
- data/README.hu.md +0 -728
- data/README.ja.md +0 -2844
- data/README.ko.md +0 -2967
- data/README.malayalam.md +0 -3141
- data/README.pt-br.md +0 -3787
- data/README.pt-pt.md +0 -791
- data/README.ru.md +0 -3207
- data/README.zh.md +0 -2934
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 253794a685657aa33414a6384abfa99f0c4b0a8aa97a9f15aa6d5ae88bcd747e
|
4
|
+
data.tar.gz: 455faa2397e06210cdeeb6e90eb5b8ec56908695585c869bb9241afc1e480cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ca8d0630ca6a5b420a6066ac6bb0375092e92a549bf623974a8780b576b859a227eccf32402ffb4628a04523c107420cda5982bcc69a14dbb3779ff299b255
|
7
|
+
data.tar.gz: 85352987ea63bcbdfa6a80af67a59e5e3e4e812f1aaf4f28016ebd085805934ffa2787278b3034cef623ee5ed278bb5b66eeb02f390b6b8fea5326f7f039c4d7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,77 @@
|
|
1
|
+
## Unreleased
|
2
|
+
|
3
|
+
* _Your new feature here._
|
4
|
+
|
5
|
+
## 3.0.5 / 2022-12-16
|
6
|
+
|
7
|
+
* Fix: Add Zeitwerk compatibility. [#1831](https://github.com/sinatra/sinatra/pull/1831) by Dawid Janczak
|
8
|
+
|
9
|
+
* Fix: Allow CALLERS_TO_IGNORE to be overridden
|
10
|
+
|
11
|
+
## 3.0.4 / 2022-11-25
|
12
|
+
|
13
|
+
* Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
|
14
|
+
|
15
|
+
## 3.0.3 / 2022-11-11
|
16
|
+
|
17
|
+
* Fix: fixed ReDoS for Rack::Protection::IPSpoofing. [#1823](https://github.com/sinatra/sinatra/pull/1823) by @ooooooo-q
|
18
|
+
|
19
|
+
## 3.0.2 / 2022-10-01
|
20
|
+
|
21
|
+
* New: Add Haml 6 support. [#1820](https://github.com/sinatra/sinatra/pull/1820) by Jordan Owens
|
22
|
+
|
23
|
+
## 3.0.1 / 2022-09-26
|
24
|
+
|
25
|
+
* Fix: Revert removal of rack-protection.rb. [#1814](https://github.com/sinatra/sinatra/pull/1814) by Olle Jonsson
|
26
|
+
|
27
|
+
* Fix: Revert change to server start and stop messaging by using Kernel#warn. Renamed internal warn method warn_for_deprecation. [#1818](https://github.com/sinatra/sinatra/pull/1818) by Jordan Owens
|
28
|
+
|
29
|
+
## 3.0.0 / 2022-09-26
|
30
|
+
|
31
|
+
* New: Add Falcon support. [#1794](https://github.com/sinatra/sinatra/pull/1794) by Samuel Williams and @horaciob
|
32
|
+
|
33
|
+
* New: Add AES GCM encryption support for session cookies. [#1324] (https://github.com/sinatra/sinatra/pull/1324) by Michael Coyne
|
34
|
+
|
35
|
+
* Deprecated: Sinatra Reloader will be removed in the next major release.
|
36
|
+
|
37
|
+
* Fix: Internal Sinatra errors now extend `Sinatra::Error`. This fixes [#1204](https://github.com/sinatra/sinatra/issues/1204) and [#1518](https://github.com/sinatra/sinatra/issues/1518). [bda8c29d](https://github.com/sinatra/sinatra/commit/bda8c29d70619d53f5b1c181140638d340695514) by Jordan Owens
|
38
|
+
|
39
|
+
* Fix: Preserve query param value if named route param nil. [#1676](https://github.com/sinatra/sinatra/pull/1676) by Jordan Owens
|
40
|
+
|
41
|
+
* Require Ruby 2.6 as minimum Ruby version. [#1699](https://github.com/sinatra/sinatra/pull/1699) by Eloy Pérez
|
42
|
+
|
43
|
+
* Breaking change: Remove support for the Stylus template engine. [#1697](https://github.com/sinatra/sinatra/pull/1697) by Eloy Pérez
|
44
|
+
|
45
|
+
* Breaking change: Remove support for the erubis template engine. [#1761](https://github.com/sinatra/sinatra/pull/1761) by Eloy Pérez
|
46
|
+
|
47
|
+
* Breaking change: Remove support for the textile template engine. [#1766](https://github.com/sinatra/sinatra/pull/1766) by Eloy Pérez
|
48
|
+
|
49
|
+
* Breaking change: Remove support for SASS as a template engine. [#1768](https://github.com/sinatra/sinatra/pull/1768) by Eloy Pérez
|
50
|
+
|
51
|
+
* Breaking change: Remove support for Wlang as a template engine. [#1780](https://github.com/sinatra/sinatra/pull/1780) by Eloy Pérez
|
52
|
+
|
53
|
+
* Breaking change: Remove support for CoffeeScript as a template engine. [#1790](https://github.com/sinatra/sinatra/pull/1790) by Eloy Pérez
|
54
|
+
|
55
|
+
* Breaking change: Remove support for Mediawiki as a template engine. [#1791](https://github.com/sinatra/sinatra/pull/1791) by Eloy Pérez
|
56
|
+
|
57
|
+
* Breaking change: Remove support for Creole as a template engine. [#1792](https://github.com/sinatra/sinatra/pull/1792) by Eloy Pérez
|
58
|
+
|
59
|
+
* Breaking change: Remove support for Radius as a template engine. [#1793](https://github.com/sinatra/sinatra/pull/1793) by Eloy Pérez
|
60
|
+
|
61
|
+
* Breaking change: Remove support for the defunct Less templating library. See [#1716](https://github.com/sinatra/sinatra/issues/1716), [#1715](https://github.com/sinatra/sinatra/issues/1715) for more discussion and background. [d1af2f1e](https://github.com/sinatra/sinatra/commit/d1af2f1e6c8710419dfe3102a660f7a32f0e67e3) by Olle Jonsson
|
62
|
+
|
63
|
+
* Breaking change: Remove Reel integration. [54597502](https://github.com/sinatra/sinatra/commit/545975025927a27a1daca790598620038979f1c5) by Olle Jonsson
|
64
|
+
|
65
|
+
* CI: Start testing on Ruby 3.1. [60e221940](https://github.com/sinatra/sinatra/commit/60e2219407e6ae067bf3e53eb060ee4860c60c8d) and [b0fa4bef](https://github.com/sinatra/sinatra/commit/b0fa4beffaa3b10bf02947d0a35e137403296c6b) by Johannes Würbach
|
66
|
+
|
67
|
+
* Use `Kernel#caller_locations`. [#1491](https://github.com/sinatra/sinatra/pull/1491) by Julik Tarkhanov
|
68
|
+
|
69
|
+
* Docs: Japanese documentation: Add notes about the `default_content_type` setting. [#1650](https://github.com/sinatra/sinatra/pull/1650) by Akifumi Tominaga
|
70
|
+
|
71
|
+
* Docs: Polish documentation: Add section about Multithreaded modes and Routes. [#1708](https://github.com/sinatra/sinatra/pull/1708) by Patrick Gramatowski
|
72
|
+
|
73
|
+
* Docs: Japanese documentation: Make Session section reflect changes done to README.md. [#1731](https://github.com/sinatra/sinatra/pull/1731) by @shu-i-chi
|
74
|
+
|
1
75
|
## 2.2.3 / 2022-11-25
|
2
76
|
|
3
77
|
* Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
|
@@ -10,38 +84,26 @@
|
|
10
84
|
|
11
85
|
## 2.2.1 / 2022-07-15
|
12
86
|
|
13
|
-
* Fix JRuby regression by using ruby2_keywords for delegation.
|
87
|
+
* Fix JRuby regression by using ruby2_keywords for delegation. #1750 by Patrik Ragnarsson
|
14
88
|
|
15
|
-
* Add JRuby to CI.
|
89
|
+
* Add JRuby to CI. #1755 by Karol Bucek
|
16
90
|
|
17
91
|
## 2.2.0 / 2022-02-15
|
18
92
|
|
19
|
-
* Breaking change: Add
|
93
|
+
* Breaking change: Add `#select`, `#reject` and `#compact` methods to `Sinatra::IndifferentHash`. If hash keys need to be converted to symbols, call `#to_h` to get a `Hash` instance first. [#1711](https://github.com/sinatra/sinatra/pull/1711) by Olivier Bellone
|
20
94
|
|
21
95
|
* Handle EOFError raised by Rack and return Bad Request 400 status. [#1743](https://github.com/sinatra/sinatra/pull/1743) by tamazon
|
22
96
|
|
23
|
-
* Update README.es.md with removal of Thin. [#1630](https://github.com/sinatra/sinatra/pull/1630) by Espartaco Palma
|
24
|
-
|
25
97
|
* Minor refactors in `base.rb`. [#1640](https://github.com/sinatra/sinatra/pull/1640) by ceclinux
|
26
98
|
|
27
|
-
* Fixed typos in german README.md. [#1648](https://github.com/sinatra/sinatra/pull/1648) by Juri
|
28
|
-
|
29
99
|
* Add escaping to the static 404 page. [#1645](https://github.com/sinatra/sinatra/pull/1645) by Chris Gavin
|
30
100
|
|
31
101
|
* Remove `detect_rack_handler` method. [#1652](https://github.com/sinatra/sinatra/pull/1652) by ceclinux
|
32
102
|
|
33
103
|
* Respect content type set in superclass before filter. Fixes [#1647](https://github.com/sinatra/sinatra/issues/1647) [#1649](https://github.com/sinatra/sinatra/pull/1649) by Jordan Owens
|
34
104
|
|
35
|
-
* Update README.ja.md with removal of Thin. [#1629](https://github.com/sinatra/sinatra/pull/1629) by Ryuichi KAWAMATA
|
36
|
-
|
37
105
|
* *Revert "Use prepend instead of include for helpers.* [#1662](https://github.com/sinatra/sinatra/pull/1662) by namusyaka
|
38
106
|
|
39
|
-
* Various minor fixes to README.md. [#1663](https://github.com/sinatra/sinatra/pull/1663) by Yanis Zafirópulos
|
40
|
-
|
41
|
-
* Document when `dump_errors` is enabled. Fixes [#1664](https://github.com/sinatra/sinatra/issues/1664) [#1665](https://github.com/sinatra/sinatra/pull/1665) by Patrik Ragnarsson
|
42
|
-
|
43
|
-
* Update README.pt-br.md. [#1668](https://github.com/sinatra/sinatra/pull/1668) by Vitor Oliveira
|
44
|
-
|
45
107
|
* Fix usage of inherited `Sinatra::Base` classes keyword arguments. Fixes [#1669](https://github.com/sinatra/sinatra/issues/1669) [#1670](https://github.com/sinatra/sinatra/pull/1670) by Cadu Ribeiro
|
46
108
|
|
47
109
|
* Reduce RDoc generation time by not including every README. Fixes [#1578](https://github.com/sinatra/sinatra/issues/1578) [#1671](https://github.com/sinatra/sinatra/pull/1671) by Eloy Pérez
|
@@ -54,17 +116,29 @@
|
|
54
116
|
|
55
117
|
* Fix Delegator to pass keyword arguments for Ruby 3.0. [#1684](https://github.com/sinatra/sinatra/pull/1684) by andrewtblake
|
56
118
|
|
57
|
-
* Fix use with keyword arguments for Ruby 3.0. [#1701](https://github.com/sinatra/sinatra/pull/1701) by Robin Wallin
|
119
|
+
* Fix use with keyword arguments for Ruby 3.0. [#1701](https://github.com/sinatra/sinatra/pull/1701) by Robin Wallin
|
58
120
|
|
59
121
|
* Fix memory leaks for proc template. Fixes [#1704](https://github.com/sinatra/sinatra/issues/1714) [#1719](https://github.com/sinatra/sinatra/pull/1719) by Slevin
|
60
122
|
|
61
123
|
* Remove unnecessary `test_files` from the gemspec. [#1712](https://github.com/sinatra/sinatra/pull/1712) by Masataka Pocke Kuwabara
|
62
124
|
|
125
|
+
* Docs: Spanish documentation: Update README.es.md with removal of Thin. [#1630](https://github.com/sinatra/sinatra/pull/1630) by Espartaco Palma
|
126
|
+
|
127
|
+
* Docs: German documentation: Fixed typos in German README.md. [#1648](https://github.com/sinatra/sinatra/pull/1648) by Juri
|
128
|
+
|
129
|
+
* Docs: Japanese documentation: Update README.ja.md with removal of Thin. [#1629](https://github.com/sinatra/sinatra/pull/1629) by Ryuichi KAWAMATA
|
130
|
+
|
131
|
+
* Docs: English documentation: Various minor fixes to README.md. [#1663](https://github.com/sinatra/sinatra/pull/1663) by Yanis Zafirópulos
|
132
|
+
|
133
|
+
* Docs: English documentation: Document when `dump_errors` is enabled. Fixes [#1664](https://github.com/sinatra/sinatra/issues/1664) [#1665](https://github.com/sinatra/sinatra/pull/1665) by Patrik Ragnarsson
|
134
|
+
|
135
|
+
* Docs: Brazilian Portuguese documentation: Update README.pt-br.md with translation fixes. [#1668](https://github.com/sinatra/sinatra/pull/1668) by Vitor Oliveira
|
136
|
+
|
63
137
|
### CI
|
64
138
|
|
65
139
|
* Use latest JRuby 9.2.16.0 on CI. [#1682](https://github.com/sinatra/sinatra/pull/1682) by Olle Jonsson
|
66
140
|
|
67
|
-
* Switch CI from travis to
|
141
|
+
* Switch CI from travis to GitHub Actions. [#1691](https://github.com/sinatra/sinatra/pull/1691) by namusyaka
|
68
142
|
|
69
143
|
* Skip the Slack action if `secrets.SLACK_WEBHOOK` is not set. [#1705](https://github.com/sinatra/sinatra/pull/1705) by Robin Wallin
|
70
144
|
|
data/Gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Why use bundler?
|
2
4
|
# Well, not all development dependencies install on all rubies. Moreover, `gem
|
3
5
|
# install sinatra --development` doesn't work, as it will also try to install
|
@@ -6,74 +8,52 @@
|
|
6
8
|
#
|
7
9
|
# If you have issues with a gem: `bundle install --without-coffee-script`.
|
8
10
|
|
9
|
-
|
10
|
-
source 'https://rubygems.org' unless ENV['QUICK']
|
11
|
+
source 'https://rubygems.org'
|
11
12
|
gemspec
|
12
13
|
|
13
14
|
gem 'rake'
|
14
|
-
gem 'rack', '~> 2.0'
|
15
|
-
gem 'rack-test', '>= 0.6.2'
|
16
|
-
gem "minitest", "~> 5.0"
|
17
|
-
gem 'yard'
|
18
|
-
|
19
|
-
gem "rack-protection", path: "rack-protection"
|
20
|
-
gem "sinatra-contrib", path: "sinatra-contrib"
|
21
15
|
|
22
|
-
|
16
|
+
rack_version = ENV['rack'].to_s
|
17
|
+
rack_version = nil if rack_version.empty? || (rack_version == 'stable')
|
18
|
+
rack_version = { github: 'rack/rack' } if rack_version == 'latest'
|
19
|
+
gem 'rack', rack_version
|
23
20
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
puma_version = ENV['puma'].to_s
|
22
|
+
puma_version = nil if puma_version.empty? || (puma_version == 'stable')
|
23
|
+
puma_version = { github: 'puma/puma' } if puma_version == 'latest'
|
24
|
+
gem 'puma', puma_version
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
if RUBY_ENGINE == "ruby"
|
34
|
-
gem 'less', '~> 2.0'
|
35
|
-
gem 'therubyracer'
|
36
|
-
gem 'redcarpet'
|
37
|
-
gem 'wlang', '>= 3.0.1'
|
38
|
-
gem 'bluecloth'
|
39
|
-
gem 'rdiscount'
|
40
|
-
gem 'RedCloth'
|
41
|
-
gem 'puma', '~> 5'
|
42
|
-
gem 'yajl-ruby'
|
43
|
-
gem 'nokogiri'
|
44
|
-
gem 'rainbows'
|
45
|
-
gem 'eventmachine'
|
46
|
-
gem 'slim', '~> 2.0'
|
47
|
-
gem 'coffee-script', '>= 2.0'
|
48
|
-
gem 'kramdown'
|
49
|
-
gem 'maruku'
|
50
|
-
gem 'creole'
|
51
|
-
gem 'wikicloth'
|
52
|
-
gem 'markaby'
|
53
|
-
gem 'radius'
|
54
|
-
gem 'asciidoctor'
|
55
|
-
gem 'liquid'
|
56
|
-
gem 'stylus'
|
57
|
-
gem 'rabl'
|
58
|
-
gem 'builder'
|
59
|
-
gem 'erubi'
|
60
|
-
gem 'erubis'
|
61
|
-
gem 'haml', '>= 3.0'
|
62
|
-
gem 'sass'
|
63
|
-
gem 'reel-rack'
|
64
|
-
gem 'celluloid', '~> 0.16.0'
|
65
|
-
gem 'commonmarker', '~> 0.20.0'
|
66
|
-
gem 'pandoc-ruby', '~> 2.0.2'
|
67
|
-
gem 'simplecov', require: false
|
68
|
-
end
|
69
|
-
|
70
|
-
if RUBY_ENGINE == "rbx"
|
71
|
-
gem 'json'
|
72
|
-
gem 'rubysl'
|
73
|
-
gem 'rubysl-test-unit'
|
74
|
-
gem 'erubi'
|
75
|
-
end
|
26
|
+
gem 'minitest', '~> 5.0'
|
27
|
+
gem 'rack-test', github: 'rack/rack-test'
|
28
|
+
gem 'rubocop', '~> 1.32.0', require: false
|
29
|
+
gem 'yard'
|
76
30
|
|
77
|
-
|
78
|
-
|
79
|
-
|
31
|
+
gem 'rack-protection', path: 'rack-protection'
|
32
|
+
gem 'sinatra-contrib', path: 'sinatra-contrib'
|
33
|
+
|
34
|
+
gem 'activesupport', '~> 6.1'
|
35
|
+
|
36
|
+
gem 'asciidoctor'
|
37
|
+
gem 'builder'
|
38
|
+
gem 'commonmarker', '~> 0.23.4', platforms: [:ruby]
|
39
|
+
gem 'erubi'
|
40
|
+
gem 'eventmachine'
|
41
|
+
gem 'falcon', '~> 0.40', platforms: [:ruby]
|
42
|
+
gem 'haml', '~> 5'
|
43
|
+
gem 'kramdown'
|
44
|
+
gem 'liquid'
|
45
|
+
gem 'markaby'
|
46
|
+
gem 'nokogiri', '> 1.5.0'
|
47
|
+
gem 'pandoc-ruby', '~> 2.0.2'
|
48
|
+
gem 'rabl'
|
49
|
+
gem 'rainbows', platforms: [:mri] # uses #fork
|
50
|
+
gem 'rdiscount', platforms: [:ruby]
|
51
|
+
gem 'rdoc'
|
52
|
+
gem 'redcarpet', platforms: [:ruby]
|
53
|
+
gem 'simplecov', require: false
|
54
|
+
gem 'slim', '~> 4'
|
55
|
+
gem 'yajl-ruby', platforms: [:ruby]
|
56
|
+
|
57
|
+
gem 'json', platforms: %i[jruby mri]
|
58
|
+
|
59
|
+
gem 'jar-dependencies', '= 0.4.1', platforms: [:jruby] # Gem::LoadError with jar-dependencies 0.4.2
|