roda 3.28.0 → 3.33.0

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.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +40 -0
  3. data/README.rdoc +15 -1
  4. data/doc/conventions.rdoc +17 -8
  5. data/doc/release_notes/3.29.0.txt +15 -0
  6. data/doc/release_notes/3.30.0.txt +14 -0
  7. data/doc/release_notes/3.31.0.txt +11 -0
  8. data/doc/release_notes/3.32.0.txt +42 -0
  9. data/doc/release_notes/3.33.0.txt +8 -0
  10. data/lib/roda.rb +3 -0
  11. data/lib/roda/plugins/_symbol_regexp_matchers.rb +2 -0
  12. data/lib/roda/plugins/assets.rb +26 -5
  13. data/lib/roda/plugins/caching.rb +2 -0
  14. data/lib/roda/plugins/common_logger.rb +1 -1
  15. data/lib/roda/plugins/content_security_policy.rb +2 -0
  16. data/lib/roda/plugins/default_headers.rb +2 -0
  17. data/lib/roda/plugins/exception_page.rb +9 -5
  18. data/lib/roda/plugins/hash_matcher.rb +1 -1
  19. data/lib/roda/plugins/header_matchers.rb +5 -1
  20. data/lib/roda/plugins/indifferent_params.rb +4 -0
  21. data/lib/roda/plugins/partials.rb +33 -6
  22. data/lib/roda/plugins/path.rb +42 -15
  23. data/lib/roda/plugins/placeholder_string_matchers.rb +2 -0
  24. data/lib/roda/plugins/public.rb +25 -17
  25. data/lib/roda/plugins/relative_path.rb +73 -0
  26. data/lib/roda/plugins/render.rb +17 -5
  27. data/lib/roda/plugins/render_each.rb +11 -3
  28. data/lib/roda/plugins/run_append_slash.rb +1 -1
  29. data/lib/roda/plugins/symbol_matchers.rb +2 -2
  30. data/lib/roda/version.rb +1 -1
  31. metadata +13 -214
  32. data/Rakefile +0 -108
  33. data/doc/release_notes/1.0.0.txt +0 -329
  34. data/doc/release_notes/1.1.0.txt +0 -226
  35. data/doc/release_notes/1.2.0.txt +0 -406
  36. data/doc/release_notes/1.3.0.txt +0 -109
  37. data/doc/release_notes/2.0.0.txt +0 -75
  38. data/doc/release_notes/2.1.0.txt +0 -124
  39. data/doc/release_notes/2.10.0.txt +0 -27
  40. data/doc/release_notes/2.11.0.txt +0 -70
  41. data/doc/release_notes/2.12.0.txt +0 -40
  42. data/doc/release_notes/2.13.0.txt +0 -10
  43. data/doc/release_notes/2.14.0.txt +0 -44
  44. data/doc/release_notes/2.15.0.txt +0 -53
  45. data/doc/release_notes/2.16.0.txt +0 -48
  46. data/doc/release_notes/2.17.0.txt +0 -62
  47. data/doc/release_notes/2.18.0.txt +0 -69
  48. data/doc/release_notes/2.19.0.txt +0 -30
  49. data/doc/release_notes/2.2.0.txt +0 -97
  50. data/doc/release_notes/2.20.0.txt +0 -5
  51. data/doc/release_notes/2.21.0.txt +0 -17
  52. data/doc/release_notes/2.22.0.txt +0 -41
  53. data/doc/release_notes/2.23.0.txt +0 -29
  54. data/doc/release_notes/2.24.0.txt +0 -65
  55. data/doc/release_notes/2.25.0.txt +0 -14
  56. data/doc/release_notes/2.26.0.txt +0 -13
  57. data/doc/release_notes/2.27.0.txt +0 -56
  58. data/doc/release_notes/2.28.0.txt +0 -17
  59. data/doc/release_notes/2.29.0.txt +0 -156
  60. data/doc/release_notes/2.3.0.txt +0 -109
  61. data/doc/release_notes/2.4.0.txt +0 -55
  62. data/doc/release_notes/2.5.0.txt +0 -23
  63. data/doc/release_notes/2.5.1.txt +0 -4
  64. data/doc/release_notes/2.6.0.txt +0 -21
  65. data/doc/release_notes/2.7.0.txt +0 -75
  66. data/doc/release_notes/2.8.0.txt +0 -44
  67. data/doc/release_notes/2.9.0.txt +0 -6
  68. data/spec/all.rb +0 -1
  69. data/spec/assets/css/app.scss +0 -1
  70. data/spec/assets/css/no_access.css +0 -1
  71. data/spec/assets/css/raw.css +0 -1
  72. data/spec/assets/js/head/app.js +0 -1
  73. data/spec/composition_spec.rb +0 -31
  74. data/spec/define_roda_method_spec.rb +0 -274
  75. data/spec/env_spec.rb +0 -11
  76. data/spec/freeze_spec.rb +0 -37
  77. data/spec/integration_spec.rb +0 -209
  78. data/spec/matchers_spec.rb +0 -832
  79. data/spec/opts_spec.rb +0 -42
  80. data/spec/plugin/_after_hook_spec.rb +0 -19
  81. data/spec/plugin/all_verbs_spec.rb +0 -29
  82. data/spec/plugin/assets_preloading_spec.rb +0 -98
  83. data/spec/plugin/assets_spec.rb +0 -745
  84. data/spec/plugin/backtracking_array_spec.rb +0 -42
  85. data/spec/plugin/branch_locals_spec.rb +0 -106
  86. data/spec/plugin/caching_spec.rb +0 -337
  87. data/spec/plugin/chunked_spec.rb +0 -201
  88. data/spec/plugin/class_level_routing_spec.rb +0 -164
  89. data/spec/plugin/class_matchers_spec.rb +0 -40
  90. data/spec/plugin/common_logger_spec.rb +0 -85
  91. data/spec/plugin/content_for_spec.rb +0 -162
  92. data/spec/plugin/content_security_policy_spec.rb +0 -175
  93. data/spec/plugin/cookies_spec.rb +0 -51
  94. data/spec/plugin/csrf_spec.rb +0 -111
  95. data/spec/plugin/default_headers_spec.rb +0 -82
  96. data/spec/plugin/default_status_spec.rb +0 -95
  97. data/spec/plugin/delay_build_spec.rb +0 -23
  98. data/spec/plugin/delegate_spec.rb +0 -23
  99. data/spec/plugin/delete_empty_headers_spec.rb +0 -27
  100. data/spec/plugin/direct_call_spec.rb +0 -28
  101. data/spec/plugin/disallow_file_uploads_spec.rb +0 -25
  102. data/spec/plugin/drop_body_spec.rb +0 -24
  103. data/spec/plugin/early_hints_spec.rb +0 -19
  104. data/spec/plugin/empty_root_spec.rb +0 -14
  105. data/spec/plugin/environments_spec.rb +0 -42
  106. data/spec/plugin/error_email_spec.rb +0 -97
  107. data/spec/plugin/error_handler_spec.rb +0 -216
  108. data/spec/plugin/error_mail_spec.rb +0 -93
  109. data/spec/plugin/exception_page_spec.rb +0 -168
  110. data/spec/plugin/flash_spec.rb +0 -121
  111. data/spec/plugin/h_spec.rb +0 -11
  112. data/spec/plugin/halt_spec.rb +0 -119
  113. data/spec/plugin/hash_matcher_spec.rb +0 -27
  114. data/spec/plugin/hash_routes_spec.rb +0 -535
  115. data/spec/plugin/head_spec.rb +0 -52
  116. data/spec/plugin/header_matchers_spec.rb +0 -98
  117. data/spec/plugin/heartbeat_spec.rb +0 -74
  118. data/spec/plugin/hooks_spec.rb +0 -152
  119. data/spec/plugin/indifferent_params_spec.rb +0 -14
  120. data/spec/plugin/json_parser_spec.rb +0 -141
  121. data/spec/plugin/json_spec.rb +0 -83
  122. data/spec/plugin/mail_processor_spec.rb +0 -451
  123. data/spec/plugin/mailer_spec.rb +0 -282
  124. data/spec/plugin/match_affix_spec.rb +0 -43
  125. data/spec/plugin/match_hook_spec.rb +0 -79
  126. data/spec/plugin/middleware_spec.rb +0 -237
  127. data/spec/plugin/middleware_stack_spec.rb +0 -81
  128. data/spec/plugin/module_include_spec.rb +0 -48
  129. data/spec/plugin/multi_route_spec.rb +0 -268
  130. data/spec/plugin/multi_run_spec.rb +0 -87
  131. data/spec/plugin/multi_view_spec.rb +0 -50
  132. data/spec/plugin/multibyte_string_matcher_spec.rb +0 -44
  133. data/spec/plugin/named_templates_spec.rb +0 -96
  134. data/spec/plugin/not_allowed_spec.rb +0 -69
  135. data/spec/plugin/not_found_spec.rb +0 -128
  136. data/spec/plugin/optimized_string_matchers_spec.rb +0 -43
  137. data/spec/plugin/padrino_render_spec.rb +0 -34
  138. data/spec/plugin/param_matchers_spec.rb +0 -69
  139. data/spec/plugin/params_capturing_spec.rb +0 -33
  140. data/spec/plugin/partials_spec.rb +0 -43
  141. data/spec/plugin/pass_spec.rb +0 -29
  142. data/spec/plugin/path_matchers_spec.rb +0 -42
  143. data/spec/plugin/path_rewriter_spec.rb +0 -45
  144. data/spec/plugin/path_spec.rb +0 -222
  145. data/spec/plugin/placeholder_string_matchers_spec.rb +0 -126
  146. data/spec/plugin/precompile_templates_spec.rb +0 -61
  147. data/spec/plugin/public_spec.rb +0 -85
  148. data/spec/plugin/render_each_spec.rb +0 -82
  149. data/spec/plugin/render_locals_spec.rb +0 -114
  150. data/spec/plugin/render_spec.rb +0 -912
  151. data/spec/plugin/request_aref_spec.rb +0 -51
  152. data/spec/plugin/request_headers_spec.rb +0 -39
  153. data/spec/plugin/response_request_spec.rb +0 -43
  154. data/spec/plugin/route_block_args_spec.rb +0 -86
  155. data/spec/plugin/route_csrf_spec.rb +0 -305
  156. data/spec/plugin/run_append_slash_spec.rb +0 -77
  157. data/spec/plugin/run_handler_spec.rb +0 -53
  158. data/spec/plugin/sessions_spec.rb +0 -452
  159. data/spec/plugin/shared_vars_spec.rb +0 -45
  160. data/spec/plugin/sinatra_helpers_spec.rb +0 -537
  161. data/spec/plugin/slash_path_empty_spec.rb +0 -22
  162. data/spec/plugin/static_routing_spec.rb +0 -192
  163. data/spec/plugin/static_spec.rb +0 -30
  164. data/spec/plugin/status_303_spec.rb +0 -28
  165. data/spec/plugin/status_handler_spec.rb +0 -158
  166. data/spec/plugin/streaming_spec.rb +0 -246
  167. data/spec/plugin/strip_path_prefix_spec.rb +0 -24
  168. data/spec/plugin/symbol_matchers_spec.rb +0 -51
  169. data/spec/plugin/symbol_status_spec.rb +0 -25
  170. data/spec/plugin/symbol_views_spec.rb +0 -32
  171. data/spec/plugin/timestamp_public_spec.rb +0 -85
  172. data/spec/plugin/type_routing_spec.rb +0 -348
  173. data/spec/plugin/typecast_params_spec.rb +0 -1370
  174. data/spec/plugin/unescape_path_spec.rb +0 -22
  175. data/spec/plugin/view_options_spec.rb +0 -170
  176. data/spec/plugin_spec.rb +0 -71
  177. data/spec/redirect_spec.rb +0 -41
  178. data/spec/request_spec.rb +0 -97
  179. data/spec/response_spec.rb +0 -199
  180. data/spec/route_spec.rb +0 -39
  181. data/spec/session_middleware_spec.rb +0 -129
  182. data/spec/session_spec.rb +0 -37
  183. data/spec/spec_helper.rb +0 -137
  184. data/spec/version_spec.rb +0 -14
  185. data/spec/views/_test.erb +0 -1
  186. data/spec/views/a.erb +0 -1
  187. data/spec/views/a.rdoc +0 -2
  188. data/spec/views/about.erb +0 -1
  189. data/spec/views/about.str +0 -1
  190. data/spec/views/about/_test.css.gz +0 -0
  191. data/spec/views/about/_test.erb +0 -1
  192. data/spec/views/about/_test.erb.gz +0 -0
  193. data/spec/views/about/comp_test.erb +0 -1
  194. data/spec/views/b.erb +0 -1
  195. data/spec/views/c.erb +0 -1
  196. data/spec/views/comp_layout.erb +0 -1
  197. data/spec/views/comp_test.erb +0 -1
  198. data/spec/views/content-yield.erb +0 -1
  199. data/spec/views/each.str +0 -1
  200. data/spec/views/home.erb +0 -2
  201. data/spec/views/home.str +0 -2
  202. data/spec/views/iv.erb +0 -1
  203. data/spec/views/layout-alternative.erb +0 -2
  204. data/spec/views/layout-yield.erb +0 -3
  205. data/spec/views/layout.erb +0 -2
  206. data/spec/views/layout.str +0 -2
  207. data/spec/views/multiple-layout.erb +0 -1
  208. data/spec/views/multiple.erb +0 -1
