sinatra 1.0.b → 1.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.

data/CHANGES CHANGED
@@ -65,6 +65,9 @@
65
65
 
66
66
  * Filters do not run when serving static files anymore. (Ryan Tomayko)
67
67
 
68
+ * pass takes an optional block to be used as the route handler if no
69
+ subsequent route matches the request. (Blake Mizerany)
70
+
68
71
  The following Sinatra features have been obsoleted (removed entirely) in
69
72
  the 1.0 release:
70
73
 
@@ -19,7 +19,7 @@ rescue LoadError
19
19
  end
20
20
 
21
21
  module Sinatra
22
- VERSION = '1.0.b'
22
+ VERSION = '1.0'
23
23
 
24
24
  # The request object. See Rack::Request for more info:
25
25
  # http://rack.rubyforge.org/doc/classes/Rack/Request.html
@@ -648,21 +648,11 @@ module Sinatra
648
648
  end
649
649
 
650
650
  def dump_errors!(boom)
651
- backtrace = clean_backtrace(boom.backtrace)
652
651
  msg = ["#{boom.class} - #{boom.message}:",
653
- *backtrace].join("\n ")
652
+ *boom.backtrace].join("\n ")
654
653
  @env['rack.errors'].puts(msg)
655
654
  end
656
655
 
657
- def clean_backtrace(trace)
658
- return trace unless settings.clean_trace?
659
-
660
- trace.reject { |line|
661
- line =~ /lib\/sinatra.*\.rb/ ||
662
- (defined?(Gem) && line.include?(Gem.dir))
663
- }.map! { |line| line.gsub(/^\.\//, '') }
664
- end
665
-
666
656
  class << self
667
657
  attr_reader :routes, :before_filters, :after_filters, :templates, :errors
668
658
 
@@ -1053,7 +1043,6 @@ module Sinatra
1053
1043
  set :raise_errors, Proc.new { test? }
1054
1044
  set :dump_errors, Proc.new { !test? }
1055
1045
  set :show_exceptions, Proc.new { development? }
1056
- set :clean_trace, true
1057
1046
  set :sessions, false
1058
1047
  set :logging, false
1059
1048
  set :method_override, false
@@ -3,8 +3,8 @@ 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.0.b'
7
- s.date = '2010-03-07'
6
+ s.version = '1.0'
7
+ s.date = '2010-03-23'
8
8
 
9
9
  s.description = "Classy web-development dressed in a DSL"
10
10
  s.summary = "Classy web-development dressed in a DSL"
@@ -1,4 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
+
3
+ begin
2
4
  require 'haml'
3
5
 
4
6
  class HAMLTest < Test::Unit::TestCase
@@ -88,3 +90,6 @@ class HAMLTest < Test::Unit::TestCase
88
90
  assert_match(/^<!DOCTYPE html PUBLIC (.*) HTML 4.01/, body)
89
91
  end
90
92
  end
93
+ rescue
94
+ warn "#{$!.to_s}: skipping haml tests"
95
+ end
@@ -1,4 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
+
3
+ begin
2
4
  require 'sass'
3
5
 
4
6
  class SassTest < Test::Unit::TestCase
@@ -77,3 +79,7 @@ class SassTest < Test::Unit::TestCase
77
79
  assert_equal "#sass {\n background-color: #FFF;\n color: #000;\n}\n", body
78
80
  end
79
81
  end
82
+
83
+ rescue
84
+ warn "#{$!.to_s}: skipping sass tests"
85
+ end
@@ -135,52 +135,6 @@ class SettingsTest < Test::Unit::TestCase
135
135
  end
136
136
  end
137
137
 
138
- describe 'clean_trace' do
139
- def clean_backtrace(trace)
140
- Sinatra::Base.new.send(:clean_backtrace, trace)
141
- end
142
-
143
- it 'is enabled on Base' do
144
- assert @base.clean_trace?
145
- end
146
-
147
- it 'is enabled on Application' do
148
- assert @application.clean_trace?
149
- end
150
-
151
- it 'does nothing when disabled' do
152
- backtrace = [
153
- "./lib/sinatra/base.rb",
154
- "./myapp:42",
155
- ("#{Gem.dir}/some/lib.rb" if defined?(Gem))
156
- ].compact
157
-
158
- klass = Class.new(Sinatra::Base)
159
- klass.disable :clean_trace
160
-
161
- assert_equal backtrace, klass.new.send(:clean_backtrace, backtrace)
162
- end
163
-
164
- it 'removes sinatra lib paths from backtrace when enabled' do
165
- backtrace = [
166
- "./lib/sinatra/base.rb",
167
- "./lib/sinatra/compat.rb:42",
168
- "./lib/sinatra/main.rb:55 in `foo'"
169
- ]
170
- assert clean_backtrace(backtrace).empty?
171
- end
172
-
173
- it 'removes ./ prefix from backtrace paths when enabled' do
174
- assert_equal ['myapp.rb:42'], clean_backtrace(['./myapp.rb:42'])
175
- end
176
-
177
- if defined?(Gem)
178
- it 'removes gem lib paths from backtrace when enabled' do
179
- assert clean_backtrace(["#{Gem.dir}/some/lib"]).empty?
180
- end
181
- end
182
- end
183
-
184
138
  describe 'run' do
185
139
  it 'is disabled on Base' do
186
140
  assert ! @base.run?
metadata CHANGED
@@ -1,12 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - b
9
- version: 1.0.b
8
+ version: "1.0"
10
9
  platform: ruby
11
10
  authors:
12
11
  - Blake Mizerany
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-03-07 00:00:00 -08:00
18
+ date: 2010-03-23 00:00:00 -07:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -203,13 +202,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
202
  version: "0"
204
203
  required_rubygems_version: !ruby/object:Gem::Requirement
205
204
  requirements:
206
- - - ">"
205
+ - - ">="
207
206
  - !ruby/object:Gem::Version
208
207
  segments:
209
- - 1
210
- - 3
211
- - 1
212
- version: 1.3.1
208
+ - 0
209
+ version: "0"
213
210
  requirements: []
214
211
 
215
212
  rubyforge_project: sinatra