Pistos-ramaze 2008.09 → 2008.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/benchmark/run.rb +1 -1
  2. data/examples/app/blog/spec/blog.rb +2 -2
  3. data/examples/app/rapaste/spec/rapaste.rb +1 -1
  4. data/examples/app/rapaste/start.rb +2 -2
  5. data/examples/app/rapaste/view/view.xhtml +3 -0
  6. data/examples/app/todolist/spec/todolist.rb +1 -1
  7. data/examples/app/whywiki/spec/whywiki.rb +1 -1
  8. data/examples/app/wikore/spec/wikore.rb +1 -1
  9. data/examples/app/wikore/src/model.rb +1 -1
  10. data/examples/app/wiktacular/spec/wiktacular.rb +1 -1
  11. data/examples/app/wiktacular/src/model.rb +1 -1
  12. data/examples/basic/partial.rb +28 -0
  13. data/examples/helpers/httpdigest.rb +68 -10
  14. data/examples/misc/ramaise.rb +2 -2
  15. data/examples/templates/template_amrita2.rb +1 -1
  16. data/examples/templates/template_erubis.rb +1 -1
  17. data/examples/templates/template_ezamar.rb +1 -1
  18. data/examples/templates/template_haml.rb +2 -2
  19. data/examples/templates/template_liquid.rb +1 -1
  20. data/examples/templates/template_markaby.rb +2 -2
  21. data/examples/templates/template_nagoro.rb +1 -1
  22. data/examples/templates/template_redcloth.rb +1 -1
  23. data/examples/templates/template_remarkably.rb +2 -2
  24. data/examples/templates/template_tenjin.rb +1 -1
  25. data/examples/templates/template_xslt.rb +1 -1
  26. data/lib/proto/controller/init.rb +2 -1
  27. data/lib/proto/model/init.rb +3 -3
  28. data/lib/proto/public/dispatch.fcgi +2 -2
  29. data/lib/proto/spec/main.rb +3 -3
  30. data/lib/proto/start.rb +4 -0
  31. data/lib/ramaze/action/render.rb +6 -5
  32. data/lib/ramaze/action.rb +7 -1
  33. data/lib/ramaze/cache/file.rb +71 -0
  34. data/lib/ramaze/cache.rb +1 -0
  35. data/lib/ramaze/contrib/email.rb +2 -0
  36. data/lib/ramaze/contrib/facebook.rb +2 -2
  37. data/lib/ramaze/contrib/file_cache.rb +2 -64
  38. data/lib/ramaze/contrib/sequel/image.rb +1 -1
  39. data/lib/ramaze/contrib.rb +1 -1
  40. data/lib/ramaze/controller/resolve.rb +8 -3
  41. data/lib/ramaze/controller.rb +9 -1
  42. data/lib/ramaze/current/request.rb +85 -68
  43. data/lib/ramaze/current/session/hash.rb +7 -11
  44. data/lib/ramaze/current/session.rb +3 -5
  45. data/lib/ramaze/dispatcher/action.rb +2 -0
  46. data/lib/ramaze/dispatcher/file.rb +6 -1
  47. data/lib/ramaze/helper/aspect.rb +2 -2
  48. data/lib/ramaze/helper/form.rb +5 -2
  49. data/lib/ramaze/helper/formatting.rb +4 -0
  50. data/lib/ramaze/helper/gravatar.rb +18 -1
  51. data/lib/ramaze/helper/httpdigest.rb +57 -28
  52. data/lib/ramaze/helper/maruku.rb +2 -0
  53. data/lib/ramaze/helper/paginate.rb +2 -3
  54. data/lib/ramaze/helper/partial.rb +1 -1
  55. data/lib/ramaze/helper/redirect.rb +22 -4
  56. data/lib/ramaze/helper/user.rb +4 -4
  57. data/lib/ramaze/helper.rb +12 -4
  58. data/lib/ramaze/log/rotatinginformer.rb +168 -0
  59. data/lib/ramaze/option/holder.rb +3 -3
  60. data/lib/ramaze/option.rb +1 -1
  61. data/lib/ramaze/reloader/watch_inotify.rb +85 -0
  62. data/lib/ramaze/reloader/watch_stat.rb +58 -0
  63. data/lib/ramaze/reloader.rb +25 -41
  64. data/lib/ramaze/snippets/divide.rb +2 -0
  65. data/lib/ramaze/snippets/numeric/time.rb +1 -1
  66. data/lib/ramaze/snippets/object/__dir__.rb +3 -3
  67. data/lib/ramaze/snippets/object/acquire.rb +3 -6
  68. data/lib/ramaze/snippets/ramaze/acquire.rb +31 -0
  69. data/lib/ramaze/snippets/ramaze/deprecated.rb +2 -1
  70. data/lib/ramaze/spec/helper/mock_http.rb +6 -5
  71. data/lib/ramaze/template/ezamar/render_partial.rb +8 -0
  72. data/lib/ramaze/tool/mime.rb +1 -1
  73. data/lib/ramaze/tool/project_creator.rb +2 -1
  74. data/lib/ramaze/version.rb +1 -1
  75. data/lib/ramaze.rb +6 -0
  76. data/rake_tasks/coverage.rake +4 -5
  77. data/rake_tasks/spec.rake +6 -6
  78. data/ramaze.gemspec +769 -756
  79. data/spec/contrib/profiling.rb +2 -2
  80. data/spec/ramaze/action/file_cache.rb +1 -1
  81. data/spec/ramaze/action/layout.rb +1 -1
  82. data/spec/ramaze/controller/actionless_templates.rb +1 -1
  83. data/spec/ramaze/controller/resolve.rb +1 -1
  84. data/spec/ramaze/controller/template_resolving.rb +1 -1
  85. data/spec/ramaze/dispatcher/directory.rb +3 -3
  86. data/spec/ramaze/helper/aspect.rb +1 -1
  87. data/spec/ramaze/helper/partial.rb +1 -1
  88. data/spec/ramaze/localize.rb +1 -1
  89. data/spec/ramaze/rewrite.rb +1 -1
  90. data/spec/ramaze/template/amrita2.rb +1 -1
  91. data/spec/ramaze/template/erubis.rb +1 -1
  92. data/spec/ramaze/template/ezamar.rb +1 -1
  93. data/spec/ramaze/template/haml.rb +2 -2
  94. data/spec/ramaze/template/nagoro.rb +1 -1
  95. data/spec/ramaze/template/redcloth.rb +1 -1
  96. data/spec/ramaze/template/sass.rb +1 -1
  97. data/spec/ramaze/template/tenjin.rb +1 -1
  98. data/spec/ramaze/template.rb +3 -3
  99. data/spec/snippets/object/__dir__.rb +6 -0
  100. data/spec/snippets/{object → ramaze}/acquire.rb +24 -18
  101. metadata +15 -12
  102. data/lib/ramaze/contrib/auto_params/get_args.rb +0 -58
  103. data/lib/ramaze/contrib/auto_params.rb +0 -135
  104. data/spec/contrib/auto_params.rb +0 -121
  105. data/spec/snippets/divide.rb +0 -19
