sinatra-sinatra 0.9.0.4 → 0.9.0.5

Sign up to get free protection for your applications and to get access to all the features.
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
- Sinatra::Application::FORWARD_METHODS.each do |method|
12
- object.private_methods.should.include(method)
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
 
@@ -0,0 +1,12 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ context "Compat" do
4
+ setup do
5
+ Sinatra.application = nil
6
+ @app = Sinatra.application
7
+ end
8
+
9
+ specify "makes EventContext available" do
10
+ assert_same Sinatra::Default, Sinatra::EventContext
11
+ end
12
+ end