ramaze 0.1.0 → 0.1.1

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 (195) hide show
  1. data/Rakefile +4 -12
  2. data/bin/ramaze +95 -171
  3. data/doc/CHANGELOG +387 -4
  4. data/doc/README +81 -13
  5. data/doc/meta/announcement.txt +51 -8
  6. data/doc/meta/configuration.txt +17 -34
  7. data/doc/meta/internals.txt +34 -4
  8. data/doc/migrate/1110_to_1111.txt +131 -0
  9. data/doc/readme_chunks/features.txt +81 -12
  10. data/doc/readme_chunks/installing.txt +0 -1
  11. data/doc/tutorial/todolist.html +293 -65
  12. data/doc/tutorial/{todolist.txt → todolist.mkd} +251 -51
  13. data/examples/blog/main.rb +1 -1
  14. data/examples/blog/src/model.rb +0 -1
  15. data/examples/hello.rb +2 -5
  16. data/examples/templates/template/external.haml +5 -5
  17. data/examples/templates/template/external.liquid +1 -1
  18. data/examples/templates/template/external.mab +8 -8
  19. data/examples/templates/template/external.rem +30 -0
  20. data/examples/templates/template/external.rhtml +6 -7
  21. data/examples/templates/template/external.zmr +13 -9
  22. data/examples/templates/template_amrita2.rb +8 -8
  23. data/examples/templates/template_erubis.rb +11 -11
  24. data/examples/templates/template_ezamar.rb +9 -11
  25. data/examples/templates/template_haml.rb +13 -13
  26. data/examples/templates/template_liquid.rb +10 -10
  27. data/examples/templates/template_markaby.rb +13 -10
  28. data/examples/templates/template_remarkably.rb +59 -0
  29. data/examples/todolist/main.rb +1 -7
  30. data/examples/todolist/src/controller/main.rb +26 -13
  31. data/examples/todolist/src/element/page.rb +5 -0
  32. data/examples/whywiki/main.rb +1 -1
  33. data/lib/proto/main.rb +0 -8
  34. data/lib/proto/public/css/ramaze_error.css +12 -4
  35. data/lib/proto/public/error.zmr +6 -25
  36. data/lib/ramaze.rb +35 -245
  37. data/lib/ramaze/action.rb +21 -0
  38. data/lib/ramaze/adapter.rb +94 -29
  39. data/lib/ramaze/adapter/base.rb +57 -0
  40. data/lib/ramaze/adapter/mongrel.rb +12 -19
  41. data/lib/ramaze/adapter/webrick.rb +21 -20
  42. data/lib/ramaze/cache.rb +47 -3
  43. data/lib/ramaze/cache/memcached.rb +22 -0
  44. data/lib/ramaze/cache/yaml_store.rb +19 -0
  45. data/lib/ramaze/controller.rb +47 -271
  46. data/lib/ramaze/controller/error.rb +43 -0
  47. data/lib/ramaze/controller/render.rb +90 -0
  48. data/lib/ramaze/controller/resolve.rb +147 -0
  49. data/lib/ramaze/dispatcher.rb +41 -9
  50. data/lib/ramaze/dispatcher/file.rb +1 -1
  51. data/lib/ramaze/global.rb +73 -158
  52. data/lib/ramaze/global/dsl.rb +29 -0
  53. data/lib/ramaze/global/globalstruct.rb +90 -0
  54. data/lib/ramaze/helper.rb +1 -1
  55. data/lib/ramaze/helper/aspect.rb +39 -179
  56. data/lib/ramaze/helper/cache.rb +8 -9
  57. data/lib/ramaze/helper/cgi.rb +23 -0
  58. data/lib/ramaze/helper/file.rb +3 -0
  59. data/lib/ramaze/helper/inform.rb +3 -0
  60. data/lib/ramaze/helper/link.rb +56 -63
  61. data/lib/ramaze/helper/nitroform.rb +4 -0
  62. data/lib/ramaze/helper/redirect.rb +1 -1
  63. data/lib/ramaze/inform.rb +6 -2
  64. data/lib/ramaze/inform/analogger.rb +5 -1
  65. data/lib/ramaze/inform/hub.rb +1 -1
  66. data/lib/ramaze/inform/informing.rb +7 -0
  67. data/lib/ramaze/snippets/kernel/aquire.rb +2 -0
  68. data/lib/ramaze/snippets/kernel/constant.rb +2 -0
  69. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +2 -0
  70. data/lib/ramaze/snippets/object/traits.rb +4 -0
  71. data/lib/ramaze/snippets/openstruct/temp.rb +3 -0
  72. data/lib/ramaze/snippets/string/DIVIDE.rb +2 -0
  73. data/lib/ramaze/snippets/string/camel_case.rb +2 -0
  74. data/lib/ramaze/snippets/string/color.rb +2 -0
  75. data/lib/ramaze/snippets/string/each.rb +2 -0
  76. data/lib/ramaze/snippets/string/snake_case.rb +3 -0
  77. data/lib/ramaze/snippets/struct/fill.rb +8 -2
  78. data/lib/ramaze/snippets/struct/values_at.rb +16 -0
  79. data/lib/ramaze/snippets/symbol/to_proc.rb +3 -0
  80. data/lib/ramaze/sourcereload.rb +89 -0
  81. data/lib/ramaze/template.rb +21 -12
  82. data/lib/ramaze/template/amrita2.rb +6 -6
  83. data/lib/ramaze/template/erubis.rb +4 -9
  84. data/lib/ramaze/template/ezamar.rb +13 -57
  85. data/lib/ramaze/template/ezamar/element.rb +10 -12
  86. data/lib/ramaze/template/ezamar/engine.rb +40 -101
  87. data/lib/ramaze/template/ezamar/morpher.rb +3 -3
  88. data/lib/ramaze/template/haml.rb +3 -6
  89. data/lib/ramaze/template/liquid.rb +4 -9
  90. data/lib/ramaze/template/markaby.rb +16 -22
  91. data/lib/ramaze/template/remarkably.rb +28 -0
  92. data/lib/ramaze/tool/mime.rb +2 -0
  93. data/lib/ramaze/tool/record.rb +6 -0
  94. data/lib/ramaze/trinity/request.rb +44 -54
  95. data/lib/ramaze/trinity/response.rb +1 -1
  96. data/lib/ramaze/trinity/session.rb +15 -37
  97. data/lib/ramaze/version.rb +1 -1
  98. data/rake_tasks/gem.rake +2 -2
  99. data/rake_tasks/maintaince.rake +42 -1
  100. data/rake_tasks/spec.rake +45 -0
  101. data/spec/examples/caching.rb +1 -1
  102. data/spec/examples/simple.rb +1 -1
  103. data/spec/examples/templates/template_amrita2.rb +1 -0
  104. data/spec/examples/templates/template_erubis.rb +2 -1
  105. data/spec/examples/templates/template_ezamar.rb +1 -1
  106. data/spec/examples/templates/template_haml.rb +2 -1
  107. data/spec/examples/templates/template_liquid.rb +2 -1
  108. data/spec/examples/templates/template_markaby.rb +2 -1
  109. data/spec/examples/templates/template_remarkably.rb +22 -0
  110. data/spec/examples/todolist.rb +125 -0
  111. data/spec/helper.rb +2 -23
  112. data/spec/helper/minimal.rb +20 -0
  113. data/spec/helper/mock_http.rb +24 -30
  114. data/spec/helper/simple_http.rb +2 -2
  115. data/spec/helper/wrap.rb +6 -9
  116. data/spec/ramaze/adapter.rb +1 -1
  117. data/spec/ramaze/adapter/record.rb +31 -0
  118. data/spec/ramaze/cache.rb +41 -54
  119. data/spec/ramaze/controller.rb +121 -137
  120. data/spec/ramaze/controller/template/list.xhtml +1 -0
  121. data/spec/ramaze/controller/template/other/greet/other.xhtml +1 -0
  122. data/spec/ramaze/controller/template_resolving.rb +27 -3
  123. data/spec/ramaze/element.rb +11 -7
  124. data/spec/ramaze/error.rb +1 -1
  125. data/spec/ramaze/gestalt.rb +2 -0
  126. data/spec/ramaze/helper/aspect.rb +30 -21
  127. data/spec/ramaze/helper/auth.rb +1 -1
  128. data/spec/ramaze/helper/cache.rb +2 -1
  129. data/spec/ramaze/helper/form.rb +14 -11
  130. data/spec/ramaze/helper/link.rb +18 -41
  131. data/spec/ramaze/localize.rb +29 -2
  132. data/spec/ramaze/morpher.rb +23 -12
  133. data/spec/ramaze/params.rb +46 -24
  134. data/spec/ramaze/request.rb +6 -2
  135. data/spec/ramaze/store/yaml.rb +5 -0
  136. data/spec/ramaze/template.rb +22 -27
  137. data/spec/ramaze/template/amrita2.rb +1 -2
  138. data/spec/ramaze/template/erubis.rb +1 -1
  139. data/spec/ramaze/template/ezamar.rb +1 -2
  140. data/spec/ramaze/template/haml.rb +2 -2
  141. data/spec/ramaze/template/haml/with_vars.haml +1 -1
  142. data/spec/ramaze/template/liquid.rb +1 -1
  143. data/spec/ramaze/template/markaby.rb +1 -1
  144. data/spec/ramaze/template/remarkably.rb +56 -0
  145. data/spec/ramaze/template/remarkably/external.rem +8 -0
  146. data/spec/ramaze/template/remarkably/sum.rem +1 -0
  147. metadata +38 -63
  148. data/doc/README.html +0 -637
  149. data/doc/allison/LICENSE +0 -184
  150. data/doc/allison/README +0 -37
  151. data/doc/allison/allison.css +0 -299
  152. data/doc/allison/allison.gif +0 -0
  153. data/doc/allison/allison.js +0 -307
  154. data/doc/allison/allison.rb +0 -287
  155. data/doc/allison/cache/BODY +0 -588
  156. data/doc/allison/cache/CLASS_INDEX +0 -4
  157. data/doc/allison/cache/CLASS_PAGE +0 -1
  158. data/doc/allison/cache/FILE_INDEX +0 -4
  159. data/doc/allison/cache/FILE_PAGE +0 -1
  160. data/doc/allison/cache/FONTS +0 -1
  161. data/doc/allison/cache/FR_INDEX_BODY +0 -1
  162. data/doc/allison/cache/IMGPATH +0 -1
  163. data/doc/allison/cache/INDEX +0 -1
  164. data/doc/allison/cache/JAVASCRIPT +0 -307
  165. data/doc/allison/cache/METHOD_INDEX +0 -4
  166. data/doc/allison/cache/METHOD_LIST +0 -1
  167. data/doc/allison/cache/SRC_PAGE +0 -1
  168. data/doc/allison/cache/STYLE +0 -321
  169. data/doc/allison/cache/URL +0 -1
  170. data/doc/changes.txt +0 -3375
  171. data/doc/changes.xml +0 -3378
  172. data/examples/todolist/conf/benchmark.yaml +0 -35
  173. data/examples/todolist/conf/debug.yaml +0 -34
  174. data/examples/todolist/conf/live.yaml +0 -33
  175. data/examples/todolist/conf/silent.yaml +0 -31
  176. data/examples/todolist/conf/stage.yaml +0 -33
  177. data/examples/todolist/public/css/coderay.css +0 -105
  178. data/examples/todolist/public/css/ramaze_error.css +0 -42
  179. data/lib/proto/conf/benchmark.yaml +0 -21
  180. data/lib/proto/conf/debug.yaml +0 -21
  181. data/lib/proto/conf/live.yaml +0 -21
  182. data/lib/proto/conf/silent.yaml +0 -21
  183. data/lib/proto/conf/stage.yaml +0 -21
  184. data/lib/proto/public/css/coderay.css +0 -105
  185. data/lib/ramaze/http_status.rb +0 -66
  186. data/lib/ramaze/snippets/hash/keys_to_sym.rb +0 -19
  187. data/lib/ramaze/snippets/kernel/method.rb +0 -26
  188. data/lib/ramaze/snippets/method/name.rb +0 -22
  189. data/lib/ramaze/snippets/ramaze/autoreload.rb +0 -135
  190. data/lib/ramaze/snippets/rdoc/usage_no_exit.rb +0 -65
  191. data/spec/all.rb +0 -32
  192. data/spec/ramaze/conf/locale_de.yaml +0 -6
  193. data/spec/ramaze/conf/locale_en.yaml +0 -6
  194. data/spec/ramaze/dependencies.rb +0 -16
  195. data/spec/ramaze/global.rb +0 -44
