manveru-innate 2009.04.18 → 2009.05

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 (48) hide show
  1. data/CHANGELOG +230 -0
  2. data/MANIFEST +2 -4
  3. data/Rakefile +6 -2
  4. data/example/app/whywiki_erb/start.rb +1 -1
  5. data/innate.gemspec +7 -3
  6. data/lib/innate.rb +5 -4
  7. data/lib/innate/action.rb +17 -25
  8. data/lib/innate/cache.rb +1 -1
  9. data/lib/innate/cache/drb.rb +5 -5
  10. data/lib/innate/cache/file_based.rb +3 -0
  11. data/lib/innate/cache/marshal.rb +4 -1
  12. data/lib/innate/cache/memory.rb +1 -2
  13. data/lib/innate/cache/yaml.rb +4 -1
  14. data/lib/innate/current.rb +11 -13
  15. data/lib/innate/dynamap.rb +5 -0
  16. data/lib/innate/helper.rb +9 -7
  17. data/lib/innate/helper/aspect.rb +9 -9
  18. data/lib/innate/helper/cgi.rb +3 -0
  19. data/lib/innate/helper/redirect.rb +1 -1
  20. data/lib/innate/helper/render.rb +68 -7
  21. data/lib/innate/log/color_formatter.rb +19 -13
  22. data/lib/innate/node.rb +38 -35
  23. data/lib/innate/options/dsl.rb +5 -2
  24. data/lib/innate/request.rb +1 -1
  25. data/lib/innate/response.rb +1 -0
  26. data/lib/innate/route.rb +4 -0
  27. data/lib/innate/session.rb +16 -14
  28. data/lib/innate/state.rb +10 -11
  29. data/lib/innate/state/accessor.rb +8 -8
  30. data/lib/innate/traited.rb +15 -10
  31. data/lib/innate/version.rb +1 -1
  32. data/lib/innate/view.rb +41 -4
  33. data/lib/innate/view/erb.rb +1 -2
  34. data/lib/innate/view/etanni.rb +9 -12
  35. data/spec/innate/action/layout.rb +0 -3
  36. data/spec/innate/helper/flash.rb +0 -3
  37. data/spec/innate/helper/redirect.rb +11 -0
  38. data/spec/innate/helper/render.rb +32 -0
  39. data/spec/innate/node/node.rb +1 -0
  40. data/spec/innate/options.rb +5 -1
  41. data/tasks/authors.rake +30 -0
  42. data/tasks/release.rake +3 -3
  43. data/tasks/ycov.rake +84 -0
  44. metadata +16 -9
  45. data/lib/innate/state/fiber.rb +0 -74
  46. data/lib/innate/state/thread.rb +0 -47
  47. data/spec/innate/state/fiber.rb +0 -58
  48. data/spec/innate/state/thread.rb +0 -40
