sinatra 1.4.5 → 1.4.6

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.

Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS.md +77 -0
  3. data/CHANGES +30 -0
  4. data/Gemfile +5 -5
  5. data/README.de.md +186 -56
  6. data/README.es.md +76 -76
  7. data/README.fr.md +120 -56
  8. data/README.hu.md +19 -19
  9. data/README.ja.md +44 -46
  10. data/README.ko.md +163 -67
  11. data/README.md +151 -127
  12. data/README.pt-br.md +905 -144
  13. data/README.pt-pt.md +17 -17
  14. data/README.ru.md +88 -52
  15. data/README.zh.md +76 -68
  16. data/lib/sinatra.rb +0 -1
  17. data/lib/sinatra/base.rb +21 -15
  18. data/lib/sinatra/show_exceptions.rb +10 -4
  19. data/lib/sinatra/version.rb +1 -1
  20. data/sinatra.gemspec +1 -1
  21. data/test/asciidoctor_test.rb +2 -2
  22. data/test/base_test.rb +1 -5
  23. data/test/builder_test.rb +2 -2
  24. data/test/coffee_test.rb +8 -2
  25. data/test/compile_test.rb +1 -1
  26. data/test/contest.rb +3 -12
  27. data/test/creole_test.rb +2 -2
  28. data/test/delegator_test.rb +1 -1
  29. data/test/encoding_test.rb +1 -1
  30. data/test/erb_test.rb +1 -1
  31. data/test/extensions_test.rb +1 -1
  32. data/test/filter_test.rb +2 -2
  33. data/test/haml_test.rb +2 -2
  34. data/test/helper.rb +8 -7
  35. data/test/helpers_test.rb +6 -6
  36. data/test/integration_test.rb +3 -3
  37. data/test/less_test.rb +2 -2
  38. data/test/liquid_test.rb +3 -3
  39. data/test/mapped_error_test.rb +5 -5
  40. data/test/markaby_test.rb +2 -2
  41. data/test/markdown_test.rb +6 -3
  42. data/test/mediawiki_test.rb +2 -2
  43. data/test/middleware_test.rb +1 -1
  44. data/test/nokogiri_test.rb +2 -2
  45. data/test/rabl_test.rb +2 -2
  46. data/test/rack_test.rb +1 -1
  47. data/test/radius_test.rb +2 -2
  48. data/test/rdoc_test.rb +4 -4
  49. data/test/readme_test.rb +1 -1
  50. data/test/request_test.rb +4 -1
  51. data/test/response_test.rb +1 -1
  52. data/test/result_test.rb +2 -2
  53. data/test/route_added_hook_test.rb +1 -1
  54. data/test/routing_test.rb +7 -7
  55. data/test/sass_test.rb +3 -3
  56. data/test/scss_test.rb +2 -2
  57. data/test/server_test.rb +10 -2
  58. data/test/settings_test.rb +4 -4
  59. data/test/sinatra_test.rb +1 -1
  60. data/test/slim_test.rb +2 -2
  61. data/test/static_test.rb +2 -2
  62. data/test/streaming_test.rb +2 -2
  63. data/test/stylus_test.rb +2 -2
  64. data/test/templates_test.rb +3 -3
  65. data/test/textile_test.rb +2 -2
  66. data/test/wlang_test.rb +1 -1
  67. data/test/yajl_test.rb +2 -2
  68. metadata +10 -11
  69. data/AUTHORS +0 -61
@@ -3,7 +3,7 @@ require File.expand_path('../helper', __FILE__)
3
3
  begin
4
4
  require 'sass'
5
5
 
6
- class ScssTest < Test::Unit::TestCase
6
+ class ScssTest < Minitest::Test
7
7
  def scss_app(options = {}, &block)
8
8
  mock_app do
9
9
  set :views, File.dirname(__FILE__) + '/views'
@@ -56,7 +56,7 @@ class ScssTest < Test::Unit::TestCase
56
56
 
57
57
  it "raises error if template not found" do
58
58
  mock_app { get('/') { scss(:no_such_template) } }
59
- assert_raise(Errno::ENOENT) { get('/') }
59
+ assert_raises(Errno::ENOENT) { get('/') }
60
60
  end
61
61
 
62
62
  it "passes scss options to the scss engine" do
@@ -3,7 +3,15 @@ require 'stringio'
3
3
 
4
4
  module Rack::Handler
5
5
  class Mock