@@ -4,6 +4,8 @@
4
4
  require 'spec/helper'
5
5
 
6
6
  class TCParamsController < Ramaze::Controller
7
+ map '/'
8
+
7
9
  def index
8
10
  "index"
9
11
  end
@@ -42,83 +44,103 @@ class TCParamsController < Ramaze::Controller
42
44
  end
43
45
 
44
46
  class TCParamsController2 < Ramaze::Controller
47
+ map '/jo'
48
+
45
49
  def add(one, two = nil, three = nil)
46
50
  "#{one}:#{two}:#{three}"
47
51
  end
48
52
  end
49
53
 
54
+ class TCParamsController3 < Ramaze::Controller
55
+ map '/ma'
56
+
57
+ def index(*args)
58
+ request.params['foo'].inspect
59
+ end
60
+ end
61
+
50
62
  describe "Simple Parameters" do
51
- ramaze(
52
- :mapping => {
53
- '/' => TCParamsController,
54
- '/jo' => TCParamsController2
55
- }
56
- )
63
+ before :all do
64
+ ramaze
65
+ end
66
+
67
+ def handle(*url)
68
+ Ramaze::Controller.handle(*url)
69
+ end
57
70
 
58
71
  it "Should respond to no parameters given" do
59
- get('/no_params').body.should == "no params"
72
+ handle('/no_params').should == "no params"
60
73
  end