data/CHANGELOG CHANGED
@@ -1,3 +1,233 @@
1
+ [9486b35 | Wed May 06 15:37:19 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
2
+
3
+ * VERSION=xxx rake release:xxx
4
+
5
+ [14feedf | Wed May 06 15:33:48 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
6
+
7
+ * Bring rakefile up to date
8
+
9
+ [2252c28 | Wed May 06 15:20:19 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
10
+
11
+ * Last minute changes to tasks
12
+
13
+ [ddc4560 | Wed May 06 15:14:56 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
14
+
15
+ * Add some ycov tasks, not all that tested yet
16
+
17
+ [146e349 | Wed May 06 12:56:27 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
18
+
19
+ * raise a more meaningful error when trying to assign to a non-existent option
20
+
21
+ [21bbd9b | Tue May 05 06:08:06 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
22
+
23
+ * Remove some (c)
24
+
25
+ [8fd62a3 | Tue May 05 04:48:32 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
26
+
27
+ * Make Session compatible with the Rack spec, prepare to make it a middleware
28
+
29
+ [a73a54e | Tue May 05 04:37:25 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
30
+
31
+ * Tell people that using YAML/Marshal cache is a bad idea in some cases
32
+
33
+ [fff4e2a | Tue May 05 04:30:24 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
34
+
35
+ * Some docs fixes
36
+
37
+ [d90138c | Mon May 04 11:19:35 UTC 2009] Ryan Grove <ryan@wonko.com>
38
+
39
+ * Add a read_cache option (off by default) to control caching of template files on read
40
+
41
+ [aaa9b96 | Sun May 03 04:04:18 UTC 2009] Ryan Grove <ryan@wonko.com>
42
+
43
+ * When the view cache is enabled and Innate is in :live mode, cache view files after the first read to prevent unnecessary filesystem reads in the future.
44
+
45
+ [06c224f | Mon May 04 16:49:15 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
46
+
47
+ * Fix update_mapping_shared, it would try to walk files and was buggy
48
+
49
+ [e3ad651 | Mon May 04 03:28:49 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
50
+
51
+ * remove specs for state
52
+
53
+ [f69716d | Sun May 03 17:37:06 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
54
+
55
+ * Implement caching of traits
56
+
57
+ [0434785 | Sat May 02 15:56:05 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
58
+
59
+ * Remove useless token from Etanni
60
+
61
+ [d0356c6 | Sat May 02 06:05:42 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
62
+
63
+ * Use clearer syntax for the option in view
64
+
65
+ [2c3c1ca | Sat May 02 05:40:54 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
66
+
67
+ * Elaborate what +filename+ means
68
+
69
+ [12d3666 | Sat May 02 05:40:40 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
70
+
71
+ * Only emit warning when the action is really invalid
72
+
73
+ [5cb9b41 | Sat May 02 05:37:25 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
74
+
75
+ * Put the require of find into innate.rb
76
+
77
+ [89d5858 | Sat May 02 14:24:30 UTC 2009] Andreas Karlsson <andreas@proxel.se>
78
+
79
+ * Simplify copy_variables by not using eval.
80
+
81
+ Copying to an instance instead of a binding simplifies
82
+ the code while also giving a minor performance enhancement
83
+ as a bonus.
84
+
85
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
86
+
87
+ [d1fe1f4 | Sat May 02 14:38:28 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
88
+
89
+ * copy thread variables in Innate::defer
90
+
91
+ [83d0a93 | Sat May 02 13:59:52 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
92
+
93
+ * Remove Innate::STATE
94
+
95
+ [f9ff691 | Fri May 01 20:04:20 UTC 2009] Andreas Karlsson <andreas@proxel.se>
96
+
97
+ * Move require due to profiling results.
98
+
99
+ When profiling with ruby-prof it was reveiled to me that a
100
+ major part of the time was spent inside require. Benchmarking
101
+ with a simple hello world application revealed it to be about
102
+ 25 percent faster without this require.
103
+
104
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
105
+
106
+ [4155ea9 | Fri May 01 15:51:53 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
107
+
108
+ * Only warn if we encounter an invalid action in render_custom, try to render still
109
+
110
+ [b4a9e70 | Fri May 01 15:46:49 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
111
+
112
+ * Be compatible with rack-test
113
+
114
+ [3db47bc | Fri May 01 15:46:38 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
115
+
116
+ * Be compatible with 1.8
117
+
118
+ [b3fb7be | Fri May 01 14:07:10 UTC 2009] Pistos <gitsomegrace.5.pistos@geoshell.com>
119
+
120
+ * In render helper: render_template -> render_file . Changed relevant specs, too.
121
+
122
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
123
+
124
+ [f3491f7 | Thu Apr 30 04:59:16 UTC 2009] Tadahiko Uehara <kikofx@gmail.com>
125
+
126
+ * Skip template/view/layout lookup if the given path doesn't exist.
127
+
128
+
129
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
130
+
131
+ [e4b5388 | Fri May 01 08:30:31 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
132
+
133
+ * We don't want to call Innate::setup_dependencies for rendering...
134
+
135
+ [7c90ec0 | Fri May 01 07:22:29 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
136
+
137
+ * Default layout mapping to '/'
138
+
139
+ [64517b3 | Fri May 01 07:20:24 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
140
+
141
+ * Add some example invocations to the Helper::Render methods
142
+
143
+ [d531f58 | Fri May 01 07:19:39 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
144
+
145
+ * Adding Helper::Render#render_template due to popular demand
146
+
147
+ [59229dc | Fri May 01 06:18:39 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
148
+
149
+ * Speed up and simplify Etanni a little bit more
150
+
151
+ [d8c3ca5 | Thu Apr 30 09:07:12 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
152
+
153
+ * Add option to switch caching of compiled templates
154
+
155
+ [21c4dfd | Thu Apr 30 08:19:24 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
156
+
157
+ * Make Etanni a little bit more compact
158
+
159
+ [43f6d76 | Thu Apr 30 08:19:07 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
160
+
161
+ * First cut of template compilation, it's dumb, but it should speed things up a little
162
+
163
+ [cca6d4d | Wed Apr 29 14:34:45 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
164
+
165
+ * Improve the ColorFormatter, output background as well
166
+
167
+ [abda94c | Wed Apr 29 11:04:43 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
168
+
169
+ * Only add :trigger to options if there is one
170
+
171
+ [559e711 | Wed Apr 29 07:51:58 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
172
+
173
+ * Spec cookie setting before redirect. Closes #1
174
+
175
+ [9c85a49 | Tue Apr 28 13:05:33 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
176
+
177
+ * Make the template lookup work without globs, hopefully that works on GAE now
178
+
179
+ [a0b1f4a | Tue Apr 28 12:41:40 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
180
+
181
+ * Make helper lookup work without glob
182
+
183
+ [49ed57b | Tue Apr 28 12:41:28 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
184
+
185
+ * Tell people that routing static files doesn't work
186
+
187
+ [ff310ab | Thu Apr 23 15:30:05 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
188
+
189
+ * Avoid issues with symbol comparision on 1.8
190
+
191
+ [fce62b9 | Sun Apr 26 16:30:44 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
192
+
193
+ * Support setting multiple AOP hooks at once in before/after/wrap
194
+
195
+ [ffd8edd | Sat Apr 25 14:59:47 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
196
+
197
+ * Give innate a rubyforge project
198
+
199
+ [cf62a9c | Sat Apr 25 14:59:20 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
200
+
201
+ * Version 2009.04
202
+
203
+ [0ec2012 | Thu Apr 23 06:21:17 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
204
+
205
+ * Allow deletion of mapped apps in DynaMap
206
+
207
+ [cbedd9c | Thu Apr 23 05:04:04 UTC 2009] Ryan Grove <ryan@wonko.com>
208
+
209
+ * Add path and full_path to Innate::Action
210
+
211
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
212
+
213
+ [b9a0d4b | Mon Apr 20 05:12:29 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
214
+
215
+ * Make the u and h aliases for the CGI helper module_functions too
216
+
217
+ [b68aad4 | Mon Apr 20 05:12:10 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
218
+
219
+ * Allow further modification of the Action in the render_* methods via block
220
+
221
+ [dca3531 | Sun Apr 19 23:38:06 UTC 2009] Ryan Grove <ryan@wonko.com>
222
+
223
+ * Preserve response headers when redirecting. Closes #1
224
+
225
+ Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
226
+
227
+ [d465ca3 | Sat Apr 18 02:46:09 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
228
+
229
+ * Version 2009.04.18
230
+
1
231
  [987c5d7 | Sat Apr 18 02:44:26 UTC 2009] Michael Fellinger <m.fellinger@gmail.com>
2
232
 
3
233
  * Update the release tasks
data/MANIFEST CHANGED
@@ -57,8 +57,6 @@ lib/innate/session/flash.rb
57
57
  lib/innate/spec.rb
58
58
  lib/innate/state.rb
59
59
  lib/innate/state/accessor.rb
60
- lib/innate/state/fiber.rb
61
- lib/innate/state/thread.rb
62
60
  lib/innate/traited.rb
63
61
  lib/innate/trinity.rb
64
62
  lib/innate/version.rb
@@ -111,9 +109,8 @@ spec/innate/provides/list.txt.xhtml
111
109
  spec/innate/request.rb
112
110
  spec/innate/route.rb
113
111
  spec/innate/session.rb
114
- spec/innate/state/fiber.rb
115
- spec/innate/state/thread.rb
116
112
  spec/innate/traited.rb
113
+ tasks/authors.rake
117
114
  tasks/bacon.rake
118
115
  tasks/changelog.rake
119
116
  tasks/gem.rake
@@ -125,3 +122,4 @@ tasks/rcov.rake
125
122
  tasks/release.rake
126
123
  tasks/reversion.rake
127
124
  tasks/setup.rake
125
+ tasks/ycov.rake
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ require 'date'
7
7
  PROJECT_SPECS = FileList['spec/{innate,example}/**/*.rb'].exclude('common.rb')
8
8
  PROJECT_MODULE = 'Innate'
9
9
  PROJECT_README = 'README.md'
10
+ PROJECT_VERSION = ENV['VERSION'] || Date.today.strftime('%Y.%m.%d')
10
11
 
11
12
  GEMSPEC = Gem::Specification.new{|s|
12
13
  s.name = 'innate'
@@ -16,12 +17,15 @@ GEMSPEC = Gem::Specification.new{|s|
16
17
  s.email = 'm.fellinger@gmail.com'
17
18
  s.homepage = 'http://github.com/manveru/innate'
18
19
  s.platform = Gem::Platform::RUBY
19
- s.version = (ENV['PROJECT_VERSION'] || Date.today.strftime("%Y.%m.%d"))
20
+ s.version = PROJECT_VERSION
20
21
  s.files = `git ls-files`.split("\n").sort
21
22
  s.has_rdoc = true
22
23
  s.require_path = 'lib'
24
+ s.rubyforge_project = "innate"
23
25
 
24
- # s.add_runtime_dependency('rack', '>= 0.9.1') # lies!
26
+ s.add_dependency('rack', '~> 1.0.0')
27
+
28
+ # rip those out if they cause you trouble
25
29
  # s.add_development_dependency('bacon', '>= 1.0')
26
30
  # s.add_development_dependency('json', '~> 1.1.3')
27
31
  # s.add_development_dependency('rack-test', '>= 0.1.0')
@@ -35,7 +35,7 @@ class Wiki
35
35
  private
36
36
 
37
37
  def sync
38
- Innate::STATE.sync{ DB.transaction{ yield }}
38
+ Innate.sync{ DB.transaction{ yield }}
39
39
  end
40
40
  end
41
41
 
data/innate.gemspec CHANGED
@@ -2,17 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{innate}
5
- s.version = "2009.04.18"
5
+ s.version = "2009.05"
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-18}
9
+ s.date = %q{2009-05-07}
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.xhtml", "example/app/todo/spec/todo.rb", "example/app/todo/start.rb", "example/app/todo/view/index.xhtml", "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/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/app/retro_games.rb", "spec/example/hello.rb", "spec/example/link.rb", "spec/example/provides.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", "tasks/setup.rake"]
12
+ s.files = ["CHANGELOG", "COPYING", "MANIFEST", "README.md", "Rakefile", "example/app/retro_games.rb", "example/app/todo/layout/default.xhtml", "example/app/todo/spec/todo.rb", "example/app/todo/start.rb", "example/app/todo/view/index.xhtml", "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/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/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/app/retro_games.rb", "spec/example/hello.rb", "spec/example/link.rb", "spec/example/provides.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/traited.rb", "tasks/authors.rake", "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", "tasks/setup.rake", "tasks/ycov.rake"]
13
13
  s.has_rdoc = true
14
14
  s.homepage = %q{http://github.com/manveru/innate}
15
15
  s.require_paths = ["lib"]
16
+ s.rubyforge_project = %q{innate}
16
17
  s.rubygems_version = %q{1.3.2}
17
18
  s.summary = %q{Powerful web-framework wrapper for Rack.}
18
19
 
@@ -21,8 +22,11 @@ Gem::Specification.new do |s|
21
22
  s.specification_version = 3
22
23
 
23
24
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<rack>, ["~> 1.0.0"])
24
26
  else
27
+ s.add_dependency(%q<rack>, ["~> 1.0.0"])
25
28
  end
26
29
  else
30
+ s.add_dependency(%q<rack>, ["~> 1.0.0"])
27
31
  end
28
32
  end
data/lib/innate.rb CHANGED
@@ -13,14 +13,15 @@ module Innate
13
13
  end
14
14
 
15
15
  # stdlib
16
- require 'pp'
17
- require 'set'
18
- require 'pathname'
19
16
  require 'digest/sha1'
20
17
  require 'digest/sha2'
18
+ require 'find'
21
19
  require 'ipaddr'
22
- require 'socket'
23
20
  require 'logger'
21
+ require 'pathname'
22
+ require 'pp'
23
+ require 'set'
24
+ require 'socket'
24
25
  require 'uri'
25
26
 
26
27
  # 3rd party
data/lib/innate/action.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Innate
2
2
  ACTION_MEMBERS = [ :node, :instance, :method, :params, :method_value, :view,
3
- :view_value, :layout, :wish, :options, :variables, :engine ]
3
+ :view_value, :layout, :wish, :options, :variables, :engine, :path ]
4
4
 
5
5
  class Action < Struct.new(*ACTION_MEMBERS)
6
6
  # Create a new Action instance.
@@ -64,31 +64,16 @@ module Innate
64
64
  from_action
65
65
  end
66
66
 
67
- COPY_VARIABLES = '
68
- STATE[:action_variables].each do |iv, value|
69
- instance_variable_set("@#{iv}", value)
70
- end'.strip.freeze
71
-
72
- # Copy Action#variables as instance variables into the given binding.
73
- #
74
- # This relies on Innate::STATE, so should be thread-safe and doesn't depend
75
- # on Innate::Current::actions order.
76
- # So we avoid nasty business with Objectspace#_id2ref which may not work on
77
- # all ruby implementations and seems to cause other problems as well.
67
+ # Copy Action#variables as instance variables into the given object.
68
+ # Defaults to copying the variables to self.
78
69
  #
79
- # @param [Binding #eval] binding
70
+ # @param [Object #instance_variable_set] object
80
71
  # @return [NilClass] there is no indication of failure or success
81
- # @see View::ERB::render
72
+ # @see Action#render
82
73
  # @author manveru
83
- def copy_variables(binding = self.binding)
84
- return unless variables.any?
85
-
86
- STATE.sync do
87
- STATE[:action_variables] = self.variables
88
-
89
- eval(COPY_VARIABLES, binding)
90
-
91
- STATE[:action_variables] = nil
74
+ def copy_variables(object)
75
+ self.variables.each do |iv, value|
76
+ object.instance_variable_set("@#{iv}", value)
92
77
  end
93
78
  end
94
79
 
@@ -97,9 +82,9 @@ module Innate
97
82
  self.variables[:content] ||= nil
98
83
 
99
84
  instance.wrap_action_call(self) do
100
- copy_variables # this might need another position after all
85
+ copy_variables(self.instance) # this might need another position
101
86
  self.method_value = instance.__send__(method, *params) if method
102
- self.view_value = ::File.read(view) if view
87
+ self.view_value = View.read(view) if view
103
88
 
104
89
  body, content_type = wrap_in_layout{
105
90
  engine.call(self, view_value || method_value || '') }
@@ -113,6 +98,7 @@ module Innate
113
98
 
114
99
  action = dup
115
100
  action.view, action.method = layout_view_or_method(*layout)
101
+ action.params = []
116
102
  action.layout = nil
117
103
  action.view_value = nil
118
104
  action.sync_variables(self)
@@ -137,6 +123,12 @@ module Innate
137
123
  File.basename((method || view).to_s).split('.').first
138
124
  end
139
125
 
126
+ # Path to this action, including params, with the mapping of the current
127
+ # controller prepended.
128
+ def full_path
129
+ File.join(node.mapping, path)
130
+ end
131
+
140
132
  def valid?
141
133
  node.needs_method? ? (method && view) : (method || view)
142
134
  end
data/lib/innate/cache.rb CHANGED
@@ -65,7 +65,7 @@ module Innate
65
65
 
66
66
  options.dsl do
67
67
  o "Assign a cache to each of these names on Innate::Cache::setup",
68
- :names, [:session]
68
+ :names, [:session, :view]
69
69
 
70
70
  default "If no option for the cache name exists, fall back to this",
71
71
  Innate::Cache::Memory
@@ -9,8 +9,7 @@ module Innate
9
9
  # example below is using a normal Hash, but it is recommended to use a
10
10
  # thread-safe alternative like SyncHash.
11
11
  #
12
- # Example for DRb server:
13
- #
12
+ # @usage example for DRb server
14
13
  # require 'drb'
15
14
  #
16
15
  # URI = "druby://127.0.0.1:9069"
@@ -21,12 +20,13 @@ module Innate
21
20
  # DRb.start_service(URI, CACHE)
22
21
  # DRb.thread.join
23
22
  #
24
- # Usage for all caches:
23
+ # Please note that on some Ruby implementations, access to Hash is not
24
+ # atomic and you might need to lock around access to avoid race conditions.
25
25
  #
26
+ # @usage for all caches
26
27
  # Innate.options.cache.default = Innate::Cache::DRb
27
28
  #
28
- # Usage for sessions only:
29
- #
29
+ # @usage for sessions only
30
30
  # Innate.options.cache.session = Innate::Cache::DRb
31
31
  class DRb
32
32
  include Cache::API