manveru-innate 2009.04.01 → 2009.04.08

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/CHANGELOG +104 -0
  2. data/MANIFEST +18 -18
  3. data/Rakefile +3 -3
  4. data/example/app/retro_games.rb +6 -6
  5. data/example/app/todo/layout/default.erb +1 -1
  6. data/example/app/todo/view/index.erb +11 -11
  7. data/example/app/whywiki_erb/start.rb +1 -0
  8. data/example/app/whywiki_erb/view/{edit.html.erb → edit.erb} +0 -0
  9. data/example/app/whywiki_erb/view/{index.html.erb → index.erb} +0 -0
  10. data/example/howto_spec.rb +1 -1
  11. data/example/session.rb +3 -3
  12. data/innate.gemspec +3 -12
  13. data/lib/innate/action.rb +2 -1
  14. data/lib/innate/helper.rb +18 -27
  15. data/lib/innate/helper/cgi.rb +30 -20
  16. data/lib/innate/helper/render.rb +80 -0
  17. data/lib/innate/mock.rb +2 -3
  18. data/lib/innate/node.rb +79 -50
  19. data/lib/innate/options.rb +1 -1
  20. data/lib/innate/request.rb +3 -23
  21. data/lib/innate/spec.rb +3 -6
  22. data/lib/innate/version.rb +1 -1
  23. data/lib/innate/view/erb.rb +1 -1
  24. data/lib/innate/view/etanni.rb +2 -2
  25. data/lib/innate/view/none.rb +1 -1
  26. data/spec/innate/action/layout.rb +1 -1
  27. data/spec/innate/action/layout/file_layout.xhtml +1 -0
  28. data/spec/innate/helper/aspect.rb +6 -6
  29. data/spec/innate/helper/flash.rb +6 -6
  30. data/spec/innate/helper/render.rb +157 -0
  31. data/spec/innate/helper/view/aspect_hello.xhtml +1 -0
  32. data/spec/innate/helper/view/locals.xhtml +1 -0
  33. data/spec/innate/helper/view/loop.xhtml +4 -0
  34. data/spec/innate/helper/view/num.xhtml +1 -0
  35. data/spec/innate/helper/view/partial.xhtml +1 -0
  36. data/spec/innate/helper/view/recursive.xhtml +7 -0
  37. data/spec/innate/node/node.rb +5 -13
  38. data/spec/innate/node/view/another_layout/{another_layout.erb → another_layout.xhtml} +1 -1
  39. data/spec/innate/node/view/{bar.erb → bar.xhtml} +0 -0
  40. data/spec/innate/node/view/foo.html.xhtml +1 -0
  41. data/spec/innate/node/view/{only_view.erb → only_view.xhtml} +0 -0
  42. data/spec/innate/node/view/with_layout.xhtml +1 -0
  43. data/spec/innate/provides.rb +2 -2
  44. data/spec/innate/provides/list.html.xhtml +1 -0
  45. data/spec/innate/provides/list.txt.xhtml +1 -0
  46. data/spec/innate/state/fiber.rb +8 -7
  47. data/tasks/bacon.rake +38 -21
  48. metadata +22 -51
  49. data/lib/innate/helper/partial.rb +0 -93
  50. data/spec/innate/action/layout/file_layout.erb +0 -1
  51. data/spec/innate/helper/partial.rb +0 -101
  52. data/spec/innate/helper/view/aspect_hello.erb +0 -1
  53. data/spec/innate/helper/view/locals.erb +0 -1
  54. data/spec/innate/helper/view/loop.erb +0 -4
  55. data/spec/innate/helper/view/num.erb +0 -1
  56. data/spec/innate/helper/view/partial.erb +0 -1
  57. data/spec/innate/helper/view/recursive.erb +0 -8
  58. data/spec/innate/node/view/foo.html.erb +0 -1
  59. data/spec/innate/node/view/with_layout.erb +0 -1
  60. data/spec/innate/provides/list.html.erb +0 -1
  61. data/spec/innate/provides/list.txt.erb +0 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,107 @@