61
74
 
62
75
  it "Should respond to only / with the index" do
63
- get('/').body.should == "index"
76
+ handle('/').should == "index"
64
77
  end
65
78
 
66
79
  it "call /bar though index doesn't take params" do
67
- get('/bar').status.should == 404
80
+ lambda{ handle('/bar') }.
81
+ should raise_error(Ramaze::Error::NoAction)
68
82
  end
69
83
 
70
84
  it "action that takes a single param" do
71
- get('/single_param/foo').body.should == "single param (foo)"
85
+ handle('/single_param/foo').should == "single param (foo)"
72
86
  end
73
87
 
74
88
  it "action that takes two params" do
75
- get('/double_param/foo/bar').body.should == "double param (foo, bar)"
89
+ handle('/double_param/foo/bar').should == "double param (foo, bar)"
76
90
  end
77
91
 
78
92
  it "action that takes two params but we give only one" do
79
- get('/double_param/foo').status.should == 404
93
+ lambda{ handle('/double_param/foo') }.
94
+ should raise_error(Ramaze::Error::NoAction)
80
95
  end
81
96
 
82
97
  it "action that takes all params" do
83
- get('/all_params/foo/bar/foobar').body.should == "all params (foo, bar, foobar)"
98
+ handle('/all_params/foo/bar/foobar').should == "all params (foo, bar, foobar)"
84
99
  end
85
100
 
86
101
  it "action that takes all params but needs at least one" do
87
- get('/at_least_one/foo/bar/foobar').body.should == "at least one (foo, bar, foobar)"
102
+ handle('/at_least_one/foo/bar/foobar').should == "at least one (foo, bar, foobar)"
88
103
  end
89
104
 
90
105
  it "action that takes all params but needs at least one (not given here)" do
91
- get('/at_least_one').status.should == 500
106
+ lambda{ handle('/at_least_one') }.
107
+ should raise_error(ArgumentError)
92
108
  end
93
109
 
94
110
  it "one default" do