6
- extend Test::Unit::Assertions
6
+ extend Minitest::Assertions
7
+ # Allow assertions in request context
8
+ def self.assertions
9
+ @assertions ||= 0
10
+ end
11
+
12
+ def self.assertions= assertions
13
+ @assertions = assertions
14
+ end
7
15
 
8
16
  def self.run(app, options={})
9
17
  assert(app < Sinatra::Base)
@@ -19,7 +27,7 @@ module Rack::Handler
19
27
  register 'mock', 'Rack::Handler::Mock'
20
28
  end
21
29
 
22
- class ServerTest < Test::Unit::TestCase
30
+ class ServerTest < Minitest::Test
23
31
  setup do
24
32
  mock_app do
25
33
  set :server, 'mock'
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class SettingsTest < Test::Unit::TestCase
3
+ class SettingsTest < Minitest::Test
4
4
  setup do
5
5
  @base = Sinatra.new(Sinatra::Base)
6
6
  @base.set :environment => :foo, :app_file => nil
@@ -28,14 +28,14 @@ class SettingsTest < Test::Unit::TestCase
28
28
  end
29
29
 
30
30
  it 'raises an error with a value and a block' do
31
- assert_raise ArgumentError do
31
+ assert_raises ArgumentError do
32
32
  @base.set(:fiz, 'boom!'){ 'baz' }
33
33
  end
34
34
  assert !@base.respond_to?(:fiz)
35
35
  end
36
36
 
37
37
  it 'raises an error without value and block' do
38
- assert_raise(ArgumentError) { @base.set(:fiz) }
38
+ assert_raises(ArgumentError) { @base.set(:fiz) }
39
39
  assert !@base.respond_to?(:fiz)
40
40
  end
41
41
 
@@ -46,7 +46,7 @@ class SettingsTest < Test::Unit::TestCase
46
46
  end
47
47
 
48
48
  it 'raises an error with the app class as value and a block' do
49
- assert_raise ArgumentError do
49
+ assert_raises ArgumentError do
50
50
  @base.set(:fiz, @base) { 'baz' }
51
51
  end
52
52
  assert !@base.respond_to?(:fiz)
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class SinatraTest < Test::Unit::TestCase
3
+ class SinatraTest < Minitest::Test
4
4
  it 'creates a new Sinatra::Base subclass on new' do
5
5
  app = Sinatra.new { get('/') { 'Hello World' } }
6
6
  assert_same Sinatra::Base, app.superclass
@@ -3,7 +3,7 @@ require File.expand_path('../helper', __FILE__)
3
3
  begin
4
4
  require 'slim'
5
5
 
6
- class SlimTest < Test::Unit::TestCase
6
+ class SlimTest < Minitest::Test
7
7
  def slim_app(&block)
8
8
  mock_app do
9
9
  set :views, File.dirname(__FILE__) + '/views'
@@ -42,7 +42,7 @@ class SlimTest < Test::Unit::TestCase
42
42
 
43
43
  it "raises error if template not found" do
44
44
  mock_app { get('/') { slim(:no_such_template) } }
45
- assert_raise(Errno::ENOENT) { get('/') }
45
+ assert_raises(Errno::ENOENT) { get('/') }
46
46
  end
47
47
 
48
48
  HTML4_DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class StaticTest < Test::Unit::TestCase
3
+ class StaticTest < Minitest::Test
4
4
  setup do
5
5
  mock_app do
6
6
  set :static, true
@@ -233,4 +233,4 @@ class StaticTest < Test::Unit::TestCase
233
233
  assert response.headers.include?('Last-Modified')
234
234
  end
235
235
 
236
- end
236
+ end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class StreamingTest < Test::Unit::TestCase
3
+ class StreamingTest < Minitest::Test
4
4
  Stream = Sinatra::Helpers::Stream
5
5
 
6
6
  it 'returns the concatenated body' do
@@ -105,7 +105,7 @@ class StreamingTest < Test::Unit::TestCase
105
105
  scheduler = MockScheduler.new
106
106
  Stream.new(scheduler) { fail 'should be caught' }.each { }
107
107
  scheduler.defer!
108
- assert_raise(RuntimeError) { scheduler.schedule! }
108
+ assert_raises(RuntimeError) { scheduler.schedule! }
109
109
  end
110
110
 
111
111
  it 'does not trigger an infinite loop if you call close in a callback' do
@@ -10,7 +10,7 @@ begin
10
10
  raise LoadError, 'unable to find Stylus compiler'
11
11
  end
12
12
 
