sinatra 1.4.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sinatra might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/AUTHORS.md +5 -2
- data/{CHANGES → CHANGELOG.md} +126 -46
- data/CONTRIBUTING.md +100 -0
- data/Gemfile +12 -17
- data/LICENSE +5 -2
- data/MAINTENANCE.md +42 -0
- data/README.de.md +711 -466
- data/README.es.md +206 -171
- data/README.fr.md +370 -344
- data/README.hu.md +44 -10
- data/README.ja.md +300 -210
- data/README.ko.md +230 -191
- data/README.md +675 -528
- data/README.pt-br.md +149 -115
- data/README.pt-pt.md +65 -65
- data/README.ru.md +198 -97
- data/README.zh.md +1943 -1237
- data/Rakefile +72 -49
- data/SECURITY.md +35 -0
- data/lib/sinatra/base.rb +141 -207
- data/lib/sinatra/indifferent_hash.rb +150 -0
- data/lib/sinatra/main.rb +1 -0
- data/lib/sinatra/show_exceptions.rb +70 -56
- data/lib/sinatra/version.rb +1 -1
- data/sinatra.gemspec +19 -7
- metadata +32 -163
- data/test/asciidoctor_test.rb +0 -72
- data/test/base_test.rb +0 -167
- data/test/builder_test.rb +0 -91
- data/test/coffee_test.rb +0 -96
- data/test/compile_test.rb +0 -183
- data/test/contest.rb +0 -91
- data/test/creole_test.rb +0 -65
- data/test/delegator_test.rb +0 -160
- data/test/encoding_test.rb +0 -20
- data/test/erb_test.rb +0 -116
- data/test/extensions_test.rb +0 -98
- data/test/filter_test.rb +0 -487
- data/test/haml_test.rb +0 -109
- data/test/helper.rb +0 -132
- data/test/helpers_test.rb +0 -1917
- data/test/integration/app.rb +0 -79
- data/test/integration_helper.rb +0 -236
- data/test/integration_test.rb +0 -104
- data/test/less_test.rb +0 -69
- data/test/liquid_test.rb +0 -77
- data/test/mapped_error_test.rb +0 -285
- data/test/markaby_test.rb +0 -80
- data/test/markdown_test.rb +0 -85
- data/test/mediawiki_test.rb +0 -68
- data/test/middleware_test.rb +0 -68
- data/test/nokogiri_test.rb +0 -67
- data/test/public/favicon.ico +0 -0
- data/test/rabl_test.rb +0 -89
- data/test/rack_test.rb +0 -45
- data/test/radius_test.rb +0 -59
- data/test/rdoc_test.rb +0 -66
- data/test/readme_test.rb +0 -130
- data/test/request_test.rb +0 -100
- data/test/response_test.rb +0 -63
- data/test/result_test.rb +0 -76
- data/test/route_added_hook_test.rb +0 -59
- data/test/routing_test.rb +0 -1412
- data/test/sass_test.rb +0 -115
- data/test/scss_test.rb +0 -88
- data/test/server_test.rb +0 -56
- data/test/settings_test.rb +0 -582
- data/test/sinatra_test.rb +0 -12
- data/test/slim_test.rb +0 -102
- data/test/static_test.rb +0 -236
- data/test/streaming_test.rb +0 -149
- data/test/stylus_test.rb +0 -90
- data/test/templates_test.rb +0 -382
- data/test/textile_test.rb +0 -65
- data/test/views/a/in_a.str +0 -1
- data/test/views/ascii.erb +0 -2
- data/test/views/b/in_b.str +0 -1
- data/test/views/calc.html.erb +0 -1
- data/test/views/error.builder +0 -3
- data/test/views/error.erb +0 -3
- data/test/views/error.haml +0 -3
- data/test/views/error.sass +0 -2
- data/test/views/explicitly_nested.str +0 -1
- data/test/views/foo/hello.test +0 -1
- data/test/views/hello.asciidoc +0 -1
- data/test/views/hello.builder +0 -1
- data/test/views/hello.coffee +0 -1
- data/test/views/hello.creole +0 -1
- data/test/views/hello.erb +0 -1
- data/test/views/hello.haml +0 -1
- data/test/views/hello.less +0 -5
- data/test/views/hello.liquid +0 -1
- data/test/views/hello.mab +0 -1
- data/test/views/hello.md +0 -1
- data/test/views/hello.mediawiki +0 -1
- data/test/views/hello.nokogiri +0 -1
- data/test/views/hello.rabl +0 -2
- data/test/views/hello.radius +0 -1
- data/test/views/hello.rdoc +0 -1
- data/test/views/hello.sass +0 -2
- data/test/views/hello.scss +0 -3
- data/test/views/hello.slim +0 -1
- data/test/views/hello.str +0 -1
- data/test/views/hello.styl +0 -2
- data/test/views/hello.test +0 -1
- data/test/views/hello.textile +0 -1
- data/test/views/hello.wlang +0 -1
- data/test/views/hello.yajl +0 -1
- data/test/views/layout2.builder +0 -3
- data/test/views/layout2.erb +0 -2
- data/test/views/layout2.haml +0 -2
- data/test/views/layout2.liquid +0 -2
- data/test/views/layout2.mab +0 -2
- data/test/views/layout2.nokogiri +0 -3
- data/test/views/layout2.rabl +0 -3
- data/test/views/layout2.radius +0 -2
- data/test/views/layout2.slim +0 -3
- data/test/views/layout2.str +0 -2
- data/test/views/layout2.test +0 -1
- data/test/views/layout2.wlang +0 -2
- data/test/views/nested.str +0 -1
- data/test/views/utf8.erb +0 -2
- data/test/wlang_test.rb +0 -87
- data/test/yajl_test.rb +0 -86
data/Rakefile
CHANGED
@@ -3,22 +3,13 @@ require 'rake/testtask'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'date'
|
5
5
|
|
6
|
-
# CI Reporter is only needed for the CI
|
7
|
-
begin
|
8
|
-
require 'ci/reporter/rake/test_unit'
|
9
|
-
rescue LoadError
|
10
|
-
end
|
11
|
-
|
12
6
|
task :default => :test
|
13
7
|
task :spec => :test
|
14
8
|
|
15
9
|
CLEAN.include "**/*.rbc"
|
16
10
|
|
17
11
|
def source_version
|
18
|
-
@source_version ||=
|
19
|
-
load './lib/sinatra/version.rb'
|
20
|
-
Sinatra::VERSION
|
21
|
-
end
|
12
|
+
@source_version ||= File.read(File.expand_path("../VERSION", __FILE__)).strip
|
22
13
|
end
|
23
14
|
|
24
15
|
def prev_feature
|
@@ -61,7 +52,8 @@ namespace :test do
|
|
61
52
|
desc 'Measures test coverage'
|
62
53
|
task :coverage do
|
63
54
|
rm_f "coverage"
|
64
|
-
|
55
|
+
ENV['COVERAGE'] = '1'
|
56
|
+
Rake::Task['test'].invoke
|
65
57
|
end
|
66
58
|
end
|
67
59
|
|
@@ -95,9 +87,9 @@ end
|
|
95
87
|
|
96
88
|
# Thanks in announcement ===============================================
|
97
89
|
|
98
|
-
team = ["Ryan Tomayko", "Blake Mizerany", "Simon Rozet", "Konstantin Haase"]
|
90
|
+
team = ["Ryan Tomayko", "Blake Mizerany", "Simon Rozet", "Konstantin Haase", "Zachary Scott"]
|
99
91
|
desc "list of contributors"
|
100
|
-
task :thanks, [:
|
92
|
+
task :thanks, ['release:all', :backports] do |t, a|
|
101
93
|
a.with_defaults :release => "#{prev_version}..HEAD",
|
102
94
|
:backports => "#{prev_feature}.0..#{prev_feature}.x"
|
103
95
|
included = `git log --format=format:"%aN\t%s" #{a.release}`.lines.map { |l| l.force_encoding('binary') }
|
@@ -146,54 +138,85 @@ end
|
|
146
138
|
# PACKAGING ============================================================
|
147
139
|
|
148
140
|
if defined?(Gem)
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
141
|
+
GEMS_AND_ROOT_DIRECTORIES = {
|
142
|
+
"sinatra" => ".",
|
143
|
+
"sinatra-contrib" => "./sinatra-contrib",
|
144
|
+
"rack-protection" => "./rack-protection"
|
145
|
+
}
|
146
|
+
|
147
|
+
def package(gem, ext='')
|
148
|
+
"pkg/#{gem}-#{source_version}" + ext
|
153
149
|
end
|
154
150
|
|
155
|
-
|
156
|
-
|
157
|
-
end
|
151
|
+
directory 'pkg/'
|
152
|
+
CLOBBER.include('pkg')
|
158
153
|
|
159
|
-
|
160
|
-
|
154
|
+
GEMS_AND_ROOT_DIRECTORIES.each do |gem, directory|
|
155
|
+
file package(gem, '.gem') => ["pkg/", "#{directory + '/' + gem}.gemspec"] do |f|
|
156
|
+
sh "cd #{directory} && gem build #{gem}.gemspec"
|
157
|
+
mv directory + "/" + File.basename(f.name), f.name
|
158
|
+
end
|
161
159
|
|
162
|
-
|
163
|
-
|
164
|
-
|
160
|
+
file package(gem, '.tar.gz') => ["pkg/"] do |f|
|
161
|
+
sh <<-SH
|
162
|
+
git archive \
|
163
|
+
--prefix=#{gem}-#{source_version}/ \
|
164
|
+
--format=tar \
|
165
|
+
HEAD -- #{directory} | gzip > #{f.name}
|
166
|
+
SH
|
167
|
+
end
|
165
168
|
end
|
166
169
|
|
167
|
-
|
168
|
-
|
170
|
+
namespace :package do
|
171
|
+
GEMS_AND_ROOT_DIRECTORIES.each do |gem, directory|
|
172
|
+
desc "Build #{gem} packages"
|
173
|
+
task gem => %w[.gem .tar.gz].map { |e| package(gem, e) }
|
174
|
+
end
|
169
175
|
|
170
|
-
|
171
|
-
|
172
|
-
mv File.basename(f.name), f.name
|
176
|
+
desc "Build all packages"
|
177
|
+
task :all => GEMS_AND_ROOT_DIRECTORIES.keys
|
173
178
|
end
|
174
179
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
180
|
+
namespace :install do
|
181
|
+
GEMS_AND_ROOT_DIRECTORIES.each do |gem, directory|
|
182
|
+
desc "Build and install #{gem} as local gem"
|
183
|
+
task gem => package(gem, '.gem') do
|
184
|
+
sh "gem install #{package(gem, '.gem')}"
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
desc "Build and install all of the gems as local gems"
|
189
|
+
task :all => GEMS_AND_ROOT_DIRECTORIES.keys
|
182
190
|
end
|
183
191
|
|
184
|
-
|
185
|
-
|
186
|
-
|
192
|
+
namespace :release do
|
193
|
+
GEMS_AND_ROOT_DIRECTORIES.each do |gem, directory|
|
194
|
+
desc "Release #{gem} as a package"
|
195
|
+
task gem => "package:#{gem}" do
|
196
|
+
sh <<-SH
|
197
|
+
gem install #{package(gem, '.gem')} --local &&
|
198
|
+
gem push #{package(gem, '.gem')}
|
199
|
+
SH
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
desc "Commits the version to github repository"
|
204
|
+
task :commit_version do
|
205
|
+
sh <<-SH
|
206
|
+
sed -i "s/.*VERSION.*/ VERSION = '#{source_version}'/" lib/sinatra/version.rb
|
207
|
+
sed -i "s/.*VERSION.*/ VERSION = '#{source_version}'/" sinatra-contrib/lib/sinatra/contrib/version.rb
|
208
|
+
sed -i "s/.*VERSION.*/ VERSION = '#{source_version}'/" rack-protection/lib/rack/protection/version.rb
|
209
|
+
SH
|
210
|
+
|
211
|
+
sh <<-SH
|
212
|
+
git commit --allow-empty -a -m '#{source_version} release' &&
|
213
|
+
git tag -s v#{source_version} -m '#{source_version} release' &&
|
214
|
+
git push && (git push origin || true) &&
|
215
|
+
git push --tags && (git push origin --tags || true)
|
216
|
+
SH
|
187
217
|
end
|
188
218
|
|
189
|
-
|
190
|
-
|
191
|
-
gem push #{package('.gem')} &&
|
192
|
-
git commit --allow-empty -a -m '#{source_version} release' &&
|
193
|
-
git tag -s v#{source_version} -m '#{source_version} release' &&
|
194
|
-
git tag -s #{source_version} -m '#{source_version} release' &&
|
195
|
-
git push && (git push sinatra || true) &&
|
196
|
-
git push --tags && (git push sinatra --tags || true)
|
197
|
-
SH
|
219
|
+
desc "Release all gems as packages"
|
220
|
+
task :all => [:test, :commit_version] + GEMS_AND_ROOT_DIRECTORIES.keys
|
198
221
|
end
|
199
222
|
end
|
data/SECURITY.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Reporting a security bug
|
2
|
+
|
3
|
+
All security bugs in Sinatra should be reported to the core team through our private mailing list [sinatra-security@googlegroups.com](https://groups.google.com/group/sinatra-security). Your report will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in handling your report.
|
4
|
+
|
5
|
+
After the initial reply to your report the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least every five days, in reality this is more likely to be every 24-48 hours.
|
6
|
+
|
7
|
+
If you have not received a reply to your email within 48 hours, or have not heard from the security team for the past five days there are a few steps you can take:
|
8
|
+
|
9
|
+
* Contact the current security coordinator [Zachary Scott](mailto:zzak@ruby-lang.org) directly
|
10
|
+
|
11
|
+
## Disclosure Policy
|
12
|
+
|
13
|
+
Sinatra has a 5 step disclosure policy, that is upheld to the best of our ability.
|
14
|
+
|
15
|
+
1. Security report received and is assigned a primary handler. This person will coordinate the fix and release process.
|
16
|
+
2. Problem is confirmed and, a list of all affected versions is determined. Code is audited to find any potential similar problems.
|
17
|
+
3. Fixes are prepared for all releases which are still supported. These fixes are not committed to the public repository but rather held locally pending the announcement.
|
18
|
+
4. A suggested embargo date for this vulnerability is chosen and distros@openwall is notified. This notification will include patches for all versions still under support and a contact address for packagers who need advice back-porting patches to older versions.
|
19
|
+
5. On the embargo date, the [mailing list][mailing-list] and [security list][security-list] are sent a copy of the announcement. The changes are pushed to the public repository and new gems released to rubygems.
|
20
|
+
|
21
|
+
Typically the embargo date will be set 72 hours from the time vendor-sec is first notified, however this may vary depending on the severity of the bug or difficulty in applying a fix.
|
22
|
+
|
23
|
+
This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the bug in as timely a manner as possible, however it’s important that we follow the release process above to ensure that the disclosure is handled in a consistent manner.
|
24
|
+
|
25
|
+
## Security Updates
|
26
|
+
|
27
|
+
Security updates will be posted on the [mailing list][mailing-list] and [security list][security-list].
|
28
|
+
|
29
|
+
## Comments on this Policy
|
30
|
+
|
31
|
+
If you have any suggestions to improve this policy, please send an email the core team at [sinatrarb@googlegroups.com](https://groups.google.com/group/sinatrarb).
|
32
|
+
|
33
|
+
|
34
|
+
[mailing-list]: http://groups.google.com/group/sinatrarb/topics
|
35
|
+
[security-list]: http://groups.google.com/group/sinatra-security/topics
|