sinatra 1.2.8 → 1.2.9

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.

data/CHANGES CHANGED
@@ -1,3 +1,17 @@
1
+ = 1.2.9 (backports release) / 2013-03-15
2
+
3
+ IMPORTANT: THIS IS THE LAST 1.2.x RELEASE, PLEASE UPGRADE.
4
+
5
+ * Display EOL warning when loading Sinatra. (Konstantin Haase)
6
+
7
+ * Improve documentation. (Anurag Priyam, Konstantin Haase)
8
+
9
+ * Do not modify the load path. (Konstantin Haase)
10
+
11
+ * Display deprecation warning if RUBY_IGNORE_CALLERS is used. (Konstantin Haase)
12
+
13
+ * Add backports library so we can still run on Ruby 1.8.6. (Konstantin Haase)
14
+
1
15
  = 1.2.8 (backports release) / 2011-12-30
2
16
 
3
17
  Backported from 1.3.2:
data/Gemfile CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  RUBY_ENGINE = 'ruby' unless defined? RUBY_ENGINE
10
10
  source :rubygems unless ENV['QUICK']
11
+ gemspec
11
12
 
12
13
  gem 'rake', '~> 0.8.7'
13
14
  gem 'rack-test', '>= 0.5.6'
@@ -28,12 +29,13 @@ end
28
29
  gem 'haml', '~> 3.0.0', :group => 'haml'
29
30
  gem 'builder', :group => 'builder'
30
31
  gem 'erubis', :group => 'erubis'
31
- gem 'less', '~> 1.0', :group => 'less'
32
32
  gem 'liquid', :group => 'liquid'
33
- gem 'slim', :group => 'slim'
34
- gem 'RedCloth', :group => 'redcloth' if RUBY_VERSION < "1.9.3" and RUBY_ENGINE != 'macruby'
35
33
 
36
34
  if RUBY_VERSION > '1.8.6'
35
+ #gem 'less', '~> 1.0', :group => 'less'
36
+ gem 'slim', :group => 'slim'
37
+ gem 'RedCloth', :group => 'redcloth' if RUBY_VERSION < "1.9.3" and RUBY_ENGINE != 'macruby'
38
+
37
39
  if RUBY_ENGINE == 'jruby'
38
40
  gem 'nokogiri', '!= 1.5.0'
39
41
  elsif RUBY_ENGINE != 'maglev'
@@ -41,20 +43,14 @@ if RUBY_VERSION > '1.8.6'
41
43
  end
42
44
  gem 'coffee-script', '>= 2.0', :group => 'coffee-script'
43
45
  gem 'rdoc', '< 3.10', :group => 'rdoc'
44
- end
45
-
46
- platforms :ruby do
47
- gem 'rdiscount', :group => 'rdiscount'
48
- end
49
46
 
50
- platforms :ruby_18, :jruby do
51
- gem 'json', :group => 'coffee-script'
52
- gem 'markaby', :group => 'markaby'
53
- gem 'radius', :group => 'radius'
54
- end
47
+ platforms :ruby do
48
+ gem 'rdiscount', :group => 'rdiscount'
49
+ end
55
50
 
56
- platforms :mri_18 do
57
- # bundler platforms are broken
58
- next unless RUBY_ENGINE == 'ruby'
59
- gem 'rcov', :group => 'rcov'
51
+ if RUBY_VERSION < '1.9'
52
+ gem 'json', :group => 'coffee-script'
53
+ gem 'markaby', :group => 'markaby'
54
+ gem 'radius', :group => 'radius'
55
+ end
60
56
  end
@@ -801,6 +801,20 @@ route handlers and templates:
801
801
  bar(params[:name])
802
802
  end
803
803
 
804
+ Alternatively, helper methods can be separately defined in a module:
805
+
806
+ module FooUtils
807
+ def foo(name) "#{name}foo" end
808
+ end
809
+
810
+ module BarUtils
811
+ def bar(name) "#{name}bar" end
812
+ end
813
+
814
+ helpers FooUtils, BarUtils
815
+
816
+ The effect is the same as including the modules in the application class.
817
+
804
818
  === Using Sessions
805
819
 
806
820
  A session is used to keep state during requests. If activated, you have one
@@ -1,6 +1,3 @@
1
- libdir = File.dirname(__FILE__)
2
- $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
3
-
4
1
  require 'sinatra/base'
5
2
  require 'sinatra/main'
6
3
 
@@ -5,9 +5,12 @@ require 'rack'
5
5
  require 'rack/builder'
6
6
  require 'sinatra/showexceptions'
7
7
  require 'tilt'
8
+ require 'backports'
9
+
10
+ warn "WARNING: Sinatra 1.2.x has reached its EOL. Please upgrade."
8
11
 