95
- get('/one_default').body.should == "one_default (default)"
111
+ handle('/one_default').should == "one_default (default)"
96
112
  end
97
113
 
98
114
  it "one default" do
99
- get('/one_default/my_default').body.should == "one_default (my_default)"
115
+ handle('/one_default/my_default').should == "one_default (my_default)"
100
116
  end
101
117
 
102
118
  it "double underscore lookup" do
103
- get('/cat1/cat11').body.should == 'cat1: cat11'
119
+ handle('/cat1/cat11').should == 'cat1: cat11'
104
120
  end
105
121
 
106
122
  it "double double underscore lookup" do
107
- get('/cat1/cat11/cat111').body.should == 'cat1: cat11: cat111'
123
+ handle('/cat1/cat11/cat111').should == 'cat1: cat11: cat111'
108
124
  end
109
125
 
110
126
 
111
127
  it "jo/add should raise with 0 parameters" do
112
- get('/jo/add').status.should == 500
128
+ lambda{ handle('/jo/add') }.
129
+ should raise_error(ArgumentError)
113
130
  end
114
131
 
115
132
  it "add should raise with 4 parameters" do
116
- get('/jo/add/1/2/3/4').status.should == 500
133
+ lambda{ handle('/jo/add/1/2/3/4') }.
134
+ should raise_error(ArgumentError)
117
135
  end
118
136
 
119
137
  it "add should not raise with 1-3 parameters" do
120
- get('/jo/add/1').body.should == '1::'
121
- get('/jo/add/1/2').body.should == '1:2:'
122
- get('/jo/add/1/2/3').body.should == '1:2:3'
138
+ handle('/jo/add/1').should == '1::'
139
+ handle('/jo/add/1/2').should == '1:2:'
140
+ handle('/jo/add/1/2/3').should == '1:2:3'
141
+ end
142
+
143
+ it 'params should have no content without params' do
144
+ get('/ma').body.should == 'nil'
123
145
  end
124
146
  end
@@ -116,14 +116,18 @@ describe "Request" do
116
116
  image_path = '/favicon.ico'
117
117
  static_image = File.read("spec/ramaze/public#{image_path}")
118
118
 
119
- get(image_path).body.should == static_image
119
+ response = get(image_path)
120
+ response.status.should == 200
121
+ response.body.should == static_image
120
122
  end
121
123
 
122
124
  it 'plain test' do
123
125
  css_path = '/test_download.css'
124
126
  static_css = File.read("spec/ramaze/public#{css_path}").strip
125
127
 
126
- get(css_path).body.strip.should == static_css
128
+ response = get(css_path)
129
+ response.status.should == 200
130
+ response.body.strip.should == static_css
127
131
  end
128
132
  end
129
133
  end
@@ -9,6 +9,11 @@ describe "Store::YAML" do
9
9
  Ramaze::Store::YAML.new(name, :destroy => true)
10
10
  end
11
11
 
12
+ after :all do
13
+ FileUtils.rm('article.yaml')
14
+ FileUtils.rm('author.yaml')
15
+ end
16
+
12
17
  it "model" do
13
18
  article_class = new_store :article
14
19
  article_class.entities.should_not == nil
@@ -7,22 +7,19 @@ require 'ramaze/template'
7
7
  module Ramaze::Template
8
8
  class TestTemplate < Template
9
9
  Ramaze::Controller.register_engine self, %w[ test ]
10
+
10
11
  class << self
11
- def transform controller, options = {}
12
- action, parameter, file, bound = *super
13
- [ controller.class.name,
14
- action,
15
- parameter,
16
- file
17
- ].to_yaml
12
+ def transform action
13
+ action.values_at(:method, :params, :template).to_yaml
18
14
  end
19
15
  end
20
16
  end
21
17
  end
22
18
 
23
19
  class TCTemplateController < Ramaze::Controller
20
+ map '/'
24
21
  trait :engine => Ramaze::Template::TestTemplate
25
- trait :template_root => (File.dirname(__FILE__)/:template/:ramaze)
22
+ template_root(File.dirname(__FILE__)/:template/:ramaze)
26
23
 
27
24
  def index *args
28
25
  end
@@ -32,55 +29,53 @@ class TCTemplateController < Ramaze::Controller
32
29
  end
33
30
 
34
31
  describe "testing ramaze template" do
35
- ramaze(:mapping => {'/' => TCTemplateController})
32
+ before :all do
33
+ ramaze
34
+ end
36
35
 
37
36
  def getpage page
38
- @controller, @action, @parameter, @file = YAML.load(get( page ).body)
37
+ content = Ramaze::Controller.handle(page)
38
+ @action, @params, @file = YAML.load(content)
39
39
  end
40
40
 
41
41
  it "Gets a blank page" do
42
42
  getpage("/index")
43
43
 
44
- @controller.should == "TCTemplateController"
45
44
  @action.should == "index"
46
- @parameter.should == []
47
- @file.should == nil
45
+ @params.should == []
46
+ @file.should be_nil
48
47
  end
49
48
 
50
49
  it "Maps the index" do
51
50
  getpage("/")
52
51
 
53
- @controller.should == "TCTemplateController"
54
52
  @action.should == "index"
55
- @parameter.should == []
56
- @file.should == nil
53
+ @params.should == []
54
+ @file.should be_nil
57
55
  end
58
56
 
59
57
  it "Parses parameters" do
60
58
  getpage("/one/two/three")
61
59
 