@@ -1,39 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe "Roda.route" do
4
- it "should set the route block" do
5
- pr = proc{'123'}
6
- app.route(&pr)
7
- app.route_block.must_equal pr
8
- body.must_equal '123'
9
- end
10
-
11
- it "should work if called in subclass and parent class later frozen" do
12
- a = app
13
- @app = Class.new(a)
14
- @app.route{|r| "OK"}
15
- body.must_equal "OK"
16
- a.freeze
17
- body.must_equal "OK"
18
- app.freeze
19
- body.must_equal "OK"
20
- end
21
-
22
- deprecated "should support #call being overridden" do
23
- app.class_eval do
24
- def call; super end
25
- end
26
- app.route{'123'}
27
- body.must_equal '123'
28
- end
29
-
30
- deprecated "should support #_call" do
31
- pr = proc{env['PATH_INFO']}
32
- app{_call(&pr)}
33
- body.must_equal '/'
34
- end
35
-
36
- deprecated "should be callable without a block" do
37
- app.route.must_be_nil
38
- end
39
- end
@@ -1,129 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- if RUBY_VERSION >= '2'
4
- require 'roda/session_middleware'
5
-
6
- describe "RodaSessionMiddleware" do
7
- include CookieJar
8
-
9
- it "operates like a session middleware" do
10
- sess = nil
11
- env = nil
12
-
13
- app(:bare) do
14
- use RodaSessionMiddleware, :secret=>'1'*64
15
-
16
- route do |r|
17
- r.get('s', String, String){|k, v| session[k.to_sym] = v}
18
- r.get('g', String){|k| session[k.to_sym].to_s}
19
- r.get('c'){|k| session.clear; ''}
20
- r.get('sh'){|k| env = r.env; sess = session; ''}
21
- ''
22
- end
23
- end
24
-
25
- _, h, b = req('/')
26
- h['Set-Cookie'].must_be_nil
27
- b.must_equal ['']
28
-
29
- _, h, b = req('/s/foo/bar')
30
- h['Set-Cookie'].must_match(/\Aroda\.session=(.*); path=\/; HttpOnly(; SameSite=Lax)?\z/m)
31
- b.must_equal ['bar']
32
- body('/s/foo/bar').must_equal 'bar'
33
- body('/g/foo').must_equal 'bar'
34
-
35
- body('/s/foo/baz').must_equal 'baz'
36
- body('/g/foo').must_equal 'baz'
37
-
38
- body("/s/foo/\u1234").must_equal "\u1234"
39
- body("/g/foo").must_equal "\u1234"
40
-
41
- body("/c").must_equal ""
42
- body("/g/foo").must_equal ""
43
-
44
- body('/s/foo/bar')
45
- body("/sh").must_equal ""
46
-
47
- sess.must_be_kind_of RodaSessionMiddleware::SessionHash
48
- sess.req.must_be_kind_of Roda::RodaRequest
49
- sess.data.must_be_nil
50
- sess.options[:secret].must_equal('1'*64)
51
- sess.inspect.must_include "not yet loaded"
52
- sess.loaded?.must_equal false
53
-
54
- a = []
55
- sess.each{|k, v| a << k << v}
56
- a.must_equal %w'foo bar'
57
- sess.data.must_equal("foo"=>"bar")
58
- sess.inspect.must_equal '{"foo"=>"bar"}'
59
- sess.loaded?.must_equal true
60
-
61
- sess[:foo].must_equal "bar"
62
- sess['foo'].must_equal "bar"
63
-
64
- sess.fetch(:foo).must_equal "bar"
65
- sess.fetch('foo').must_equal "bar"
66
- proc{sess.fetch('foo2')}.must_raise KeyError
67
- sess.fetch(:foo, "baz").must_equal "bar"
68
- sess.fetch('foo', "baz").must_equal "bar"
69
- sess.fetch('foo2', "baz").must_equal "baz"
70
-
71
- sess.has_key?(:foo).must_equal true
72
- sess.has_key?("foo").must_equal true
73
- sess.has_key?("bar").must_equal false
74
- sess.key?("foo").must_equal true
75
- sess.key?("bar").must_equal false
76
- sess.include?("foo").must_equal true
77
- sess.include?("bar").must_equal false
78
-
79
- sess[:foo2] = "bar2"
80
- sess['foo2'].must_equal "bar2"
81
- sess.store('foo3', "bar3").must_equal "bar3"
82
- sess['foo3'].must_equal "bar3"
83
-
84
- env['roda.session.created_at'] = true
85
- env['roda.session.updated_at'] = true
86
- sess.clear.must_equal({})
87
- sess.data.must_equal({})
88
- env['roda.session.created_at'].must_be_nil
89
- env['roda.session.updated_at'].must_be_nil
90
-
91
- sess['a'] = 'b'
92
- env['roda.session.created_at'] = true
93
- env['roda.session.updated_at'] = true
94
- sess.destroy.must_equal({})
95
- sess.data.must_equal({})
96
- env['roda.session.created_at'].must_be_nil
97
- env['roda.session.updated_at'].must_be_nil
98
-
99
- sess[:foo] = "bar"
100
- sess.to_hash.must_equal("foo"=>"bar")
101
- sess.to_hash.wont_be_same_as(sess.data)
102
-
103
- sess.update("foo2"=>"bar2", :foo=>"bar3").must_equal("foo"=>"bar3", "foo2"=>"bar2")
104
- sess.data.must_equal("foo"=>"bar3", "foo2"=>"bar2")
105
- sess.merge!("foo2"=>"bar4").must_equal("foo"=>"bar3", "foo2"=>"bar4")
106
-
107
- sess.replace("foo2"=>"bar5", :foo3=>"bar").must_equal("foo3"=>"bar", "foo2"=>"bar5")
108
- sess.data.must_equal("foo3"=>"bar", "foo2"=>"bar5")
109
-
110
- sess.delete(:foo3).must_equal("bar")
111
- sess.data.must_equal("foo2"=>"bar5")
112
- sess.delete("foo2").must_equal("bar5")
113
- sess.data.must_equal({})
114
-
115
- sess.exists?.must_equal true
116
- env.delete('roda.session.serialized')
117
- sess.exists?.must_equal false
118
-
119
- sess.empty?.must_equal true
120
- sess[:foo] = "bar"
121
- sess.empty?.must_equal false
122
- sess.keys.must_equal ["foo"]
123
- sess.values.must_equal ["bar"]
124
-
125
-
126
-
127
- end
128
- end
129
- end
@@ -1,37 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe "session handling" do
4
- include CookieJar
5
-
6
- it "should give a warning if session variable is not available" do
7
- app do |r|
8
- begin
9
- session
10
- rescue Exception => e
11
- e.message
12
- end
13
- end
14
-
15
- body.must_match("You're missing a session handler, try using the sessions plugin.")
16
- end
17
-
18
- it "should return session if rack session middleware is used" do
19
- app(:bare) do
20
- use Rack::Session::Cookie, :secret=>'1'
21
-
22
- route do |r|
23
- r.on do
24
- (session[1] ||= 'a'.dup) << 'b'
25
- session[1]
26
- end
27
- end
28
- end
29
-
30
- _, _, b = req
31
- b.join.must_equal 'ab'
32
- _, _, b = req
33
- b.join.must_equal 'abb'
34
- _, _, b = req
35
- b.join.must_equal 'abbb'
36
- end
37
- end
@@ -1,137 +0,0 @@
1
- $:.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
2
-
3
- if ENV['WARNING']
4
- require 'warning'
5
- Warning.ignore([:missing_ivar, :method_redefined, :not_reached], File.dirname(File.dirname(__FILE__)))
6
- end
7
-
8
- if ENV['COVERAGE']
9
- require 'coverage'
10
- require 'simplecov'
11
-
12
- def SimpleCov.roda_coverage(opts = {})
13
- start do
14
- enable_coverage :branch if ENV['BRANCH_COVERAGE']
15
- add_filter "/spec/"
16
- add_group('Missing'){|src| src.covered_percent < 100}
17
- add_group('Covered'){|src| src.covered_percent == 100}
18
- yield self if block_given?
19
- end
20
- end
21
-
22
- ENV.delete('COVERAGE')
23
- SimpleCov.roda_coverage
24
- end
25
-
26
- require_relative "../lib/roda"
27
- require "stringio"
28
-
29
- ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
30
- gem 'minitest'
31
- require "minitest/global_expectations/autorun"
32
-
33
- $RODA_WARN = true
34
- def (Roda::RodaPlugins).warn(s)
35
- return unless $RODA_WARN
36
- $stderr.puts s
37
- puts caller.grep(/_spec\.rb:\d+:/)
38
- end
39
-
40
- if ENV['RODA_RACK_SESSION_COOKIE'] != '1'
41
- require_relative '../lib/roda/session_middleware'
42
- DEFAULT_SESSION_MIDDLEWARE_ARGS = [RodaSessionMiddleware, :secret=>'1'*64]
43
- DEFAULT_SESSION_ARGS = [:plugin, :sessions, :secret=>'1'*64]
44
- else
45
- DEFAULT_SESSION_MIDDLEWARE_ARGS = [Rack::Session::Cookie, :secret=>'1']
46
- DEFAULT_SESSION_ARGS = [:use, Rack::Session::Cookie, :secret=>'1']
47
- end
48
-
49
- module CookieJar
50
- def req(path='/', env={})
51
- if path.is_a?(Hash)
52
- env = path
53
- else
54
- env['PATH_INFO'] = path.dup
55
- end
56
- env['HTTP_COOKIE'] = @cookie if @cookie
57
-
58
- a = super(env)
59
- if set = a[1]['Set-Cookie']
60
- @cookie = set.sub(/(; path=\/)?(; secure)?; HttpOnly/, '')
61
- end
62
- a
63
- end
64
- end
65
-
66
- class Minitest::Spec
67
- def self.deprecated(a, &block)
68
- it("#{a} (deprecated)") do
69
- begin
70
- $RODA_WARN = false
71
- instance_exec(&block)
72
- ensure
73
- $RODA_WARN = true
74
- end
75
- end
76
- end
77
-
78
- def app(type=nil, &block)
79
- case type
80
- when :new
81
- @app = _app{route(&block) if block}
82
- when :bare
83
- @app = _app(&block)
84
- when Symbol
85
- @app = _app do
86
- plugin type
87
- route(&block)
88
- end
89
- else
90
- if block
91
- @app = _app{route(&block)}
92
- else
93
- @app ||= _app{}
94
- end
95
- end
96
- end
97
-
98
- def req(path='/', env={})
99
- if path.is_a?(Hash)
100
- env = path
101
- else
102
- env['PATH_INFO'] = path.dup
103
- end
104
-
105
- env = {"REQUEST_METHOD" => "GET", "PATH_INFO" => "/", "SCRIPT_NAME" => ""}.merge(env)
106
- @app.call(env)
107
- end
108
-
109
- def status(path='/', env={})
110
- req(path, env)[0]
111
- end
112
-
113
- def header(name, path='/', env={})
114
- req(path, env)[1][name]
115
- end
116
-
117
- def body(path='/', env={})
118
- s = String.new
119
- b = req(path, env)[2]
120
- b.each{|x| s << x}
121
- b.close if b.respond_to?(:close)
122
- s
123
- end
124
-
125
- def _app(&block)
126
- c = Class.new(Roda)
127
- c.class_eval(&block)
128
- c
129
- end
130
-
131
- def with_rack_env(env)
132
- ENV['RACK_ENV'] = env
133
- yield
134
- ensure
135
- ENV.delete('RACK_ENV')
136
- end
137
- end
@@ -1,14 +0,0 @@
1
- require_relative "spec_helper"
2
-
3
- describe "Roda version constants" do
4
- it "RodaVersion should be a string in x.y.z integer format" do
5
- Roda::RodaVersion.must_match(/\A\d+\.\d+\.\d+\z/)
6
- end
7
-
8
- it "Roda*Version and RodaVersionNumber should be integers" do
9
- Roda::RodaMajorVersion.must_be_kind_of(Integer)
10
- Roda::RodaMinorVersion.must_be_kind_of(Integer)
11
- Roda::RodaPatchVersion.must_be_kind_of(Integer)
12
- Roda::RodaVersionNumber.must_be_kind_of(Integer)
13
- end
14
- end
@@ -1 +0,0 @@
1
- <h1><%= title %></h1>
@@ -1 +0,0 @@
1
- a
@@ -1,2 +0,0 @@
1
- # a
2
- # * b
@@ -1 +0,0 @@
1
- <h1><%= title %></h1>
@@ -1 +0,0 @@
1
- <h1>#{title}</h1>
@@ -1 +0,0 @@
1
- <h1>Subdir: <%= title %></h1>
@@ -1 +0,0 @@
1
- about-ct
@@ -1 +0,0 @@
1
- b
@@ -1 +0,0 @@
1
- c
@@ -1 +0,0 @@
1
- a<%= yield %>b
@@ -1 +0,0 @@
1
- ct
@@ -1 +0,0 @@
1
- This is the actual content.
@@ -1 +0,0 @@
1
- r-#{each if local_variables.include?(:each)}-#{foo if local_variables.include?(:foo)}
@@ -1,2 +0,0 @@
1
- <h1>Home</h1>
2
- <p>Hello <%= name %></p>
@@ -1,2 +0,0 @@
1
- <h1>Home</h1>
2
- <p>Hello #{name}</p>
@@ -1 +0,0 @@
1
- <%= @a %>
@@ -1,2 +0,0 @@
1
- <title>Alternative Layout: <%= title %></title>
2
- <%= yield %>
@@ -1,3 +0,0 @@
1
- Header
2
- <%= yield %>
3
- Footer
@@ -1,2 +0,0 @@
1
- <title>Roda: <%= title %></title>
2
- <%= yield %>
@@ -1,2 +0,0 @@
1
- <title>Roda: #{ title }</title>
2
- #{ yield }
@@ -1 +0,0 @@
1
- <%= title %>:<%= a %>::<%= yield %>
@@ -1 +0,0 @@
1
- <%= title %>:<%= b %>