9
12
  module Sinatra
10
- VERSION = '1.2.8'
13
+ VERSION = '1.2.9'
11
14
 
12
15
  # The request object. See Rack::Request for more info:
13
16
  # http://rack.rubyforge.org/doc/classes/Rack/Request.html
@@ -1092,7 +1095,7 @@ module Sinatra
1092
1095
  public_folder
1093
1096
  end
1094
1097
 
1095
- private
1098
+ private
1096
1099
  # Condition for matching host name. Parameter might be String or Regexp.
1097
1100
  def host_name(pattern)
1098
1101
  condition { pattern === request.host }
@@ -1343,8 +1346,11 @@ module Sinatra
1343
1346
  /<internal:/ # internal in ruby >= 1.9.2
1344
1347
  ]
1345
1348
 
1346
- # add rubinius (and hopefully other VM impls) ignore patterns ...
1347
- CALLERS_TO_IGNORE.concat(RUBY_IGNORE_CALLERS) if defined?(RUBY_IGNORE_CALLERS)
1349
+ # contrary to what the comment said previously, rubinius never supported this
1350
+ if defined?(RUBY_IGNORE_CALLERS)
1351
+ warn "RUBY_IGNORE_CALLERS is deprecated and will no longer be supported by Sinatra 2.0"
1352
+ CALLERS_TO_IGNORE.concat(RUBY_IGNORE_CALLERS)
1353
+ end
1348
1354
 
1349
1355
  # Like Kernel#caller but excluding certain magic entries and without
1350
1356
  # line / method information; the resulting array contains filenames only.
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'sinatra'
6
- s.version = '1.2.8'
6
+ s.version = '1.2.9'
7
7
 
8
8
  s.description = "Classy web-development dressed in a DSL"
9
9
  s.summary = "Classy web-development dressed in a DSL"
@@ -122,8 +122,9 @@ Gem::Specification.new do |s|
122
122
  s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/}
123
123
 
124
124
  s.extra_rdoc_files = %w[README.rdoc README.de.rdoc README.jp.rdoc README.fr.rdoc README.es.rdoc README.hu.rdoc README.zh.rdoc LICENSE]
125
- s.add_dependency 'rack', '~> 1.1'
125
+ s.add_dependency 'rack', '~> 1.1', '< 1.5'
126
126
  s.add_dependency 'tilt', '>= 1.2.2', '< 2.0'
127
+ s.add_dependency 'backports'
127
128
  s.add_development_dependency 'shotgun', '~> 0.6'
128
129
 
129
130
  s.homepage = "http://sinatra.rubyforge.org"
@@ -739,7 +739,7 @@ class HelpersTest < Test::Unit::TestCase
739
739
  get '/compare', {}, { 'HTTP_IF_MODIFIED_SINCE' => 'Sun, 26 Sep 2010 23:43:52 GMT' }
740
740
  assert_equal 200, status
741
741
  assert_equal 'foo', body
742
- get '/compare', {}, { 'HTTP_IF_MODIFIED_SINCE' => 'Sun, 26 Sep 2100 23:43:52 GMT' }
742
+ get '/compare', {}, { 'HTTP_IF_MODIFIED_SINCE' => 'Sun, 26 Sep 2012 23:43:52 GMT' }
743
743
  assert_equal 304, status
744
744
  assert_equal '', body
745
745
  end
@@ -227,6 +227,12 @@ class RoutingTest < Test::Unit::TestCase
227
227
  assert_equal "format=", body
228
228
  end
229
229
 
230
+ it 'does not concatinate params with the same name' do
231
+ mock_app { get('/:foo') { params[:foo] } }
232
+ get '/a?foo=b'
233
+ assert_body 'a'
234
+ end
235
+
230
236
  it "supports single splat params like /*" do