@@ -1,121 +0,0 @@
1
- require 'spec/helper'
2
- spec_require 'parse_tree', 'ruby2ruby'
3
-
4
- Ramaze.contrib :auto_params
5
-
6
- module AnotherController
7
- Ramaze::Helper::LOOKUP << self
8
-
9
- def another_page
10
- 'another page'
11
- end
12
-
13
- define_method('css/style.css') { 'style.css' }
14
- end
15
-
16
- class MainController < Ramaze::Controller
17
- include AnotherController
18
- engine :None
19
-
20
- def search query
21
- query.inspect
22
- end
23
-
24
- def create name, age = '?', occupation = nil
25
- [name, age, occupation].compact.join(', ')
26
- end
27
-
28
- def show *args
29
- args.join(', ')
30
- end
31
-
32
- def add item, price = 1.0, *args
33
- [item, price, *args].join(', ')
34
- end
35
-
36
- def find width, height, depth
37
- [width, height, depth].join(', ')
38
- end
39
-
40
- define_method('page') do
41
- 'page'
42
- end
43
- end
44
-
45
- class GetArgsTest
46
- def one(a, b, c) end
47
- def two(a, b = 1, c = nil) end
48
- def three(a, *args) end
49
- end
50
-
51
- describe 'Method#get_args' do
52
- it 'should return a list of arguments' do
53
- gat = GetArgsTest.new
54
- gat.method(:one).get_args.should == [[:a], [:b], [:c]]
55
- gat.method(:two).get_args.should == [[:a], [:b, 1], [:c, nil]]
56
- gat.method(:three).get_args.should == [[:a], [:"*args"]]
57
- end
58
- end
59
-
60
- describe 'Parameterized actions' do
61
- behaves_like 'http'
62
- ramaze
63
-
64
- it 'should pass in values from request.params' do
65
- get('/create/Aman/20').body.should == 'Aman, 20'
66
- get('/create', :name => 'Aman', :age => 20).body.should == 'Aman, 20'
67
-
68
- get('/create/Aman/20/Unemployed').body.should == 'Aman, 20, Unemployed'
69
- get('/create', :name => 'Aman', :age => 20, :occupation => 'Unemployed').body.should == 'Aman, 20, Unemployed'
70
-
71
- get('/create/Aman').body.should == 'Aman, ?'
72
- get('/create', :name => 'Aman').body.should == 'Aman, ?'
73
- end
74
-
75
- it 'should insert nil for arguments not found' do
76
- get('/find', :width => 10, :depth => 20).body.should == '10, , 20'
77
- end
78
-
79
- it 'should work with variable arguments' do
80
- get('/show/1/2/3').body.should == '1, 2, 3'
81
-
82
- get('/add/Shoe').body.should == 'Shoe, 1.0'
83
- get('/add', :item => 'Shoe').body.should == 'Shoe, 1.0'
84
-
85
- get('/add/Shoe/10.50/1/2/3').body.should == 'Shoe, 10.50, 1, 2, 3'
86
- get('/add/Shoe/11.00').body.should == 'Shoe, 11.00'
87
- end
88
-
89
- it 'should not break existing methods' do
90
- get('/search/Aman').body.should == '"Aman"'
91
- get('/search', 'query=Aman').body.should == '"Aman"'
92
- get('/search/tmm1', 'query=Aman').body.should == ['tmm1','Aman'].inspect
93
- end
94
-
95
- it 'should consolidate all values for the same key into an array' do
96
- get('/add', 'item=Shoe&item=Shirt').body.should == 'Shoe, Shirt, 1.0'
97
- get('/add/Pants', 'item=Shoe&item=Shirt').body.should == 'Pants, Shoe, Shirt, 1.0'
98
- get('/add/Shoe', :item => 'Shirt').body.should == 'Shoe, Shirt, 1.0'
99
- end
100
- end if method(:puts).respond_to? :get_args
101
-
102
- describe 'Normal behavior' do
103
- behaves_like 'http'
104
- ramaze
105
-
106
- it 'should work with no arguments' do
107
- get('/page').body.should == 'page'
108
- end
109
-
110
- it 'should raise no action' do
111
- get('/none').body.should =~ /No Action found/
112
- end
113
-
114
- it 'should work with included actions' do
115
- get('/another_page').body.should == 'another page'
116
- end
117
-
118
- it 'should work with /' do
119
- get('/css/style.css').body.should == 'style.css'
120
- end
121
- end
@@ -1,19 +0,0 @@
1
- require 'lib/ramaze/spec/helper/snippets'
2
-
3
- describe 'String#/ and Symbol#/' do
4
- it 'should join two strings' do
5
- ('a' / 'b').should == 'a/b'
6
- end
7
-
8
- it 'should join a string and a symbol' do
9
- ('a' / :b).should == 'a/b'
10
- end
11
-
12
- it 'should join two symbols' do
13
- (:a / :b).should == 'a/b'
14
- end
15
-
16
- it 'should be usable in concatenation' do
17
- ('a' / :b / :c).should == 'a/b/c'
18
- end
19
- end