renee 0.4.0.pre1 → 0.4.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/Gemfile +11 -8
  2. data/README.md +50 -1
  3. data/Rakefile +14 -104
  4. data/config.ru +5 -0
  5. data/examples/blog/config.ru +1 -0
  6. data/lib/renee.rb +3 -2
  7. data/lib/renee/render.rb +1 -1
  8. data/lib/renee/url_generation.rb +66 -45
  9. data/lib/renee/version.rb +1 -1
  10. data/plan.txt +1 -5
  11. data/renee.gemspec +3 -3
  12. data/site/public/css/app.css +47 -26
  13. data/site/views/extending.md +66 -0
  14. data/site/views/index.md +14 -4
  15. data/site/views/routing.md +0 -38
  16. data/site/views/variable-types.md +2 -2
  17. data/test/{renee/blog_test.rb → blog_test.rb} +0 -0
  18. data/test/{renee-render/render_test.rb → render_test.rb} +0 -0
  19. data/test/renee-url-generation/test_helper.rb +1 -1
  20. data/test/{renee-session/session_test.rb → session_test.rb} +2 -2
  21. data/test/renee/test_helper.rb b/data/test/test_helper → copy.rb +0 -0
  22. data/test/test_helper.rb +8 -1
  23. data/test/{renee-url-generation/url_generation_test.rb → url_generation_test.rb} +2 -2
  24. metadata +47 -77
  25. data/Gemfile-renee +0 -8
  26. data/Gemfile-renee-core +0 -8
  27. data/Gemfile-renee-render +0 -9
  28. data/Gemfile-renee-session +0 -9
  29. data/Gemfile-renee-url-generation +0 -8
  30. data/README-renee-core.md +0 -242
  31. data/README-renee-render.md +0 -38
  32. data/README-renee-session.md +0 -3
  33. data/README-renee-url-generation.md +0 -3
  34. data/lib/renee/core.rb +0 -98
  35. data/lib/renee/core/chaining.rb +0 -66
  36. data/lib/renee/core/env_accessors.rb +0 -72
  37. data/lib/renee/core/exceptions.rb +0 -15
  38. data/lib/renee/core/matcher.rb +0 -61
  39. data/lib/renee/core/plugins.rb +0 -31
  40. data/lib/renee/core/rack_interaction.rb +0 -50
  41. data/lib/renee/core/request_context.rb +0 -56
  42. data/lib/renee/core/responding.rb +0 -112
  43. data/lib/renee/core/response.rb +0 -78
  44. data/lib/renee/core/routing.rb +0 -319
  45. data/lib/renee/core/transform.rb +0 -18
  46. data/renee-core.gemspec +0 -26
  47. data/renee-render.gemspec +0 -30
  48. data/renee-session.gemspec +0 -28
  49. data/renee-url-generation.gemspec +0 -24
  50. data/test.watchr +0 -61
  51. data/test/renee-core/chaining_test.rb +0 -33
  52. data/test/renee-core/env_accessors_test.rb +0 -43
  53. data/test/renee-core/include_test.rb +0 -14
  54. data/test/renee-core/request_context_test.rb +0 -70
  55. data/test/renee-core/responding_test.rb +0 -128
  56. data/test/renee-core/routing_test.rb +0 -443
  57. data/test/renee-core/test_helper.rb +0 -4
  58. data/test/renee-core/variable_type_test.rb +0 -57
@@ -1,4 +0,0 @@
1
- $: << File.expand_path('../../lib', __FILE__)
2
- require 'renee/core'
3
- # Load shared test helpers
4
- require File.expand_path('../../test_helper', __FILE__)
@@ -1,57 +0,0 @@
1
- require File.expand_path('../test_helper', __FILE__)
2
-
3
- describe Renee::Core::Matcher do
4
- it "should transform variables" do
5
- mock_app {
6
- var :symbol do |i|
7
- halt i.inspect
8
- end
9
- }.setup {
10
- register_variable_type(:symbol, /[a-z_]+/).on_transform{|v| v.to_sym}
11
- }
12
- get '/test'
13
- assert_equal ":test", response.body
14
- end
15
-
16
- it "should halt on errors if told to" do
17
- mock_app {
18
- var :symbol do |i|
19
- halt i.inspect
20
- end
21
- }.setup {
22
- register_variable_type(:symbol, /[a-z_]+/).on_transform{|v| v.to_sym}.raise_on_error!
23
- }
24
- get '/123'
25
- assert_equal 400, response.status
26
- end
27
-
28
- it "should allow custom error handling behaviour on values that don't match" do
29
- mock_app {
30
- var :symbol do |i|
31
- halt i.inspect
32
- end
33
- }.setup {
34
- register_variable_type(:symbol, /[a-z_]+/).on_transform{|v| v.to_sym}.on_error{|v| halt 500 }
35
- }
36
- get '/123'
37
- assert_equal 500, response.status
38
- end
39
-
40
- it "should allow composite variable types" do
41
- mock_app {
42
- path("plus10").var(:int_or_hex) do |i|
43
- halt "plus10: #{i + 10}"
44
- end
45
- }.setup {
46
- register_variable_type(:int, /[0-9]+/).on_transform{|v| Integer(v)}
47
- register_variable_type(:hex, /0x[0-9a-f]+/).on_transform{|v| v.to_i(16)}
48
- register_variable_type(:int_or_hex, [:hex, :int])
49
- }
50
- get '/plus10/123'
51
- assert_equal 'plus10: 133', response.body
52
- get '/plus10/0x7b'
53
- assert_equal 'plus10: 133', response.body
54
- end
55
- end
56
-
57
-