231
237
  mock_app {
232
238
  get '/*' do
metadata CHANGED
@@ -1,10 +1,15 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sinatra
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 13
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 9
10
+ version: 1.2.9
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Blake Mizerany
9
14
  - Ryan Tomayko
10
15
  - Simon Rozet
@@ -12,49 +17,91 @@ authors:
12
17
  autorequire:
13
18
  bindir: bin
14
19
  cert_chain: []
15
- date: 2011-12-30 00:00:00.000000000 Z
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: rack
19
- requirement: &2152939680 !ruby/object:Gem::Requirement
20
+
21
+ date: 2013-03-15 00:00:00 +01:00
22
+ default_executable:
23
+ dependencies:
24
+ - !ruby/object:Gem::Dependency
25
+ requirement: &id001 !ruby/object:Gem::Requirement
20
26
  none: false
21
- requirements:
27
+ requirements:
22
28
  - - ~>
23
- - !ruby/object:Gem::Version
24
- version: '1.1'
25
- type: :runtime
29
+ - !ruby/object:Gem::Version
30
+ hash: 13
31
+ segments:
32
+ - 1
33
+ - 1
34
+ version: "1.1"
35
+ - - <
36
+ - !ruby/object:Gem::Version
37
+ hash: 5
38
+ segments:
39
+ - 1
40
+ - 5
41
+ version: "1.5"
42
+ version_requirements: *id001
43
+ name: rack
26
44
  prerelease: false
27
- version_requirements: *2152939680
28
- - !ruby/object:Gem::Dependency
29
- name: tilt
30
- requirement: &2152938920 !ruby/object:Gem::Requirement
45
+ type: :runtime
46
+ - !ruby/object:Gem::Dependency
47
+ requirement: &id002 !ruby/object:Gem::Requirement
31
48
  none: false
32
- requirements:
33
- - - ! '>='
34
- - !ruby/object:Gem::Version
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ hash: 27
53
+ segments:
54
+ - 1
55
+ - 2
56
+ - 2
35
57
  version: 1.2.2
36
58
  - - <
37
- - !ruby/object:Gem::Version
38
- version: '2.0'
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 2
63
+ - 0
64
+ version: "2.0"
65
+ version_requirements: *id002
66
+ name: tilt
67
+ prerelease: false
39
68
  type: :runtime
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: &id003 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ version_requirements: *id003
80
+ name: backports
40
81
  prerelease: false
41
- version_requirements: *2152938920
42
- - !ruby/object:Gem::Dependency
43
- name: shotgun
44
- requirement: &2152937800 !ruby/object:Gem::Requirement
82
+ type: :runtime
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: &id004 !ruby/object:Gem::Requirement
45
85
  none: false
46
- requirements:
86
+ requirements:
47
87
  - - ~>
48
- - !ruby/object:Gem::Version
49
- version: '0.6'
50
- type: :development
88
+ - !ruby/object:Gem::Version
89
+ hash: 7
90
+ segments:
91
+ - 0
92
+ - 6
93
+ version: "0.6"
94
+ version_requirements: *id004
95
+ name: shotgun
51
96
  prerelease: false
52
- version_requirements: *2152937800
97
+ type: :development
53
98
  description: Classy web-development dressed in a DSL
54
99
  email: sinatrarb@googlegroups.com
55
100
  executables: []
101
+
56
102
  extensions: []
57
- extra_rdoc_files:
103
+
104
+ extra_rdoc_files:
58
105
  - README.rdoc
59
106
  - README.de.rdoc
60
107
  - README.jp.rdoc
@@ -63,7 +110,7 @@ extra_rdoc_files:
63
110
  - README.hu.rdoc
64
111
  - README.zh.rdoc
65
112
  - LICENSE
66
- files:
113
+ files:
67
114
  - AUTHORS
68
115
  - CHANGES
69
116
  - Gemfile
@@ -167,40 +214,46 @@ files:
167
214
  - test/views/layout2.test
168
215
  - test/views/nested.str
169
216
  - test/views/utf8.erb
217
+ has_rdoc: true
170
218
  homepage: http://sinatra.rubyforge.org
171
219
  licenses: []
220
+
172
221
  post_install_message:
173
- rdoc_options:
222
+ rdoc_options:
174
223
  - --line-numbers
175
224
  - --inline-source
176
225
  - --title
177
226
  - Sinatra
178
227
  - --main
179
228
  - README.rdoc
180
- require_paths:
229
+ require_paths:
181
230
  - lib
182
- required_ruby_version: !ruby/object:Gem::Requirement
231
+ required_ruby_version: !ruby/object:Gem::Requirement
183
232
  none: false
184
- requirements:
185
- - - ! '>='
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- segments:
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ hash: 3
237
+ segments:
189
238
  - 0
190
- hash: -1174004778160710546
191
- required_rubygems_version: !ruby/object:Gem::Requirement
239
+ version: "0"
240
+ required_rubygems_version: !ruby/object:Gem::Requirement
192
241
  none: false
193
- requirements:
194
- - - ! '>='
195
- - !ruby/object:Gem::Version
196
- version: '0'
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ hash: 3
246
+ segments:
247
+ - 0
248
+ version: "0"
197
249
  requirements: []
250
+
198
251
  rubyforge_project: sinatra
199
- rubygems_version: 1.8.10
252
+ rubygems_version: 1.6.2
200
253
  signing_key:
201
254
  specification_version: 2
202
255
  summary: Classy web-development dressed in a DSL
203
- test_files:
256
+ test_files:
204
257
  - test/base_test.rb
205
258
  - test/builder_test.rb
206
259
  - test/coffee_test.rb