62
- @controller.should == "TCTemplateController"
63
60
  @action.should == "index"
64
- @parameter.should == %w{one two three}
65
- @file.should == nil
61
+ @params.should == %w{one two three}
62
+ @file.should be_nil
66
63
  end
67
64
 
68
65
  it "Knows about other methods" do
69
66
  getpage("/some_other_method")
70
67
 
71
- @controller.should == "TCTemplateController"
72
68
  @action.should == "some_other_method"
73
- @parameter.should == []
74
- @file.should == nil
69
+ @params.should == []
70
+ @file.should be_nil
75
71
  end
76
72
 
77
73
  it "Uses external template files" do
78
74
  getpage("/external")
79
75
 
80
- @controller.should == "TCTemplateController"
81
- @action.should == "external"
82
- @parameter.should == []
83
- file = TCTemplateController.trait[:template_root]/'external.test'
84
- @file.should == File.expand_path(file)
76
+ @file.should =~ /external\.test$/
77
+ @params.should == []
78
+ file = TCTemplateController.template_root/'external.test'
79
+ @file.should == file
85
80
  end
86
81
  end
@@ -6,9 +6,8 @@ require 'spec/helper'
6
6
  testcase_requires 'amrita2'
7
7
 
8
8
  class TCTemplateAmritaController < Ramaze::Controller
9
- trait :template_root => 'spec/ramaze/template/amrita2/'
9
+ template_root 'spec/ramaze/template/amrita2/'
10
10
  trait :engine => Ramaze::Template::Amrita2
11
- trait :actionless => true
12
11
 
13
12
  def title
14
13
  "hello world"
@@ -6,7 +6,7 @@ require 'spec/helper'
6
6
  testcase_requires 'erubis'
7
7
 
8
8
  class TCTemplateErubisController < Ramaze::Controller
9
- trait :template_root => 'spec/ramaze/template/erubis/'
9
+ template_root 'spec/ramaze/template/erubis/'
10
10
  trait :engine => Ramaze::Template::Erubis
11
11
 
12
12
  def index
@@ -4,7 +4,7 @@
4
4
  require 'spec/helper'
5
5
 
6
6
  class TCTemplateController < Ramaze::Controller
7
- trait :template_root => 'spec/ramaze/template/ezamar'
7
+ template_root 'spec/ramaze/template/ezamar'
8
8
  trait :engine => Ramaze::Template::Ezamar
9
9
 
10
10
  def index text
@@ -26,7 +26,6 @@ class TCTemplateController < Ramaze::Controller
26
26
 
27
27
  def combined
28
28
  @a = 'boo'
29
- nil
30
29
  end
31
30
  end
32
31
 
@@ -6,7 +6,7 @@ require 'spec/helper'
6
6
  testcase_requires 'ramaze/template/haml'
7
7
 
8
8
  class TCTemplateHamlController < Ramaze::Controller
9
- trait :template_root => 'spec/ramaze/template/haml/'
9
+ template_root 'spec/ramaze/template/haml/'
10
10
  trait :engine => Ramaze::Template::Haml
11
11
 
12
12
  helper :link
@@ -38,7 +38,7 @@ describe "Simply calling" do
38
38
  %{<div id='content'>
39
39
  <div class='title'>
40
40
  <h1>Teen Wolf</h1>
41
- <a href="Home">Home</a>
41
+ <a href="/Home">Home</a>
42
42
  </div>
43
43
  </div>}
44
44
  end
@@ -1,4 +1,4 @@
1
1
  #content
2
2
  .title
3
3
  %h1= @title
4
- = link 'Home'
4
+ = A 'Home'
@@ -25,7 +25,7 @@ end
25
25
 
26
26
 
27
27
  class TCTemplateLiquidController < Ramaze::Controller
28
- trait :template_root => 'spec/ramaze/template/liquid/'
28
+ template_root 'spec/ramaze/template/liquid/'
29
29
  trait :engine => Ramaze::Template::Liquid
30
30
  trait :liquid_options => { :filters => ProductsFilter }
31
31
 
@@ -6,7 +6,7 @@ require 'spec/helper'
6
6
  testcase_requires 'markaby'
7
7
 
8
8
  class TCTemplateMarkabyController < Ramaze::Controller
9
- trait :template_root => 'spec/ramaze/template/markaby/'
9
+ template_root 'spec/ramaze/template/markaby/'
10
10
  trait :engine => Ramaze::Template::Markaby
11
11
 
12
12
  helper :markaby