1
+ [89ab244 | Tue Apr 07 16:17:07 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
2
+
3
+ * bring the retro_games example up to date
4
+
5
+ [c1b6939 | Tue Apr 07 14:30:14 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
6
+
7
+ * Fix typo in howto_spec example
8
+
9
+ [c1f7bb8 | Tue Apr 07 12:24:50 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
10
+
11
+ * Improve Helper::CGI, don't accept more than one argument per method
12
+
13
+ [c01a0ce | Tue Apr 07 02:07:28 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
14
+
15
+ * Warn if action is invalid
16
+
17
+ [d749887 | Tue Apr 07 02:07:01 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
18
+
19
+ * Remove Helper::Render#render_template
20
+
21
+ [fba39b5 | Mon Apr 06 03:26:29 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
22
+
23
+ * Remove specs for Helper::Partial
24
+
25
+ [98bc6f7 | Mon Apr 06 03:25:52 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
26
+
27
+ * Add more specs and refine Helper::Render
28
+
29
+ [616b5aa | Mon Apr 06 03:03:21 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
30
+
31
+ * Provide direct access to Helper::Render methods through extension
32
+
33
+ [696f85d | Mon Apr 06 02:58:09 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
34
+
35
+ * Make Helper::Render#render_template work and add specs
36
+
37
+ [b0fcf13 | Sun Apr 05 23:51:09 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
38
+
39
+ * Adding Helper::Render, this should be able to cover all our rendering needs
40
+
41
+ [ea02bbe | Sun Apr 05 23:49:52 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
42
+
43
+ * Remove Helper::Partial, to be replaced by Helper::Render
44
+
45
+ [52c9943 | Sun Apr 05 23:47:01 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
46
+
47
+ * just fix some annoying things
48
+
49
+ [cd45648 | Sun Apr 05 23:46:17 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
50
+
51
+ * Refactor Helper to use HelpersHelper.options
52
+
53
+ [4a1b7f6 | Sun Apr 05 14:25:43 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
54
+
55
+ * remove some more methods from Request, they depend on a method in ramaze
56
+
57
+ [6e0b421 | Sun Apr 05 09:22:19 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
58
+
59
+ * Make multipart building a bit more compact
60
+
61
+ [2f17bf6 | Sun Apr 05 14:23:45 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
62
+
63
+ * Make some variables more 'communicative', as reek puts it
64
+
65
+ [348e179 | Sat Apr 04 06:37:50 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
66
+
67
+ * Caching for template locations finally working, this should reduce the disk IO through globbing considerably, even if it is still updating the locations for every request
68
+
69
+ [8555277 | Sat Apr 04 06:27:54 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
70
+
71
+ * Better bacon task
72
+
73
+ [110243b | Fri Apr 03 12:08:41 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
74
+
75
+ * Experimental templating path caching
76
+
77
+ [258d7c9 | Fri Apr 03 13:01:12 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
78
+
79
+ * Use Etanni engine for specs and most examples
80
+
81
+ [2bf8941 | Fri Apr 03 12:59:56 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
82
+
83
+ * Comment out gemspec dependencies until rack is released
84
+
85
+ [57078ac | Fri Apr 03 12:58:24 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
86
+
87
+ * Remove the extra newlines introduced with Etanni
88
+
89
+ [51b4797 | Fri Apr 03 12:58:03 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
90
+
91
+ * Relax views by using #to_s instead of #to_str
92
+
93
+ [d8475d3 | Fri Apr 03 09:48:49 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
94
+
95
+ * Don't carry over view_value into layout actions
96
+
97
+ [8e2788f | Thu Apr 02 03:50:52 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
98
+
99
+ * Fix view and layout mapping if there are multiple view_mappings
100
+
101
+ [8e93e87 | Tue Mar 31 16:35:56 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
102
+
103
+ * Version 2009.04.01
104
+
1
105
  [1a7242b | Tue Mar 31 16:32:40 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
2
106
 
3
107
  * Optional is called Optioned now, watch out
data/MANIFEST CHANGED
@@ -11,8 +11,8 @@ example/app/todo/view/index.erb
11
11
  example/app/whywiki_erb/layout/wiki.html.erb
12
12
  example/app/whywiki_erb/spec/wiki.rb
13
13
  example/app/whywiki_erb/start.rb
14
- example/app/whywiki_erb/view/edit.html.erb
15
- example/app/whywiki_erb/view/index.html.erb
14
+ example/app/whywiki_erb/view/edit.erb
15
+ example/app/whywiki_erb/view/index.erb
16
16
  example/custom_middleware.rb
17
17
  example/hello.rb
18
18
  example/howto_spec.rb
@@ -39,8 +39,8 @@ lib/innate/helper/aspect.rb
39
39
  lib/innate/helper/cgi.rb
40
40
  lib/innate/helper/flash.rb
41
41
  lib/innate/helper/link.rb
42
- lib/innate/helper/partial.rb
43
42
  lib/innate/helper/redirect.rb
43
+ lib/innate/helper/render.rb
44
44
  lib/innate/helper/send_file.rb
45
45
  lib/innate/log.rb
46
46
  lib/innate/log/color_formatter.rb
@@ -73,7 +73,7 @@ spec/example/link.rb
73
73
  spec/example/session.rb
74
74
  spec/helper.rb
75
75
  spec/innate/action/layout.rb
76
- spec/innate/action/layout/file_layout.erb
76
+ spec/innate/action/layout/file_layout.xhtml
77
77
  spec/innate/cache/common.rb
78
78
  spec/innate/cache/marshal.rb
79
79
  spec/innate/cache/memory.rb
@@ -84,30 +84,30 @@ spec/innate/helper/aspect.rb
84
84
  spec/innate/helper/cgi.rb
85
85
  spec/innate/helper/flash.rb
86
86
  spec/innate/helper/link.rb
87
- spec/innate/helper/partial.rb
88
87
  spec/innate/helper/redirect.rb
88
+ spec/innate/helper/render.rb
89
89
  spec/innate/helper/send_file.rb
90
- spec/innate/helper/view/aspect_hello.erb
91
- spec/innate/helper/view/locals.erb
92
- spec/innate/helper/view/loop.erb
93
- spec/innate/helper/view/num.erb
94
- spec/innate/helper/view/partial.erb
95
- spec/innate/helper/view/recursive.erb
90
+ spec/innate/helper/view/aspect_hello.xhtml
91
+ spec/innate/helper/view/locals.xhtml
92
+ spec/innate/helper/view/loop.xhtml
93
+ spec/innate/helper/view/num.xhtml
94
+ spec/innate/helper/view/partial.xhtml
95
+ spec/innate/helper/view/recursive.xhtml
96
96
  spec/innate/mock.rb
97
97
  spec/innate/node/mapping.rb
98
98
  spec/innate/node/node.rb
99
99
  spec/innate/node/resolve.rb
100
- spec/innate/node/view/another_layout/another_layout.erb
101
- spec/innate/node/view/bar.erb
102
- spec/innate/node/view/foo.html.erb
103
- spec/innate/node/view/only_view.erb
104
- spec/innate/node/view/with_layout.erb
100
+ spec/innate/node/view/another_layout/another_layout.xhtml
101
+ spec/innate/node/view/bar.xhtml
102
+ spec/innate/node/view/foo.html.xhtml
103
+ spec/innate/node/view/only_view.xhtml
104
+ spec/innate/node/view/with_layout.xhtml
105
105
  spec/innate/node/wrap_action_call.rb
106
106
  spec/innate/options.rb
107
107
  spec/innate/parameter.rb
108
108
  spec/innate/provides.rb
109
- spec/innate/provides/list.html.erb
110
- spec/innate/provides/list.txt.erb
109
+ spec/innate/provides/list.html.xhtml
110
+ spec/innate/provides/list.txt.xhtml
111
111
  spec/innate/request.rb
112
112
  spec/innate/route.rb
113
113
  spec/innate/session.rb
data/Rakefile CHANGED
@@ -22,9 +22,9 @@ GEMSPEC = Gem::Specification.new{|s|
22
22
  s.has_rdoc = true
23
23
  s.require_path = 'lib'
24
24
 
25
- s.add_runtime_dependency('rack', '>= 0.9.1') # lies!
26
- s.add_development_dependency('bacon', '>= 1.0')
27
- s.add_development_dependency('json', '~> 1.1.3')
25
+ # s.add_runtime_dependency('rack', '>= 0.9.1') # lies!
26
+ # s.add_development_dependency('bacon', '>= 1.0')
27
+ # s.add_development_dependency('json', '~> 1.1.3')
28
28
  }
29
29
 
30
30
  Dir['tasks/*.rake'].each{|f| import(f) }
@@ -25,7 +25,7 @@ class Games
25
25
  end
26
26
 
27
27
  def vote(name)
28
- STORE[url_decode(name)] += 1
28
+ STORE[name] += 1
29
29
 
30
30
  redirect_referrer
31
31
  end
@@ -39,17 +39,17 @@ class Games
39
39
  </head>
40
40
  <body>
41
41
  <h1>Vote on your favorite Retro Game</h1>
42
- <form action="<%= r :create %>" method="post">
42
+ <form action="#{ r(:create) }" method="post">
43
43
  <input type="text" name="name" />
44
44
  <input type="submit" value="Add" />
45
45
  </form>
46
46
  <ol>
47
- <% STORE.each do |name, votes| %>
47
+ <?r STORE.each do |name, votes| ?>
48
48
  <li>
49
- <%= Games.a("Vote", "/vote/#{u name}") %>
50
- <%= "%5d => %s" % [votes, name] %>
49
+ #{ a("Vote", r(:vote, u(name))) }
50
+ #{ "%5d => %s" % [votes, name] }
51
51
  </li>
52
- <% end %>
52
+ <?r end ?>
53
53
  </ol>
54
54
  </body>
55
55
  </html>
@@ -6,6 +6,6 @@
6
6
  </head>
7
7
  <body>
8
8
  <h1>Organize your life and learn Innate</h1>
9
- <%= @content %>
9
+ #{ @content }
10
10
  </body>
11
11
  </html>
@@ -1,4 +1,4 @@
1
- <form method="post" action="<%= r :create %>">
1
+ <form method="post" action="#{ r :create }">
2
2
  <fieldset>
3
3
  <legend>Create new task</legend>
4
4
 
@@ -10,30 +10,30 @@
10
10
  </form>
11
11
 
12
12
  <table>
13
- <% @list.each do |title, done| %>
13
+ <?r @list.each do |title, done| ?>
14
14
  <tr>
15
- <form method="post" action="<%= r :update %>">
16
- <input type="hidden" name="id" value="<%= h title %>" />
15
+ <form method="post" action="#{ r :update }">
16
+ <input type="hidden" name="id" value="#{ h title }" />
17
17
  <td>
18
- <input type="text" name="title" value="<%= h title %>" />
18
+ <input type="text" name="title" value="#{ h title }" />
19
19
  </td>
20
20
  <td>
21
- <% if done %>
21
+ <?r if done ?>
22
22
  <input type="checkbox" name="done" checked="checked" />
23
- <% else %>
23
+ <?r else ?>
24
24
  <input type="checkbox" name="done" />
25
- <% end %>
25
+ <?r end ?>
26
26
  </td>
27
27
  <td>
28
28
  <input type="submit" value="Update" />
29
29
  </td>
30
30
  </form>
31
- <form method="post" action="<%= r :delete %>">
32
- <input type="hidden" name="id" value="<%= h title %>" />
31
+ <form method="post" action="#{ r :delete }">
32
+ <input type="hidden" name="id" value="#{ h title }" />
33
33
  <td>
34
34
  <input type="submit" value="Delete" />
35
35
  </td>
36
36
  </form>
37
37
  </tr>
38
- <% end %>
38
+ <?r end ?>
39
39
  </table>
@@ -7,6 +7,7 @@ DB = YAML::Store.new('wiki.yaml') unless defined?(DB)
7
7
  class Wiki
8
8
  Innate.node '/'
9
9
  layout 'wiki'
10
+ engine :ERB
10
11
 
11
12
  def index(page = 'Home')
12
13
  @page = page
@@ -26,7 +26,7 @@ describe 'An example spec' do
26
26
  got['Content-Type'].should == 'text/html'
27
27
  end
28
28
 
29
- should 'respond to /' do
29
+ should 'respond to /foo' do
30
30
  got = get('/foo')
31
31
  got.status.should == 200
32
32
  got.body.should == "I should be at /foo"
@@ -11,9 +11,9 @@ class Hello
11
11
  <body>
12
12
  <h1>Session example</h1>
13
13
  <p>
14
- Value is: <%= session[:value] %><br />
15
- <%= a :increment %><br />
16
- <%= a :decrement %>
14
+ Value is: #{ session[:value] }<br />
15
+ #{ a :increment }<br />
16
+ #{ a :decrement }
17
17
  </p>
18
18
  </body>
19
19
  </html>
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{innate}
5
- s.version = "2009.04.01"
5
+ s.version = "2009.04.08"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Michael 'manveru' Fellinger"]
9
- s.date = %q{2009-04-01}
9
+ s.date = %q{2009-04-08}
10
10
  s.description = %q{Simple, straight-forward base for web-frameworks.}
11
11
  s.email = %q{m.fellinger@gmail.com}
12
- s.files = ["CHANGELOG", "COPYING", "MANIFEST", "README.md", "Rakefile", "example/app/retro_games.rb", "example/app/todo/layout/default.erb", "example/app/todo/spec/todo.rb", "example/app/todo/start.rb", "example/app/todo/view/index.erb", "example/app/whywiki_erb/layout/wiki.html.erb", "example/app/whywiki_erb/spec/wiki.rb", "example/app/whywiki_erb/start.rb", "example/app/whywiki_erb/view/edit.html.erb", "example/app/whywiki_erb/view/index.html.erb", "example/custom_middleware.rb", "example/hello.rb", "example/howto_spec.rb", "example/link.rb", "example/provides.rb", "example/session.rb", "innate.gemspec", "lib/innate.rb", "lib/innate/action.rb", "lib/innate/adapter.rb", "lib/innate/cache.rb", "lib/innate/cache/api.rb", "lib/innate/cache/drb.rb", "lib/innate/cache/file_based.rb", "lib/innate/cache/marshal.rb", "lib/innate/cache/memory.rb", "lib/innate/cache/yaml.rb", "lib/innate/core_compatibility/basic_object.rb", "lib/innate/core_compatibility/string.rb", "lib/innate/current.rb", "lib/innate/dynamap.rb", "lib/innate/helper.rb", "lib/innate/helper/aspect.rb", "lib/innate/helper/cgi.rb", "lib/innate/helper/flash.rb", "lib/innate/helper/link.rb", "lib/innate/helper/partial.rb", "lib/innate/helper/redirect.rb", "lib/innate/helper/send_file.rb", "lib/innate/log.rb", "lib/innate/log/color_formatter.rb", "lib/innate/log/hub.rb", "lib/innate/middleware_compiler.rb", "lib/innate/mock.rb", "lib/innate/node.rb", "lib/innate/options.rb", "lib/innate/options/dsl.rb", "lib/innate/options/stub.rb", "lib/innate/request.rb", "lib/innate/response.rb", "lib/innate/route.rb", "lib/innate/session.rb", "lib/innate/session/flash.rb", "lib/innate/spec.rb", "lib/innate/state.rb", "lib/innate/state/accessor.rb", "lib/innate/state/fiber.rb", "lib/innate/state/thread.rb", "lib/innate/traited.rb", "lib/innate/trinity.rb", "lib/innate/version.rb", "lib/innate/view.rb", "lib/innate/view/erb.rb", "lib/innate/view/etanni.rb", "lib/innate/view/none.rb", "spec/example/hello.rb", "spec/example/link.rb", "spec/example/session.rb", "spec/helper.rb", "spec/innate/action/layout.rb", "spec/innate/action/layout/file_layout.erb", "spec/innate/cache/common.rb", "spec/innate/cache/marshal.rb", "spec/innate/cache/memory.rb", "spec/innate/cache/yaml.rb", "spec/innate/dynamap.rb", "spec/innate/helper.rb", "spec/innate/helper/aspect.rb", "spec/innate/helper/cgi.rb", "spec/innate/helper/flash.rb", "spec/innate/helper/link.rb", "spec/innate/helper/partial.rb", "spec/innate/helper/redirect.rb", "spec/innate/helper/send_file.rb", "spec/innate/helper/view/aspect_hello.erb", "spec/innate/helper/view/locals.erb", "spec/innate/helper/view/loop.erb", "spec/innate/helper/view/num.erb", "spec/innate/helper/view/partial.erb", "spec/innate/helper/view/recursive.erb", "spec/innate/mock.rb", "spec/innate/node/mapping.rb", "spec/innate/node/node.rb", "spec/innate/node/resolve.rb", "spec/innate/node/view/another_layout/another_layout.erb", "spec/innate/node/view/bar.erb", "spec/innate/node/view/foo.html.erb", "spec/innate/node/view/only_view.erb", "spec/innate/node/view/with_layout.erb", "spec/innate/node/wrap_action_call.rb", "spec/innate/options.rb", "spec/innate/parameter.rb", "spec/innate/provides.rb", "spec/innate/provides/list.html.erb", "spec/innate/provides/list.txt.erb", "spec/innate/request.rb", "spec/innate/route.rb", "spec/innate/session.rb", "spec/innate/state/fiber.rb", "spec/innate/state/thread.rb", "spec/innate/traited.rb", "tasks/bacon.rake", "tasks/changelog.rake", "tasks/gem.rake", "tasks/gem_installer.rake", "tasks/grancher.rake", "tasks/install_dependencies.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake"]
12
+ s.files = ["CHANGELOG", "COPYING", "MANIFEST", "README.md", "Rakefile", "example/app/retro_games.rb", "example/app/todo/layout/default.erb", "example/app/todo/spec/todo.rb", "example/app/todo/start.rb", "example/app/todo/view/index.erb", "example/app/whywiki_erb/layout/wiki.html.erb", "example/app/whywiki_erb/spec/wiki.rb", "example/app/whywiki_erb/start.rb", "example/app/whywiki_erb/view/edit.erb", "example/app/whywiki_erb/view/index.erb", "example/custom_middleware.rb", "example/hello.rb", "example/howto_spec.rb", "example/link.rb", "example/provides.rb", "example/session.rb", "innate.gemspec", "lib/innate.rb", "lib/innate/action.rb", "lib/innate/adapter.rb", "lib/innate/cache.rb", "lib/innate/cache/api.rb", "lib/innate/cache/drb.rb", "lib/innate/cache/file_based.rb", "lib/innate/cache/marshal.rb", "lib/innate/cache/memory.rb", "lib/innate/cache/yaml.rb", "lib/innate/core_compatibility/basic_object.rb", "lib/innate/core_compatibility/string.rb", "lib/innate/current.rb", "lib/innate/dynamap.rb", "lib/innate/helper.rb", "lib/innate/helper/aspect.rb", "lib/innate/helper/cgi.rb", "lib/innate/helper/flash.rb", "lib/innate/helper/link.rb", "lib/innate/helper/redirect.rb", "lib/innate/helper/render.rb", "lib/innate/helper/send_file.rb", "lib/innate/log.rb", "lib/innate/log/color_formatter.rb", "lib/innate/log/hub.rb", "lib/innate/middleware_compiler.rb", "lib/innate/mock.rb", "lib/innate/node.rb", "lib/innate/options.rb", "lib/innate/options/dsl.rb", "lib/innate/options/stub.rb", "lib/innate/request.rb", "lib/innate/response.rb", "lib/innate/route.rb", "lib/innate/session.rb", "lib/innate/session/flash.rb", "lib/innate/spec.rb", "lib/innate/state.rb", "lib/innate/state/accessor.rb", "lib/innate/state/fiber.rb", "lib/innate/state/thread.rb", "lib/innate/traited.rb", "lib/innate/trinity.rb", "lib/innate/version.rb", "lib/innate/view.rb", "lib/innate/view/erb.rb", "lib/innate/view/etanni.rb", "lib/innate/view/none.rb", "spec/example/hello.rb", "spec/example/link.rb", "spec/example/session.rb", "spec/helper.rb", "spec/innate/action/layout.rb", "spec/innate/action/layout/file_layout.xhtml", "spec/innate/cache/common.rb", "spec/innate/cache/marshal.rb", "spec/innate/cache/memory.rb", "spec/innate/cache/yaml.rb", "spec/innate/dynamap.rb", "spec/innate/helper.rb", "spec/innate/helper/aspect.rb", "spec/innate/helper/cgi.rb", "spec/innate/helper/flash.rb", "spec/innate/helper/link.rb", "spec/innate/helper/redirect.rb", "spec/innate/helper/render.rb", "spec/innate/helper/send_file.rb", "spec/innate/helper/view/aspect_hello.xhtml", "spec/innate/helper/view/locals.xhtml", "spec/innate/helper/view/loop.xhtml", "spec/innate/helper/view/num.xhtml", "spec/innate/helper/view/partial.xhtml", "spec/innate/helper/view/recursive.xhtml", "spec/innate/mock.rb", "spec/innate/node/mapping.rb", "spec/innate/node/node.rb", "spec/innate/node/resolve.rb", "spec/innate/node/view/another_layout/another_layout.xhtml", "spec/innate/node/view/bar.xhtml", "spec/innate/node/view/foo.html.xhtml", "spec/innate/node/view/only_view.xhtml", "spec/innate/node/view/with_layout.xhtml", "spec/innate/node/wrap_action_call.rb", "spec/innate/options.rb", "spec/innate/parameter.rb", "spec/innate/provides.rb", "spec/innate/provides/list.html.xhtml", "spec/innate/provides/list.txt.xhtml", "spec/innate/request.rb", "spec/innate/route.rb", "spec/innate/session.rb", "spec/innate/state/fiber.rb", "spec/innate/state/thread.rb", "spec/innate/traited.rb", "tasks/bacon.rake", "tasks/changelog.rake", "tasks/gem.rake", "tasks/gem_installer.rake", "tasks/grancher.rake", "tasks/install_dependencies.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake"]
13
13
  s.has_rdoc = true
14
14
  s.homepage = %q{http://github.com/manveru/innate}
15
15
  s.require_paths = ["lib"]
@@ -21,17 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.specification_version = 2
22
22
 
23
23
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
24
- s.add_runtime_dependency(%q<rack>, [">= 0.9.1"])
25
- s.add_development_dependency(%q<bacon>, [">= 1.0"])
26
- s.add_development_dependency(%q<json>, ["~> 1.1.3"])
27
24
  else
28
- s.add_dependency(%q<rack>, [">= 0.9.1"])
29
- s.add_dependency(%q<bacon>, [">= 1.0"])
30
- s.add_dependency(%q<json>, ["~> 1.1.3"])
31
25
  end
32
26
  else
33
- s.add_dependency(%q<rack>, [">= 0.9.1"])
34
- s.add_dependency(%q<bacon>, [">= 1.0"])
35
- s.add_dependency(%q<json>, ["~> 1.1.3"])
36
27
  end
37
28
  end
@@ -100,7 +100,7 @@ module Innate
100
100
  self.variables[:content] ||= nil
101
101
 
102
102
  instance.wrap_action_call(self) do
103
- copy_variables # this might another position after all
103
+ copy_variables # this might need another position after all
104
104
  self.value = instance.__send__(method, *params) if method
105
105
  self.view_value = File.read(view) if view
106
106
 
@@ -117,6 +117,7 @@ module Innate
117
117
  action = dup
118
118
  action.view, action.method = layout_view_or_method(*layout)
119
119
  action.layout = nil
120
+ action.view_value = nil
120
121
  action.sync_variables(self)
121
122
  body, content_type = yield
122
123
  action.variables[:content] = body
@@ -11,6 +11,7 @@ module Innate
11
11
  def self.included(into)
12
12
  into.extend(HelperAccess)
13
13
  into.__send__(:include, Trinity)
14
+ into.helper(*HelpersHelper.options[:default])
14
15
  end
15
16
  end
16
17
 
@@ -63,34 +64,27 @@ module Innate
63
64
  #
64
65
  # p Innate::HelpersHelper.each(:cgi, :link, :aspect)
65
66
  module HelpersHelper
66
- EXTS = %w[rb so bundle]
67
+ include Optioned
67
68
 
68
- # By default, lib/innate/ is added to the PATH, you may add your
69
- # application root here so innate will look in your own helper/ directory.
70
- PATH = []
69
+ options.dsl do
70
+ o "Paths that will be searched for helper files",
71
+ :paths, [Dir.pwd, File.dirname(__FILE__)]
71
72
 
72
- # The namespaces that may container helper modules.
73
- # Lookup is done from left to right.
74
- POOL = []
73
+ o "Namespaces that will be searched for helper modules",
74
+ :namespaces, [Helper]
75
75
 
76
- # all of the following are singleton methods
76
+ o "Filename extensions considered for helper files",
77
+ :exts, %w[rb so bundle]
77
78
 
78
- module_function
79
-
80
- def add_pool(pool)
81
- POOL.unshift(pool)
82
- POOL.uniq!
79
+ o "Default helpers, added on inclusion of the Helper module",
80
+ :default, [:aspect, :cgi, :flash, :link, :render, :redirect, :send_file]
83
81
  end
84
82
 
85
- add_pool(Helper)
83
+ EXTS = %w[rb so bundle]
86
84
 
87
- def add_path(path)
88
- PATH.unshift(File.expand_path(path))
89
- PATH.uniq!
90
- end
85
+ # all of the following are singleton methods
91
86
 
92
- add_path(File.dirname(__FILE__))
93
- add_path('')
87
+ module_function
94
88
 
95
89
  # Yield all the modules we can find for the given names of helpers, try to
96
90
  # require them if not available.
@@ -160,7 +154,7 @@ module Innate
160
154
  def get(name)
161
155
  name = name.to_s.split('_').map{|e| e.capitalize}.join
162
156
 
163
- POOL.each do |namespace|
157
+ options.namespaces.each do |namespace|
164
158
  found = namespace.constants.grep(/^#{name}$/i).first
165
159
  return namespace.const_get(found) if found
166
160
  end
@@ -181,12 +175,9 @@ module Innate
181
175
  # Return a nice list of filenames in correct locations with correct
182
176
  # filename-extensions.
183
177
  def glob(name = '*')
184
- "{#{paths.join(',')}}/helper/#{name}.{#{EXTS.join(',')}}"
185
- end
186
-
187
- # In case you want to do something better.
188
- def paths
189
- PATH
178
+ exts, paths = options.exts, options.paths
179
+ paths.uniq!
180
+ "{#{paths.join(',')}}/helper/#{name}.{#{exts.join(',')}}"
190
181
  end
191
182
  end
192
183
  end