13
- class StylusTest < Test::Unit::TestCase
13
+ class StylusTest < Minitest::Test
14
14
  def stylus_app(options = {}, &block)
15
15
  mock_app do
16
16
  set :views, File.dirname(__FILE__) + '/views'
@@ -65,7 +65,7 @@ begin
65
65
  mock_app {
66
66
  get('/') { stylus :no_such_template }
67
67
  }
68
- assert_raise(Errno::ENOENT) { get('/') }
68
+ assert_raises(Errno::ENOENT) { get('/') }
69
69
  end
70
70
 
71
71
  it "passes stylus options to the stylus engine" do
@@ -14,7 +14,7 @@ class TestTemplate < Tilt::Template
14
14
  Tilt.register 'test', self
15
15
  end
16
16
 
17
- class TemplatesTest < Test::Unit::TestCase
17
+ class TemplatesTest < Minitest::Test
18
18
  def render_app(base=Sinatra::Base, options = {}, &block)
19
19
  base, options = Sinatra::Base, base if base.is_a? Hash
20
20
  mock_app(base) do
@@ -120,7 +120,7 @@ class TemplatesTest < Test::Unit::TestCase
120
120
  end
121
121
  end
122
122
 
123
- it 'uses the default layout template if not really overriden' do
123
+ it 'uses the default layout template if not really overridden' do
124
124
  with_default_layout do
125
125
  render_app { render(:test, :hello, :layout => true) }
126
126
  assert ok?
@@ -197,7 +197,7 @@ class TemplatesTest < Test::Unit::TestCase
197
197
  end
198
198
 
199
199
  test 'inline_templates ignores IO errors' do
200
- assert_nothing_raised { mock_app { set(:inline_templates, '/foo/bar') } }
200
+ mock_app { set(:inline_templates, '/foo/bar') }
201
201
 
202
202
  assert @app.templates.empty?
203
203
  end
@@ -3,7 +3,7 @@ require File.expand_path('../helper', __FILE__)
3
3
  begin
4
4
  require 'redcloth'
5
5
 
6
- class TextileTest < Test::Unit::TestCase
6
+ class TextileTest < Minitest::Test
7
7
  def textile_app(&block)
8
8
  mock_app do
9
9
  set :views, File.dirname(__FILE__) + '/views'
@@ -26,7 +26,7 @@ class TextileTest < Test::Unit::TestCase
26
26
 
27
27
  it "raises error if template not found" do
28
28
  mock_app { get('/') { textile(:no_such_template) } }
29
- assert_raise(Errno::ENOENT) { get('/') }
29
+ assert_raises(Errno::ENOENT) { get('/') }
30
30
  end
31
31
 
32
32
  it "renders with inline layouts" do
@@ -3,7 +3,7 @@ require File.expand_path('../helper', __FILE__)
3
3
  begin
4
4
  require 'wlang'
5
5
 
6
- class WLangTest < Test::Unit::TestCase
6
+ class WLangTest < Minitest::Test
7
7
  def engine
8
8
  Tilt::WLangTemplate
9
9
  end
@@ -3,7 +3,7 @@ require File.expand_path('../helper', __FILE__)
3
3
  begin
4
4
  require 'yajl'
5
5
 
6
- class YajlTest < Test::Unit::TestCase
6
+ class YajlTest < Minitest::Test
7
7
  def yajl_app(&block)
8
8
  mock_app do
9
9
  set :views, File.dirname(__FILE__) + '/views'
@@ -26,7 +26,7 @@ class YajlTest < Test::Unit::TestCase
26
26
 
27
27
  it 'raises error if template not found' do
28
28
  mock_app { get('/') { yajl(:no_such_template) } }
29
- assert_raise(Errno::ENOENT) { get('/') }
29
+ assert_raises(Errno::ENOENT) { get('/') }
30
30
  end
31
31
 
32
32
  it 'accepts a :locals option' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-04-08 00:00:00.000000000 Z
14
+ date: 2015-03-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rack
@@ -31,22 +31,22 @@ dependencies:
31
31
  name: tilt
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - "~>"
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '1.3'
37
- - - ">="
37
+ - - "<"
38
38
  - !ruby/object:Gem::Version
39
- version: 1.3.4
39
+ version: '3'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.3'
47
- - - ">="
47
+ - - "<"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.3.4
49
+ version: '3'
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rack-protection
52
52
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ extra_rdoc_files:
81
81
  - LICENSE
82
82
  files:
83
83
  - ".yardopts"
84
- - AUTHORS
84
+ - AUTHORS.md
85
85
  - CHANGES