@@ -0,0 +1,56 @@
1
+ # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require 'spec/helper'
5
+ testcase_requires 'remarkably/engines/html'
6
+
7
+ class TCTemplateRemarkablyController < Ramaze::Controller
8
+ template_root 'spec/ramaze/template/remarkably/'
9
+ trait :engine => Ramaze::Template::Remarkably
10
+
11
+ include Remarkably::Common
12
+
13
+ def index
14
+ h1 "Remarkably Index"
15
+ end
16
+
17
+ def links
18
+ ul do
19
+ li { a "Index page", :href => R(self,:index) }
20
+ li { a "Internal template", :href => R(self,:internal) }
21
+ li { a "External template", :href => R(self,:external) }
22
+ end
23
+ end
24
+
25
+ def external
26
+ end
27
+
28
+ def sum num1, num2
29
+ @num1, @num2 = num1.to_i, num2.to_i
30
+ end
31
+ end
32
+
33
+ describe "Remarkably" do
34
+ ramaze(:mapping => {'/' => TCTemplateRemarkablyController})
35
+
36
+ def retrieve(*url)
37
+ Ramaze::Controller.handle(*url)
38
+ end
39
+
40
+ it "index" do
41
+ retrieve('/').should == '<h1>Remarkably Index</h1>'
42
+ end
43
+
44
+ it "links" do
45
+ retrieve('/links').should == '<ul><li><a href="/index">Index page</a></li><li><a href="/internal">Internal template</a></li><li><a href="/external">External template</a></li></ul>'
46
+ end
47
+
48
+ it "sum" do
49
+ retrieve('/sum/1/2').should == '<div>3</div>'
50
+ end
51
+
52
+ it "external" do
53
+ retrieve('/external').should == "<html><head><title>Remarkably Test</title></head><body><h1>Remarkably Template</h1></body></html>"
54
+ end
55
+
56
+ end
@@ -0,0 +1,8 @@
1
+ html do
2
+ head do
3
+ title "Remarkably Test"
4
+ end
5
+ body do
6
+ h1 "Remarkably Template"
7
+ end
8
+ end
@@ -0,0 +1 @@
1
+ div(@num1 + @num2)
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.3
3
3
  specification_version: 1
4
4
  name: ramaze
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2007-05-11 00:00:00 +09:00
6
+ version: 0.1.1
7
+ date: 2007-05-27 00:00:00 +09:00
8
8
  summary: Ramaze tries to be a very simple Webframework without the voodoo
9
9
  require_paths:
10
10
  - lib
@@ -35,7 +35,7 @@ post_install_message: |-
35
35
  ramaze --create yourproject
36
36
 
37
37
  * Browse and try the Examples in
38
- /usr/lib/ruby/gems/1.8/gems/ramaze-0.1.0/examples
38
+ /usr/lib/ruby/gems/1.8/gems/ramaze-0.1.1/examples
39
39
 
40
40
  ============================================================
41
41
  authors:
@@ -69,12 +69,6 @@ files:
69
69
  - examples/todolist/src/model.rb
70
70
  - examples/todolist/src/controller
71
71
  - examples/todolist/src/controller/main.rb
72
- - examples/todolist/conf
73
- - examples/todolist/conf/stage.yaml
74
- - examples/todolist/conf/benchmark.yaml
75
- - examples/todolist/conf/live.yaml
76
- - examples/todolist/conf/silent.yaml
77
- - examples/todolist/conf/debug.yaml
78
72
  - examples/todolist/todolist.db
79
73
  - examples/todolist/template
80
74
  - examples/todolist/template/new.xhtml
@@ -84,8 +78,6 @@ files:
84
78
  - examples/todolist/public/js
85
79
  - examples/todolist/public/js/jquery.js
86
80
  - examples/todolist/public/css
87
- - examples/todolist/public/css/ramaze_error.css
88
- - examples/todolist/public/css/coderay.css
89
81
  - examples/todolist/public/favicon.ico
90
82
  - examples/todolist/public/ramaze.png
91
83
  - examples/todolist/public/error.xhtml
@@ -102,9 +94,11 @@ files:
102
94
  - examples/templates
103
95
  - examples/templates/template_ezamar.rb
104
96
  - examples/templates/template_erubis.rb
97
+ - examples/templates/template_remarkably.rb
105
98
  - examples/templates/template_liquid.rb
106
99
  - examples/templates/template
107
100
  - examples/templates/template/external.mab
101
+ - examples/templates/template/external.rem
108
102
  - examples/templates/template/external.zmr
109
103
  - examples/templates/template/external.amrita
110
104
  - examples/templates/template/external.liquid
@@ -120,6 +114,8 @@ files:
120
114
  - doc/meta/internals.txt
121
115
  - doc/meta/configuration.txt
122
116
  - doc/meta/announcement.txt
117
+ - doc/migrate
118
+ - doc/migrate/1110_to_1111.txt
123
119
  - doc/readme_chunks
124
120
  - doc/readme_chunks/appendix.txt
125
121
  - doc/readme_chunks/thanks.txt
@@ -133,38 +129,11 @@ files:
133
129
  - doc/COPYING.ja
134
130
  - doc/tutorial
135
131
  - doc/tutorial/todolist.html
136
- - doc/tutorial/todolist.txt
132
+ - doc/tutorial/todolist.mkd
137
133
  - doc/AUTHORS
138
- - doc/allison
139
- - doc/allison/LICENSE
140
- - doc/allison/cache
141
- - doc/allison/cache/URL
142
- - doc/allison/cache/BODY
143
- - doc/allison/cache/SRC_PAGE
144
- - doc/allison/cache/CLASS_PAGE
145
- - doc/allison/cache/FONTS
146
- - doc/allison/cache/INDEX
147
- - doc/allison/cache/STYLE
148
- - doc/allison/cache/FILE_PAGE
149
- - doc/allison/cache/METHOD_INDEX
150
- - doc/allison/cache/FR_INDEX_BODY
151
- - doc/allison/cache/JAVASCRIPT
152
- - doc/allison/cache/IMGPATH
153
- - doc/allison/cache/FILE_INDEX
154
- - doc/allison/cache/METHOD_LIST
155
- - doc/allison/cache/CLASS_INDEX
156
- - doc/allison/README
157
- - doc/allison/allison.js
158
- - doc/allison/allison.rb
159
- - doc/allison/allison.css
160
- - doc/allison/allison.gif
161
- - doc/README.html
162
134
  - doc/INSTALL
