roda 2.28.0 → 2.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +46 -0
  3. data/README.rdoc +25 -7
  4. data/doc/release_notes/2.29.0.txt +156 -0
  5. data/lib/roda.rb +25 -3
  6. data/lib/roda/plugins/_erubis_escaping.rb +2 -0
  7. data/lib/roda/plugins/_symbol_regexp_matchers.rb +22 -0
  8. data/lib/roda/plugins/assets.rb +3 -2
  9. data/lib/roda/plugins/branch_locals.rb +74 -0
  10. data/lib/roda/plugins/caching.rb +15 -7
  11. data/lib/roda/plugins/chunked.rb +10 -7
  12. data/lib/roda/plugins/content_for.rb +4 -1
  13. data/lib/roda/plugins/drop_body.rb +3 -2
  14. data/lib/roda/plugins/error_email.rb +3 -2
  15. data/lib/roda/plugins/error_mail.rb +3 -2
  16. data/lib/roda/plugins/head.rb +2 -1
  17. data/lib/roda/plugins/header_matchers.rb +3 -0
  18. data/lib/roda/plugins/heartbeat.rb +3 -2
  19. data/lib/roda/plugins/json.rb +5 -3
  20. data/lib/roda/plugins/json_parser.rb +3 -2
  21. data/lib/roda/plugins/mailer.rb +3 -3
  22. data/lib/roda/plugins/match_affix.rb +6 -0
  23. data/lib/roda/plugins/multi_route.rb +3 -1
  24. data/lib/roda/plugins/padrino_render.rb +3 -2
  25. data/lib/roda/plugins/params_capturing.rb +3 -3
  26. data/lib/roda/plugins/partials.rb +3 -3
  27. data/lib/roda/plugins/path.rb +4 -2
  28. data/lib/roda/plugins/path_rewriter.rb +2 -2
  29. data/lib/roda/plugins/per_thread_caching.rb +2 -0
  30. data/lib/roda/plugins/placeholder_string_matchers.rb +42 -0
  31. data/lib/roda/plugins/precompile_templates.rb +3 -2
  32. data/lib/roda/plugins/render.rb +86 -37
  33. data/lib/roda/plugins/render_each.rb +2 -1
  34. data/lib/roda/plugins/render_locals.rb +102 -0
  35. data/lib/roda/plugins/run_append_slash.rb +2 -1
  36. data/lib/roda/plugins/run_handler.rb +2 -1
  37. data/lib/roda/plugins/sinatra_helpers.rb +4 -4
  38. data/lib/roda/plugins/static_path_info.rb +2 -0
  39. data/lib/roda/plugins/static_routing.rb +1 -1
  40. data/lib/roda/plugins/streaming.rb +9 -4
  41. data/lib/roda/plugins/symbol_matchers.rb +23 -20
  42. data/lib/roda/plugins/view_options.rb +63 -28
  43. data/lib/roda/plugins/view_subdirs.rb +1 -0
  44. data/lib/roda/plugins/websockets.rb +2 -0
  45. data/lib/roda/version.rb +1 -1
  46. data/spec/composition_spec.rb +2 -2
  47. data/spec/matchers_spec.rb +6 -5
  48. data/spec/plugin/_erubis_escaping_spec.rb +5 -5
  49. data/spec/plugin/backtracking_array_spec.rb +0 -2
  50. data/spec/plugin/branch_locals_spec.rb +88 -0
  51. data/spec/plugin/content_for_spec.rb +8 -2
  52. data/spec/plugin/halt_spec.rb +8 -0
  53. data/spec/plugin/header_matchers_spec.rb +20 -5
  54. data/spec/plugin/multi_route_spec.rb +1 -1
  55. data/spec/plugin/named_templates_spec.rb +2 -2
  56. data/spec/plugin/params_capturing_spec.rb +1 -1
  57. data/spec/plugin/per_thread_caching_spec.rb +1 -1
  58. data/spec/plugin/placeholder_string_matchers_spec.rb +159 -0
  59. data/spec/plugin/render_locals_spec.rb +114 -0
  60. data/spec/plugin/render_spec.rb +83 -8
  61. data/spec/plugin/streaming_spec.rb +104 -4
  62. data/spec/plugin/symbol_matchers_spec.rb +1 -1
  63. data/spec/plugin/view_options_spec.rb +83 -7
  64. data/spec/plugin/websockets_spec.rb +7 -8
  65. data/spec/spec_helper.rb +22 -2
  66. metadata +11 -2
@@ -10,7 +10,7 @@ rescue LoadError
10
10
  warn "#{lib} not installed, skipping websockets plugin test"
11
11
  else
12
12
  describe "websockets plugin" do
13
- it "supports regular requests" do
13
+ deprecated "supports regular requests" do
14
14
  app(:websockets) do |r|
15
15
  r.websocket{}
16
16
  "a"
@@ -20,7 +20,12 @@ describe "websockets plugin" do
20
20
  end
21
21
 
22
22
  describe "websockets plugin" do
23
- before do
23
+ after do
24
+ #$DEBUG=nil
25
+ @server.stop
26
+ end
27
+
28
+ deprecated "supports websocket requests" do
24
29
  events = @events = []
25
30
  app(:bare) do
26
31
  plugin :websockets, :adapter=>:thin
@@ -52,13 +57,7 @@ describe "websockets plugin" do
52
57
  end