86
86
  - Gemfile
87
87
  - LICENSE
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  version: '0'
234
234
  requirements: []
235
235
  rubyforge_project:
236
- rubygems_version: 2.0.14
236
+ rubygems_version: 2.4.5
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: Classy web-development dressed in a DSL
@@ -283,4 +283,3 @@ test_files:
283
283
  - test/textile_test.rb
284
284
  - test/wlang_test.rb
285
285
  - test/yajl_test.rb
286
- has_rdoc:
data/AUTHORS DELETED
@@ -1,61 +0,0 @@
1
- Sinatra was designed and developed by Blake Mizerany (bmizerany) in
2
- California.
3
-
4
- Sinatra would not have been possible without strong company backing.
5
- In the past, financial and emotional support have been provided mainly by
6
- [Heroku](http://heroku.com), [GitHub](http://github.com) and
7
- [Engine Yard](http://www.engineyard.com/), and is now taken care of by
8
- [Travis CI](http://travis-ci.com/).
9
-
10
- Special thanks to the following extraordinary individuals, who-out which
11
- Sinatra would not be possible:
12
-
13
- * Ryan Tomayko (rtomayko) for constantly fixing whitespace errors 60d5006
14
- * Ezra Zygmuntowicz (ezmobius) for initial help and letting Blake steal
15
- some of merbs internal code.
16
- * Ari Lerner (http://xnot.org/) for his evangelism, spirit, and gumption
17
- that got Sinatra recognized from Day 1.
18
- * Christopher Schneid (cschneid) for The Book, the blog (gittr.com),
19
- irclogger.com, and a bunch of useful patches.
20
- * Markus Prinz (cypher) for patches over the years, caring about
21
- the README, and hanging in there when times were rough.
22
- * Simon Rozet (sr) for a ton of doc patches, HAML options, and all that
23
- advocacy stuff he's going to do for 1.0.
24
- * Erik Kastner (kastner) for fixing `MIME_TYPES` under Rack 0.5.
25
- * Ben Bleything (bleything) for caring about HTTP status codes and doc fixes.
26
- * Igal Koshevoy (igal) for root path detection under Thin/Passenger.
27
- * Jon Crosby (jcrosby) for coffee breaks, doc fixes, and just because, man.
28
- * Karel Minarik (karmi) for screaming until the website came back up.
29
- * Jeremy Evans (jeremyevans) for unbreaking optional path params (twice!)
30
- * The GitHub guys for stealing Blake's table.
31
- * Nickolas Means (nmeans) for Sass template support.
32
- * Victor Hugo Borja (vic) for splat'n routes specs and doco.
33
- * Avdi Grimm (avdi) for basic RSpec support.
34
- * Jack Danger Canty for a more accurate root directory and for making me
35
- watch [this](http://www.youtube.com/watch?v=ueaHLHgskkw) just now.
36
- * Mathew Walker for making escaped paths work with static files.
37
- * Millions of Us for having the problem that led to Sinatra's conception.
38
- * Songbird for the problems that helped Sinatra's future become realized.
39
- * Rick Olson (technoweenie) for the killer plug at RailsConf '08.
40
- * Steven Garcia for the amazing custom artwork you see on 404's and 500's
41
- * Pat Nakajima (nakajima) for fixing non-nested params in nested params Hash's.
42
- * Konstantin Haase for his hard work and ongoing commitment to improving
43
- Sinatra, for 1.1.0, 1.2.0 and beyond..
44
- * Zachary Scott for adding Konstantin to the AUTHORS file. He also did help
45
- writing the book, but mainly for adding Konstantin.
46
- * Gabriel Andretta for having people wonder whether our documentation is
47
- actually in English or in Spanish.
48
- * Vasily Polovnyov, Nickolay Schwarz, Luciano Sousa, Wu Jiang, Mickael Riga,
49
- Bernhard Essl, Janos Hardi, Kouhei Yanagita and "burningTyger" for willingly
50
- translating whatever ends up in the README.
51
- * [Wordy](http://www.wordy.com/) for proofreading our README. 73e137d
52
- * cactus for digging through code and specs, multiple times.
53
- * Nicolás Sanguinetti (foca) for strong demand of karma and shaping
54
- helpers/register.
55
-
56
- and last but not least:
57
-
58
- * Frank Sinatra (chairman of the board) for having so much class he
59
- deserves a web-framework named after him.
60
-
61
- For a complete list of all contributors to Sinatra itself, run `rake authors`.