163
135
  - doc/COPYING
164
136
  - doc/ProjectInfo
165
- - doc/changes.txt
166
- - doc/changes.xml
167
- - spec/all.rb
168
137
  - spec/helper
169
138
  - spec/helper/context.rb
170
139
  - spec/helper/simple_http.rb
@@ -172,10 +141,8 @@ files:
172
141
  - spec/helper/layout.rb
173
142
  - spec/helper/requester.rb
174
143
  - spec/helper/wrap.rb
144
+ - spec/helper/minimal.rb
175
145
  - spec/ramaze
176
- - spec/ramaze/conf
177
- - spec/ramaze/conf/locale_de.yaml
178
- - spec/ramaze/conf/locale_en.yaml
179
146
  - spec/ramaze/request
180
147
  - spec/ramaze/request/mongrel.rb
181
148
  - spec/ramaze/request/webrick.rb
@@ -193,7 +160,11 @@ files:
193
160
  - spec/ramaze/template/markaby
194
161
  - spec/ramaze/template/markaby/external.mab
195
162
  - spec/ramaze/template/markaby/sum.mab
163
+ - spec/ramaze/template/remarkably
164
+ - spec/ramaze/template/remarkably/external.rem
165
+ - spec/ramaze/template/remarkably/sum.rem
196
166
  - spec/ramaze/template/liquid.rb
167
+ - spec/ramaze/template/remarkably.rb
197
168
  - spec/ramaze/template/erubis
198
169
  - spec/ramaze/template/erubis/sum.rhtml
199
170
  - spec/ramaze/template/ezamar
@@ -218,7 +189,6 @@ files:
218
189
  - spec/ramaze/template/amrita2/data.amrita
219
190
  - spec/ramaze/template/amrita2.rb
220
191
  - spec/ramaze/cache.rb
221
- - spec/ramaze/dependencies.rb
222
192
  - spec/ramaze/template.rb
223
193
  - spec/ramaze/tidy.rb
224
194
  - spec/ramaze/helper
@@ -240,11 +210,16 @@ files:
240
210
  - spec/ramaze/adapter
241
211
  - spec/ramaze/adapter/mongrel.rb
242
212
  - spec/ramaze/adapter/webrick.rb
213
+ - spec/ramaze/adapter/record.rb
243
214
  - spec/ramaze/request.rb
244
215
  - spec/ramaze/controller
245
216
  - spec/ramaze/controller/template_resolving.rb
246
217
  - spec/ramaze/controller/template
218
+ - spec/ramaze/controller/template/other
219
+ - spec/ramaze/controller/template/other/greet
220
+ - spec/ramaze/controller/template/other/greet/other.xhtml
247
221
  - spec/ramaze/controller/template/greet.xhtml
222
+ - spec/ramaze/controller/template/list.xhtml
248
223
  - spec/ramaze/controller.rb
249
224
  - spec/ramaze/public
250
225
  - spec/ramaze/public/favicon.ico
@@ -252,19 +227,20 @@ files:
252
227
  - spec/ramaze/public/test_download.css
253
228
  - spec/ramaze/public/error404.xhtml
254
229
  - spec/ramaze/gestalt.rb
255
- - spec/ramaze/global.rb
256
230
  - spec/ramaze/session.rb
257
231
  - spec/ramaze/element.rb
258
232
  - spec/ramaze/morpher.rb
259
233
  - spec/ramaze/params.rb
260
234
  - spec/examples
261
235
  - spec/examples/caching.rb
236
+ - spec/examples/todolist.rb
262
237
  - spec/examples/element.rb
263
238
  - spec/examples/simple.rb
264
239
  - spec/examples/hello.rb
265
240
  - spec/examples/templates
266
241
  - spec/examples/templates/template_ezamar.rb
267
242
  - spec/examples/templates/template_erubis.rb
243
+ - spec/examples/templates/template_remarkably.rb
268
244
  - spec/examples/templates/template_liquid.rb
269
245
  - spec/examples/templates/template_amrita2.rb
270
246
  - spec/examples/templates/template_haml.rb
@@ -279,12 +255,6 @@ files:
279
255
  - lib/proto/src/model.rb
280
256
  - lib/proto/src/controller
281
257
  - lib/proto/src/controller/main.rb
282
- - lib/proto/conf
283
- - lib/proto/conf/stage.yaml
284
- - lib/proto/conf/benchmark.yaml
285
- - lib/proto/conf/live.yaml
286
- - lib/proto/conf/silent.yaml
287
- - lib/proto/conf/debug.yaml
288
258
  - lib/proto/test
289
259
  - lib/proto/template
290
260
  - lib/proto/template/index.xhtml
@@ -294,7 +264,6 @@ files:
294
264
  - lib/proto/public/js/jquery.js
295
265
  - lib/proto/public/css
296
266
  - lib/proto/public/css/ramaze_error.css
297
- - lib/proto/public/css/coderay.css
298
267
  - lib/proto/public/favicon.ico
299
268
  - lib/proto/public/ramaze.png
300
269
  - lib/proto/public/error.zmr
@@ -302,6 +271,7 @@ files:
302
271
  - lib/ramaze
303
272
  - lib/ramaze/tool
304
273
  - lib/ramaze/tool/mime_types.yaml
