sinatra-sinatra 0.9.0.4 → 0.9.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +1 -1
- data/CHANGES +44 -0
- data/README.rdoc +12 -0
- data/Rakefile +2 -1
- data/compat/app_test.rb +3 -2
- data/compat/compat_test.rb +12 -0
- data/lib/sinatra/base.rb +206 -114
- data/lib/sinatra/compat.rb +18 -16
- data/lib/sinatra/main.rb +4 -4
- data/lib/sinatra/test.rb +10 -8
- data/sinatra.gemspec +7 -2
- data/test/base_test.rb +13 -0
- data/test/extensions_test.rb +63 -0
- data/test/helper.rb +13 -2
- data/test/helpers_test.rb +58 -0
- data/test/mapped_error_test.rb +6 -6
- data/test/middleware_test.rb +3 -1
- data/test/response_test.rb +42 -0
- data/test/routing_test.rb +166 -0
- data/test/server_test.rb +41 -0
- data/test/static_test.rb +8 -10
- data/test/test_test.rb +21 -0
- metadata +11 -2
data/AUTHORS
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Sinatra was designed and developed by Blake Mizerany (bmizerany) in
|
2
2
|
California. Continued development would not be possible without the ongoing
|
3
3
|
financial support provided by [Heroku](http://heroku.com) and the emotional
|
4
|
-
support provided by Adam Wiggins (adamwiggins), Chris Wanstrath (defunkt),
|
4
|
+
support provided by Adam Wiggins (adamwiggins) of Heroku, Chris Wanstrath (defunkt),
|
5
5
|
PJ Hyett (pjhyett), and the rest of the GitHub crew.
|
6
6
|
|
7
7
|
Special thanks to the following extraordinary individuals, who-out which
|
data/CHANGES
CHANGED
@@ -1,3 +1,47 @@
|
|
1
|
+
= 0.9.1 / unreleased
|
2
|
+
|
3
|
+
* Sinatra now runs under Ruby 1.9.1 [#61]
|
4
|
+
* Route patterns (splats, :named, or Regexp captures) are now
|
5
|
+
passed as arguments to the block. [#140]
|
6
|
+
* The "helpers" method now takes a variable number of modules
|
7
|
+
along with the normal block syntax. [#133]
|
8
|
+
* New simple API for extensions/plugins to add DSL-level and
|
9
|
+
request-level methods. Use Sinatra.register(mixin) to extend
|
10
|
+
the DSL with all public methods defined in the mixin module;
|
11
|
+
use Sinatra.helpers(mixin) to make all public methods defined
|
12
|
+
in the mixin module available at the request level. [#138]
|
13
|
+
* Added "redirect back" to redirect to the referring URL.
|
14
|
+
* Added a new "clean_trace" option that causes backtraces dumped
|
15
|
+
to rack.errors and displayed on the development error page to
|
16
|
+
omit framework and core library backtrace lines. The option is
|
17
|
+
enabled by default. [#77]
|
18
|
+
* Fix :provides causing crash on any request when request has no
|
19
|
+
Accept header [#139]
|
20
|
+
* Fix that ERB templates were evaluated twice per "erb" call.
|
21
|
+
|
22
|
+
= 0.9.0.4 / 2009-01-25
|
23
|
+
|
24
|
+
* Using halt with more than 1 args causes ArgumentError [#131]
|
25
|
+
* using halt in a before filter doesn't modify response [#127]
|
26
|
+
* Add deprecated Sinatra::EventContext to unbreak plugins [#130]
|
27
|
+
* Give access to GET/POST params in filters [#129]
|
28
|
+
* Preserve non-nested params in nested params hash [#117]
|
29
|
+
* Fix backtrace dump with Rack::Lint [#116]
|
30
|
+
|
31
|
+
= 0.9.0.3 / 2009-01-21
|
32
|
+
|
33
|
+
* Fall back on mongrel then webrick when thin not found. [#75]
|
34
|
+
* Use :environment instead of :env in test helpers to
|
35
|
+
fix deprecation warnings coming from framework.
|
36
|
+
* Make sinatra/test/rspec work again [#113]
|
37
|
+
* Fix app_file detection on windows [#118]
|
38
|
+
* Fix static files with Rack::Lint in pipeline [#121]
|
39
|
+
|
40
|
+
= 0.9.0.2 / 2009-01-18
|
41
|
+
|
42
|
+
* Halting a before block should stop processing of routes [#85]
|
43
|
+
* Fix redirect/halt in before filters [#85]
|
44
|
+
|
1
45
|
= 0.9.0 / 2009-01-18
|
2
46
|
|
3
47
|
* Works with and requires Rack >= 0.9.1
|
data/README.rdoc
CHANGED
@@ -50,6 +50,12 @@ Route patterns may include named parameters, accessible via the
|
|
50
50
|
"Hello #{params[:name]}!"
|
51
51
|
end
|
52
52
|
|
53
|
+
You can also access named parameters via block parameters:
|
54
|
+
|
55
|
+
get '/hello/:name' do |n|
|
56
|
+
"Hello #{n}!"
|
57
|
+
end
|
58
|
+
|
53
59
|
Route patterns may also include splat (or wildcard) parameters, accessible
|
54
60
|
via the <tt>params[:splat]</tt> array.
|
55
61
|
|
@@ -69,6 +75,12 @@ Route matching with Regular Expressions:
|
|
69
75
|
"Hello, #{params[:captures].first}!"
|
70
76
|
end
|
71
77
|
|
78
|
+
Or with a block parameter:
|
79
|
+
|
80
|
+
get %r{/hello/([\w]+)} do |c|
|
81
|
+
"Hello, #{c}!"
|
82
|
+
end
|
83
|
+
|
72
84
|
Routes may include a variety of matching conditions, such as the user agent:
|
73
85
|
|
74
86
|
get '/foo', :agent => /Songbird (\d\.\d)[\d\/]*?/ do
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rake/clean'
|
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'fileutils'
|
4
4
|
|
5
|
-
task :default => :test
|
5
|
+
task :default => [:test]
|
6
6
|
task :spec => :test
|
7
7
|
|
8
8
|
# SPECS ===============================================================
|
@@ -45,6 +45,7 @@ task :install => package('.gem') do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
directory 'dist/'
|
48
|
+
CLOBBER.include('dist')
|
48
49
|
|
49
50
|
file package('.gem') => %w[dist/ sinatra.gemspec] + spec.files do |f|
|
50
51
|
sh "gem build sinatra.gemspec"
|
data/compat/app_test.rb
CHANGED
@@ -8,8 +8,9 @@ context "Sinatra" do
|
|
8
8
|
|
9
9
|
specify "should put all DSL methods on (main)" do
|
10
10
|
object = Object.new
|
11
|
-
|
12
|
-
|
11
|
+
methods = %w[get put post head delete configure template helpers set]
|
12
|
+
methods.each do |method|
|
13
|
+
object.private_methods.map { |m| m.to_sym }.should.include(method.to_sym)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|