53
58
  end
54
59
  q.pop
55
- end
56
- after do
57
- #$DEBUG=nil
58
- @server.stop
59
- end
60
60
 
61
- it "supports websocket requests" do
62
61
  ws = Faye::WebSocket::Client.new("ws://localhost:#{@port}")
63
62
  msg = nil
64
63
  sleep_for = 0.01
data/spec/spec_helper.rb CHANGED
@@ -29,9 +29,25 @@ require "stringio"
29
29
  gem 'minitest'
30
30
  require "minitest/autorun"
31
31
 
32
- #def (Roda::RodaPlugins).warn(s); end
32
+ $RODA_WARN = true
33
+ def (Roda::RodaPlugins).warn(s)
34
+ return unless $RODA_WARN
35
+ $stderr.puts s
36
+ puts caller.grep(/_spec\.rb:\d+:/)
37
+ end
33
38
 
34
39
  class Minitest::Spec
40
+ def self.deprecated(a, &block)
41
+ it("#{a} (deprecated)") do
42
+ begin
43
+ $RODA_WARN = false
44
+ instance_exec(&block)
45
+ ensure
46
+ $RODA_WARN = true
47
+ end
48
+ end
49
+ end
50
+
35
51
  def app(type=nil, &block)
36
52
  case type
37
53
  when :new
@@ -44,7 +60,11 @@ class Minitest::Spec
44
60
  route(&block)
45
61
  end
46
62
  else
47
- @app ||= _app{route(&block)}
63
+ if block
64
+ @app = _app{route(&block)}
65
+ else
66
+ @app ||= _app{route(&block)}
67
+ end
48
68
  end
49
69
  end
50
70
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.28.0
4
+ version: 2.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-14 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -208,6 +208,7 @@ extra_rdoc_files:
208
208
  - doc/release_notes/2.26.0.txt
209
209
  - doc/release_notes/2.27.0.txt
210
210
  - doc/release_notes/2.28.0.txt
211
+ - doc/release_notes/2.29.0.txt
211
212
  files:
212
213
  - CHANGELOG
213
214
  - MIT-LICENSE
@@ -240,6 +241,7 @@ files:
240
241
  - doc/release_notes/2.26.0.txt
241
242
  - doc/release_notes/2.27.0.txt
242
243
  - doc/release_notes/2.28.0.txt
244
+ - doc/release_notes/2.29.0.txt
243
245
  - doc/release_notes/2.3.0.txt
244
246
  - doc/release_notes/2.4.0.txt
245
247
  - doc/release_notes/2.5.0.txt
@@ -250,10 +252,12 @@ files:
250
252
  - doc/release_notes/2.9.0.txt
251
253
  - lib/roda.rb
252
254
  - lib/roda/plugins/_erubis_escaping.rb
255
+ - lib/roda/plugins/_symbol_regexp_matchers.rb
253
256
  - lib/roda/plugins/all_verbs.rb
254
257
  - lib/roda/plugins/assets.rb
255
258
  - lib/roda/plugins/assets_preloading.rb
256
259
  - lib/roda/plugins/backtracking_array.rb
260
+ - lib/roda/plugins/branch_locals.rb
257
261
  - lib/roda/plugins/caching.rb
258
262
  - lib/roda/plugins/chunked.rb
259
263
  - lib/roda/plugins/class_level_routing.rb
@@ -304,10 +308,12 @@ files:
304
308
  - lib/roda/plugins/path_matchers.rb
305
309
  - lib/roda/plugins/path_rewriter.rb
306
310
  - lib/roda/plugins/per_thread_caching.rb
311
+ - lib/roda/plugins/placeholder_string_matchers.rb
307
312
  - lib/roda/plugins/precompile_templates.rb
308
313
  - lib/roda/plugins/public.rb
309
314
  - lib/roda/plugins/render.rb
310
315
  - lib/roda/plugins/render_each.rb
316
+ - lib/roda/plugins/render_locals.rb
311
317
  - lib/roda/plugins/request_headers.rb
312
318
  - lib/roda/plugins/response_request.rb
313
319
  - lib/roda/plugins/run_append_slash.rb
@@ -347,6 +353,7 @@ files:
347
353
  - spec/plugin/assets_preloading_spec.rb
348
354
  - spec/plugin/assets_spec.rb
349
355
  - spec/plugin/backtracking_array_spec.rb
356
+ - spec/plugin/branch_locals_spec.rb
350
357
  - spec/plugin/caching_spec.rb
351
358
  - spec/plugin/chunked_spec.rb
352
359
  - spec/plugin/class_level_routing_spec.rb
@@ -397,9 +404,11 @@ files:
397
404
  - spec/plugin/path_rewriter_spec.rb
398
405
  - spec/plugin/path_spec.rb
399
406
  - spec/plugin/per_thread_caching_spec.rb
407
+ - spec/plugin/placeholder_string_matchers_spec.rb
400
408
  - spec/plugin/precompile_templates_spec.rb
401
409
  - spec/plugin/public_spec.rb
402
410
  - spec/plugin/render_each_spec.rb
411
+ - spec/plugin/render_locals_spec.rb
403
412
  - spec/plugin/render_spec.rb
404
413
  - spec/plugin/request_headers_spec.rb
405
414
  - spec/plugin/response_request_spec.rb