274
+ - lib/ramaze/tool/record.rb
305
275
  - lib/ramaze/tool/mime.rb
306
276
  - lib/ramaze/tool/tidy.rb
307
277
  - lib/ramaze/tool/localize.rb
@@ -319,6 +289,7 @@ files:
319
289
  - lib/ramaze/template/ezamar.rb
320
290
  - lib/ramaze/template/erubis.rb
321
291
  - lib/ramaze/template/liquid.rb
292
+ - lib/ramaze/template/remarkably.rb
322
293
  - lib/ramaze/template/ezamar
323
294
  - lib/ramaze/template/ezamar/engine.rb
324
295
  - lib/ramaze/template/ezamar/element.rb
@@ -328,12 +299,16 @@ files:
328
299
  - lib/ramaze/cache.rb
329
300
  - lib/ramaze/snippets.rb
330
301
  - lib/ramaze/template.rb
302
+ - lib/ramaze/global
303
+ - lib/ramaze/global/globalstruct.rb
304
+ - lib/ramaze/global/dsl.rb
331
305
  - lib/ramaze/helper
332
306
  - lib/ramaze/helper/markaby.rb
333
307
  - lib/ramaze/helper/link.rb
334
308
  - lib/ramaze/helper/cache.rb
335
309
  - lib/ramaze/helper/feed.rb
336
310
  - lib/ramaze/helper/file.rb
311
+ - lib/ramaze/helper/cgi.rb
337
312
  - lib/ramaze/helper/redirect.rb
338
313
  - lib/ramaze/helper/form.rb
339
314
  - lib/ramaze/helper/identity.rb
@@ -361,7 +336,13 @@ files:
361
336
  - lib/ramaze/adapter/fcgi.rb
362
337
  - lib/ramaze/adapter/webrick.rb
363
338
  - lib/ramaze/adapter/cgi.rb
339
+ - lib/ramaze/adapter/base.rb
340
+ - lib/ramaze/controller
341
+ - lib/ramaze/controller/resolve.rb
342
+ - lib/ramaze/controller/error.rb
343
+ - lib/ramaze/controller/render.rb
364
344
  - lib/ramaze/controller.rb
345
+ - lib/ramaze/sourcereload.rb
365
346
  - lib/ramaze/dispatcher.rb
366
347
  - lib/ramaze/dispatcher
367
348
  - lib/ramaze/dispatcher/error.rb
@@ -370,26 +351,18 @@ files:
370
351
  - lib/ramaze/trinity.rb
371
352
  - lib/ramaze/gestalt.rb
372
353
  - lib/ramaze/global.rb
373
- - lib/ramaze/http_status.rb
354
+ - lib/ramaze/action.rb
374
355
  - lib/ramaze/helper.rb
375
356
  - lib/ramaze/snippets
376
- - lib/ramaze/snippets/hash
377
- - lib/ramaze/snippets/hash/keys_to_sym.rb
378
357
  - lib/ramaze/snippets/openstruct
379
358
  - lib/ramaze/snippets/openstruct/temp.rb
380
- - lib/ramaze/snippets/rdoc
381
- - lib/ramaze/snippets/rdoc/usage_no_exit.rb
382
359
  - lib/ramaze/snippets/kernel
383
360
  - lib/ramaze/snippets/kernel/constant.rb
384
361
  - lib/ramaze/snippets/kernel/aquire.rb
385
362
  - lib/ramaze/snippets/kernel/pretty_inspect.rb
386
- - lib/ramaze/snippets/kernel/method.rb
387
- - lib/ramaze/snippets/method
388
- - lib/ramaze/snippets/method/name.rb
389
363
  - lib/ramaze/snippets/object
390
364
  - lib/ramaze/snippets/object/traits.rb
391
365
  - lib/ramaze/snippets/ramaze
392
- - lib/ramaze/snippets/ramaze/autoreload.rb
393
366
  - lib/ramaze/snippets/ramaze/caller_lines.rb
394
367
  - lib/ramaze/snippets/ramaze/caller_info.rb
395
368
  - lib/ramaze/snippets/string
@@ -400,12 +373,14 @@ files:
400
373
  - lib/ramaze/snippets/string/snake_case.rb
401
374
  - lib/ramaze/snippets/struct
402
375
  - lib/ramaze/snippets/struct/fill.rb
376
+ - lib/ramaze/snippets/struct/values_at.rb
403
377
  - lib/ramaze/snippets/symbol
404
378
  - lib/ramaze/snippets/symbol/to_proc.rb
405
379
  - lib/ramaze/version.rb
406
380
  - lib/ramaze/inform.rb
407
381
  - rake_tasks/conf.rake
408
382
  - rake_tasks/gem.rake
383
+ - rake_tasks/spec.rake
409
384
  - rake_tasks/maintaince.rake
410
385
  test_files: []
411
386
 
@@ -459,7 +434,7 @@ dependencies:
459
434
  requirements:
460
435
  - - ">="
461
436
  - !ruby/object:Gem::Version
462
- version: 0.9.1
437
+ version: 1.0.2
463
438
  version:
464
439
  - !ruby/object:Gem::Dependency
465
440
  name: rack
@@ -468,5 +443,5 @@ dependencies:
468
443
  requirements:
469
444
  - - ">="
470
445
  - !ruby/object:Gem::Version
471
- version: 0.1.0
446
+ version: 0.2.0
472
447
  version: