Syd-sinatra 0.3.2 → 0.9.0.2
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 +40 -0
- data/CHANGES +189 -0
- data/README.rdoc +148 -119
- data/Rakefile +34 -10
- data/{test → compat}/app_test.rb +11 -10
- data/{test → compat}/application_test.rb +21 -5
- data/compat/builder_test.rb +101 -0
- data/compat/erb_test.rb +136 -0
- data/{test → compat}/events_test.rb +16 -3
- data/compat/filter_test.rb +30 -0
- data/compat/haml_test.rb +233 -0
- data/compat/helper.rb +30 -0
- data/compat/mapped_error_test.rb +72 -0
- data/{test → compat}/pipeline_test.rb +9 -4
- data/compat/sass_test.rb +57 -0
- data/{test → compat}/streaming_test.rb +4 -1
- data/lib/sinatra/base.rb +843 -0
- data/lib/sinatra/compat.rb +239 -0
- data/lib/sinatra/main.rb +48 -0
- data/lib/sinatra/test/bacon.rb +17 -0
- data/lib/sinatra/test/rspec.rb +7 -8
- data/lib/sinatra/test/spec.rb +3 -4
- data/lib/sinatra/test/unit.rb +3 -5
- data/lib/sinatra/test.rb +114 -0
- data/lib/sinatra.rb +6 -1468
- data/sinatra.gemspec +68 -35
- data/test/base_test.rb +68 -0
- data/test/builder_test.rb +50 -87
- data/test/data/reload_app_file.rb +3 -0
- data/test/erb_test.rb +38 -124
- data/test/filter_test.rb +65 -20
- data/test/haml_test.rb +51 -216
- data/test/helper.rb +23 -5
- data/test/helpers_test.rb +361 -0
- data/test/mapped_error_test.rb +137 -49
- data/test/middleware_test.rb +58 -0
- data/test/options_test.rb +97 -0
- data/test/reload_test.rb +61 -0
- data/test/request_test.rb +18 -0
- data/test/result_test.rb +88 -0
- data/test/routing_test.rb +391 -0
- data/test/sass_test.rb +27 -48
- data/test/sinatra_test.rb +13 -0
- data/test/static_test.rb +57 -0
- data/test/templates_test.rb +88 -0
- data/test/views/hello.builder +1 -0
- data/test/views/hello.erb +1 -0
- data/test/views/hello.haml +1 -0
- data/test/views/hello.sass +2 -0
- data/test/views/hello.test +1 -0
- data/test/views/layout2.builder +3 -0
- data/test/views/layout2.erb +2 -0
- data/test/views/layout2.haml +2 -0
- data/test/views/layout2.test +1 -0
- metadata +79 -47
- data/ChangeLog +0 -78
- data/lib/sinatra/test/methods.rb +0 -76
- data/test/event_context_test.rb +0 -15
- /data/{test → compat}/custom_error_test.rb +0 -0
- /data/{test → compat}/public/foo.xml +0 -0
- /data/{test → compat}/sessions_test.rb +0 -0
- /data/{test → compat}/sym_params_test.rb +0 -0
- /data/{test → compat}/template_test.rb +0 -0
- /data/{test → compat}/use_in_file_templates_test.rb +0 -0
- /data/{test → compat}/views/foo.builder +0 -0
- /data/{test → compat}/views/foo.erb +0 -0
- /data/{test → compat}/views/foo.haml +0 -0
- /data/{test → compat}/views/foo.sass +0 -0
- /data/{test → compat}/views/foo_layout.erb +0 -0
- /data/{test → compat}/views/foo_layout.haml +0 -0
- /data/{test → compat}/views/layout_test/foo.builder +0 -0
- /data/{test → compat}/views/layout_test/foo.erb +0 -0
- /data/{test → compat}/views/layout_test/foo.haml +0 -0
- /data/{test → compat}/views/layout_test/foo.sass +0 -0
- /data/{test → compat}/views/layout_test/layout.builder +0 -0
- /data/{test → compat}/views/layout_test/layout.erb +0 -0
- /data/{test → compat}/views/layout_test/layout.haml +0 -0
- /data/{test → compat}/views/layout_test/layout.sass +0 -0
- /data/{test → compat}/views/no_layout/no_layout.builder +0 -0
- /data/{test → compat}/views/no_layout/no_layout.haml +0 -0
- /data/{images → lib/sinatra/images}/404.png +0 -0
- /data/{images → lib/sinatra/images}/500.png +0 -0
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Syd-sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-18 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,10 +19,10 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.9.1
|
23
23
|
version:
|
24
24
|
description: Classy web-development dressed in a DSL
|
25
|
-
email:
|
25
|
+
email: sinatrarb@googlegroups.com
|
26
26
|
executables: []
|
27
27
|
|
28
28
|
extensions: []
|
@@ -31,53 +31,85 @@ extra_rdoc_files:
|
|
31
31
|
- README.rdoc
|
32
32
|
- LICENSE
|
33
33
|
files:
|
34
|
-
-
|
34
|
+
- AUTHORS
|
35
|
+
- CHANGES
|
35
36
|
- LICENSE
|
36
37
|
- README.rdoc
|
37
38
|
- Rakefile
|
38
|
-
-
|
39
|
-
-
|
39
|
+
- compat/app_test.rb
|
40
|
+
- compat/application_test.rb
|
41
|
+
- compat/builder_test.rb
|
42
|
+
- compat/custom_error_test.rb
|
43
|
+
- compat/erb_test.rb
|
44
|
+
- compat/events_test.rb
|
45
|
+
- compat/filter_test.rb
|
46
|
+
- compat/haml_test.rb
|
47
|
+
- compat/helper.rb
|
48
|
+
- compat/mapped_error_test.rb
|
49
|
+
- compat/pipeline_test.rb
|
50
|
+
- compat/public/foo.xml
|
51
|
+
- compat/sass_test.rb
|
52
|
+
- compat/sessions_test.rb
|
53
|
+
- compat/streaming_test.rb
|
54
|
+
- compat/sym_params_test.rb
|
55
|
+
- compat/template_test.rb
|
56
|
+
- compat/use_in_file_templates_test.rb
|
57
|
+
- compat/views/foo.builder
|
58
|
+
- compat/views/foo.erb
|
59
|
+
- compat/views/foo.haml
|
60
|
+
- compat/views/foo.sass
|
61
|
+
- compat/views/foo_layout.erb
|
62
|
+
- compat/views/foo_layout.haml
|
63
|
+
- compat/views/layout_test/foo.builder
|
64
|
+
- compat/views/layout_test/foo.erb
|
65
|
+
- compat/views/layout_test/foo.haml
|
66
|
+
- compat/views/layout_test/foo.sass
|
67
|
+
- compat/views/layout_test/layout.builder
|
68
|
+
- compat/views/layout_test/layout.erb
|
69
|
+
- compat/views/layout_test/layout.haml
|
70
|
+
- compat/views/layout_test/layout.sass
|
71
|
+
- compat/views/no_layout/no_layout.builder
|
72
|
+
- compat/views/no_layout/no_layout.haml
|
40
73
|
- lib/sinatra.rb
|
41
|
-
- lib/sinatra/
|
74
|
+
- lib/sinatra/base.rb
|
75
|
+
- lib/sinatra/compat.rb
|
76
|
+
- lib/sinatra/images/404.png
|
77
|
+
- lib/sinatra/images/500.png
|
78
|
+
- lib/sinatra/main.rb
|
79
|
+
- lib/sinatra/test.rb
|
80
|
+
- lib/sinatra/test/bacon.rb
|
42
81
|
- lib/sinatra/test/rspec.rb
|
43
82
|
- lib/sinatra/test/spec.rb
|
44
83
|
- lib/sinatra/test/unit.rb
|
45
84
|
- sinatra.gemspec
|
46
|
-
- test/
|
47
|
-
- test/application_test.rb
|
85
|
+
- test/base_test.rb
|
48
86
|
- test/builder_test.rb
|
49
|
-
- test/
|
87
|
+
- test/data/reload_app_file.rb
|
50
88
|
- test/erb_test.rb
|
51
|
-
- test/event_context_test.rb
|
52
|
-
- test/events_test.rb
|
53
89
|
- test/filter_test.rb
|
54
90
|
- test/haml_test.rb
|
55
91
|
- test/helper.rb
|
92
|
+
- test/helpers_test.rb
|
56
93
|
- test/mapped_error_test.rb
|
57
|
-
- test/
|
58
|
-
- test/
|
94
|
+
- test/middleware_test.rb
|
95
|
+
- test/options_test.rb
|
96
|
+
- test/reload_test.rb
|
97
|
+
- test/request_test.rb
|
98
|
+
- test/result_test.rb
|
99
|
+
- test/routing_test.rb
|
59
100
|
- test/sass_test.rb
|
60
|
-
- test/
|
61
|
-
- test/
|
62
|
-
- test/
|
63
|
-
- test/
|
64
|
-
- test/
|
65
|
-
- test/views/
|
66
|
-
- test/views/
|
67
|
-
- test/views/
|
68
|
-
- test/views/
|
69
|
-
- test/views/
|
70
|
-
- test/views/
|
71
|
-
- test/views/
|
72
|
-
- test/views/layout_test/foo.erb
|
73
|
-
- test/views/layout_test/foo.haml
|
74
|
-
- test/views/layout_test/foo.sass
|
75
|
-
- test/views/layout_test/layout.builder
|
76
|
-
- test/views/layout_test/layout.erb
|
77
|
-
- test/views/layout_test/layout.haml
|
78
|
-
- test/views/layout_test/layout.sass
|
79
|
-
- test/views/no_layout/no_layout.builder
|
80
|
-
- test/views/no_layout/no_layout.haml
|
101
|
+
- test/sinatra_test.rb
|
102
|
+
- test/static_test.rb
|
103
|
+
- test/templates_test.rb
|
104
|
+
- test/views/hello.builder
|
105
|
+
- test/views/hello.erb
|
106
|
+
- test/views/hello.haml
|
107
|
+
- test/views/hello.sass
|
108
|
+
- test/views/hello.test
|
109
|
+
- test/views/layout2.builder
|
110
|
+
- test/views/layout2.erb
|
111
|
+
- test/views/layout2.haml
|
112
|
+
- test/views/layout2.test
|
81
113
|
has_rdoc: true
|
82
114
|
homepage: http://sinatra.rubyforge.org
|
83
115
|
post_install_message:
|
@@ -110,20 +142,20 @@ signing_key:
|
|
110
142
|
specification_version: 2
|
111
143
|
summary: Classy web-development dressed in a DSL
|
112
144
|
test_files:
|
113
|
-
- test/
|
114
|
-
- test/application_test.rb
|
145
|
+
- test/base_test.rb
|
115
146
|
- test/builder_test.rb
|
116
|
-
- test/custom_error_test.rb
|
117
147
|
- test/erb_test.rb
|
118
|
-
- test/event_context_test.rb
|
119
|
-
- test/events_test.rb
|
120
148
|
- test/filter_test.rb
|
121
149
|
- test/haml_test.rb
|
150
|
+
- test/helpers_test.rb
|
122
151
|
- test/mapped_error_test.rb
|
123
|
-
- test/
|
152
|
+
- test/middleware_test.rb
|
153
|
+
- test/options_test.rb
|
154
|
+
- test/reload_test.rb
|
155
|
+
- test/request_test.rb
|
156
|
+
- test/result_test.rb
|
157
|
+
- test/routing_test.rb
|
124
158
|
- test/sass_test.rb
|
125
|
-
- test/
|
126
|
-
- test/
|
127
|
-
- test/
|
128
|
-
- test/template_test.rb
|
129
|
-
- test/use_in_file_templates_test.rb
|
159
|
+
- test/sinatra_test.rb
|
160
|
+
- test/static_test.rb
|
161
|
+
- test/templates_test.rb
|
data/ChangeLog
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
= 0.3.2
|
2
|
-
|
3
|
-
* BUG: Static and send_file read entire file into String before
|
4
|
-
sending. Updated to stream with 8K chunks instead.
|
5
|
-
|
6
|
-
* Rake tasks and assets for building basic documentation website.
|
7
|
-
See http://sinatra.rubyforge.org
|
8
|
-
|
9
|
-
* Various minor doc fixes.
|
10
|
-
|
11
|
-
= 0.3.1
|
12
|
-
|
13
|
-
* Unbreak optional path parameters [jeremyevans]
|
14
|
-
|
15
|
-
= 0.3.0
|
16
|
-
|
17
|
-
* Add sinatra.gemspec w/ support for github gem builds. Forks can now
|
18
|
-
enable the build gem option in github to get free username-sinatra.gem
|
19
|
-
builds: gem install username-sinatra.gem --source=http://gems.github.com/
|
20
|
-
|
21
|
-
* Require rack-0.4 gem; removes frozen rack dir.
|
22
|
-
|
23
|
-
* Basic RSpec support; require 'sinatra/test/rspec' instead of
|
24
|
-
'sinatra/test/spec' to use. [avdi]
|
25
|
-
|
26
|
-
* before filters can modify request environment vars used for
|
27
|
-
routing (e.g., PATH_INFO, REQUEST_METHOD, etc.) for URL rewriting
|
28
|
-
type functionality.
|
29
|
-
|
30
|
-
* In-file templates now uses @@ instead of ## as template separator.
|
31
|
-
|
32
|
-
* Top-level environment test predicates: development?, test?, production?
|
33
|
-
|
34
|
-
* Top-level "set", "enable", and "disable" methods for tweaking
|
35
|
-
app options. [rtomayko]
|
36
|
-
|
37
|
-
* Top-level "use" method for building Rack middleware pipelines
|
38
|
-
leading to app. See README for usage. [rtomayko]
|
39
|
-
|
40
|
-
* New "reload" option - set false to disable reloading in development.
|
41
|
-
|
42
|
-
* New "host" option - host/ip to bind to [cschneid]
|
43
|
-
|
44
|
-
* New "app_file" option - override the file to reload in development
|
45
|
-
mode [cschneid]
|
46
|
-
|
47
|
-
* Development error/not_found page cleanup [sr, adamwiggins]
|
48
|
-
|
49
|
-
* Remove a bunch of core extensions (String#to_param, String#from_param,
|
50
|
-
Hash#from_params, Hash#to_params, Hash#symbolize_keys, Hash#pass)
|
51
|
-
|
52
|
-
* Various grammar and formatting fixes to README; additions on
|
53
|
-
community and contributing [cypher]
|
54
|
-
|
55
|
-
* Build RDoc using Hanna template: http://sinatrarb.rubyforge.org/api
|
56
|
-
|
57
|
-
* Specs, documentation and fixes for splat'n routes [vic]
|
58
|
-
|
59
|
-
* Fix whitespace errors across all source files. [rtomayko]
|
60
|
-
|
61
|
-
* Fix streaming issues with Mongrel (body not closed). [bmizerany]
|
62
|
-
|
63
|
-
* Fix various issues with environment not being set properly (configure
|
64
|
-
blocks not running, error pages not registering, etc.) [cypher]
|
65
|
-
|
66
|
-
* Fix to allow locals to be passed to ERB templates [cschneid]
|
67
|
-
|
68
|
-
* Fix locking issues causing random errors during reload in development.
|
69
|
-
|
70
|
-
* Fix for escaped paths not resolving static files [Matthew Walker]
|
71
|
-
|
72
|
-
= 0.2.1
|
73
|
-
|
74
|
-
* File upload fix and minor tweaks.
|
75
|
-
|
76
|
-
= 0.2.0
|
77
|
-
|
78
|
-
* Initial gem release of 0.2 coebase.
|
data/lib/sinatra/test/methods.rb
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
module Sinatra
|
2
|
-
|
3
|
-
module Test
|
4
|
-
|
5
|
-
module Methods
|
6
|
-
include Rack::Utils
|
7
|
-
|
8
|
-
ENV_KEY_NAMES = {
|
9
|
-
:accept => "HTTP_ACCEPT",
|
10
|
-
:agent => "HTTP_USER_AGENT",
|
11
|
-
:host => "HTTP_HOST",
|
12
|
-
:session => "HTTP_COOKIE",
|
13
|
-
:cookies => "HTTP_COOKIE",
|
14
|
-
:content_type => "CONTENT_TYPE"
|
15
|
-
}
|
16
|
-
|
17
|
-
def session(data, key = 'rack.session')
|
18
|
-
data = data.from_params if data.respond_to?(:from_params)
|
19
|
-
"#{escape(key)}=#{[Marshal.dump(data)].pack("m*")}"
|
20
|
-
end
|
21
|
-
|
22
|
-
def normalize_rack_environment(env)
|
23
|
-
env.inject({}) do |hash,(k,v)|
|
24
|
-
hash[ENV_KEY_NAMES[k] || k] = v
|
25
|
-
hash
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def hash_to_param_string(hash)
|
30
|
-
hash.map { |pair| pair.map{|v|escape(v)}.join('=') }.join('&')
|
31
|
-
end
|
32
|
-
|
33
|
-
%w(get head post put delete).each do |verb|
|
34
|
-
http_method = verb.upcase
|
35
|
-
define_method("#{verb}_it") do |path, *args|
|
36
|
-
@request = Rack::MockRequest.new(Sinatra.build_application)
|
37
|
-
opts, input =
|
38
|
-
case args.size
|
39
|
-
when 2 # input, env
|
40
|
-
input, env = args
|
41
|
-
[env, input]
|
42
|
-
when 1 # params
|
43
|
-
if (data = args.first).kind_of?(Hash)
|
44
|
-
env = (data.delete(:env) || {})
|
45
|
-
[env, hash_to_param_string(data)]
|
46
|
-
else
|
47
|
-
[{}, data]
|
48
|
-
end
|
49
|
-
when 0
|
50
|
-
[{}, '']
|
51
|
-
else
|
52
|
-
raise ArgumentError, "zero, one, or two arguments expected"
|
53
|
-
end
|
54
|
-
opts = normalize_rack_environment(opts)
|
55
|
-
opts[:input] ||= input
|
56
|
-
@response = @request.request(http_method, path, opts)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def follow!
|
61
|
-
get_it(@response.location)
|
62
|
-
end
|
63
|
-
|
64
|
-
def method_missing(name, *args)
|
65
|
-
if @response.respond_to?(name)
|
66
|
-
@response.send(name, *args)
|
67
|
-
else
|
68
|
-
super
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
data/test/event_context_test.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/helper'
|
2
|
-
|
3
|
-
context "EventContext" do
|
4
|
-
|
5
|
-
specify "DSLified setters" do
|
6
|
-
|
7
|
-
cx = Sinatra::EventContext.new(stub_everything, Rack::Response.new, {})
|
8
|
-
lambda {
|
9
|
-
cx.status 404
|
10
|
-
}.should.not.raise(ArgumentError)
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|