innate 2009.07 → 2009.10
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.
- data/AUTHORS +5 -1
- data/CHANGELOG +100 -0
- data/MANIFEST +4 -0
- data/Rakefile +7 -2
- data/innate.gemspec +10 -10
- data/lib/innate.rb +13 -11
- data/lib/innate/action.rb +21 -18
- data/lib/innate/adapter.rb +6 -1
- data/lib/innate/cache/api.rb +1 -1
- data/lib/innate/cache/drb.rb +1 -1
- data/lib/innate/helper/aspect.rb +1 -0
- data/lib/innate/helper/link.rb +5 -3
- data/lib/innate/helper/redirect.rb +1 -1
- data/lib/innate/middleware_compiler.rb +6 -5
- data/lib/innate/node.rb +11 -10
- data/lib/innate/options.rb +1 -1
- data/lib/innate/options/dsl.rb +3 -1
- data/lib/innate/request.rb +1 -1
- data/lib/innate/route.rb +1 -1
- data/lib/innate/session.rb +2 -2
- data/lib/innate/spec/bacon.rb +1 -1
- data/lib/innate/state.rb +3 -2
- data/lib/innate/version.rb +1 -1
- data/lib/innate/view.rb +3 -3
- data/lib/innate/view/erb.rb +1 -1
- data/lib/innate/view/etanni.rb +1 -1
- data/spec/innate/dynamap.rb +1 -1
- data/spec/innate/helper.rb +1 -1
- data/spec/innate/helper/aspect.rb +24 -0
- data/spec/innate/node/node.rb +82 -7
- data/spec/innate/node/view/cat2/cat22.xhtml +1 -0
- data/spec/innate/node/view/cat3/cat33.xhtml +1 -0
- data/spec/innate/node/view/sub/baz.xhtml +1 -0
- data/spec/innate/node/view/sub/foo/baz.xhtml +1 -0
- data/spec/innate/options.rb +12 -3
- data/spec/innate/parameter.rb +0 -9
- data/tasks/release.rake +36 -24
- metadata +13 -9
data/AUTHORS
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
Following persons have contributed to innate.
|
|
2
2
|
(Sorted by number of submitted patches, then alphabetically)
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
739 Michael Fellinger <m.fellinger@gmail.com>
|
|
5
5
|
31 Tadahiko Uehara <kikofx@gmail.com>
|
|
6
6
|
8 Pistos <gitsomegrace.5.pistos@geoshell.com>
|
|
7
7
|
5 Ryan Grove <ryan@wonko.com>
|
|
8
8
|
2 Andreas Karlsson <andreas@proxel.se>
|
|
9
|
+
2 Antti Tuomi <antti.tuomi@tkk.fi>
|
|
9
10
|
2 TJ Vanderpoel <bougy.man@gmail.com>
|
|
11
|
+
1 Arnaud Meuret <arnaud@meuret.name>
|
|
12
|
+
1 Jérémy Zurcher <jeremy@asynk.ch>
|
|
13
|
+
1 ravage <ravage@fragmentized.net>
|
|
10
14
|
1 Sam Carr <samcarr@gmail.com>
|
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,103 @@
|
|
|
1
|
+
[1b0702f | 2009-10-02 13:24:16 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
2
|
+
|
|
3
|
+
* Version 2009.10
|
|
4
|
+
|
|
5
|
+
[88451a1 | 2009-10-02 13:23:53 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
6
|
+
|
|
7
|
+
* Improve the release tasks, add one for gemcutter
|
|
8
|
+
|
|
9
|
+
[c37df32 | 2009-10-01 11:16:02 UTC] Arnaud Meuret <arnaud@meuret.name>
|
|
10
|
+
|
|
11
|
+
* Fix: specifying a layout from a method and a filter block was broken
|
|
12
|
+
|
|
13
|
+
[18668be | 2009-09-29 14:13:13 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
14
|
+
|
|
15
|
+
* Update dependencies
|
|
16
|
+
|
|
17
|
+
[672bbaa | 2009-09-22 15:15:44 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
18
|
+
|
|
19
|
+
* Use Rack::Utils::build_query, this changes query separator from ; to &
|
|
20
|
+
|
|
21
|
+
[0d4d2d1 | 2009-09-22 15:04:05 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
22
|
+
|
|
23
|
+
* Improve code readability a bit
|
|
24
|
+
|
|
25
|
+
[44d02ed | 2009-09-21 17:02:09 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
26
|
+
|
|
27
|
+
* Use Mutex instead of Thread::critical
|
|
28
|
+
|
|
29
|
+
[1b80af6 | 2009-09-21 17:00:42 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
30
|
+
|
|
31
|
+
* Fix ruby/jruby dependency mixup
|
|
32
|
+
|
|
33
|
+
[783f554 | 2009-09-21 16:32:07 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
34
|
+
|
|
35
|
+
* Fix startup issue regarding jruby-rack
|
|
36
|
+
|
|
37
|
+
[a908b32 | 2009-09-15 07:15:48 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
38
|
+
|
|
39
|
+
* Fix typo
|
|
40
|
+
|
|
41
|
+
[79df3a5 | 2009-08-27 08:21:05 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
42
|
+
|
|
43
|
+
* Don't call aspects in layout
|
|
44
|
+
|
|
45
|
+
[b69e9dd | 2009-08-27 03:55:08 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
46
|
+
|
|
47
|
+
* Fix Options#pretty_print spec
|
|
48
|
+
|
|
49
|
+
[6b8c32d | 2009-08-27 03:36:53 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
50
|
+
|
|
51
|
+
* dev dependencies for jruby
|
|
52
|
+
|
|
53
|
+
[0bb6ea5 | 2009-08-26 16:59:01 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
54
|
+
|
|
55
|
+
* Forgot to require digest/md5
|
|
56
|
+
|
|
57
|
+
[2bc0566 | 2009-08-19 08:27:37 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
58
|
+
|
|
59
|
+
* Cache is not a module
|
|
60
|
+
|
|
61
|
+
[c74c2b8 | 2009-08-17 05:37:02 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
62
|
+
|
|
63
|
+
* fix doc typo
|
|
64
|
+
|
|
65
|
+
[9650f8c | 2009-07-28 06:49:20 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
66
|
+
|
|
67
|
+
* Some more specs for double underscore
|
|
68
|
+
|
|
69
|
+
[822560a | 2009-07-28 06:43:32 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
70
|
+
|
|
71
|
+
* Expand specs for double underscore
|
|
72
|
+
|
|
73
|
+
[b865335 | 2009-05-21 13:27:38 UTC] Antti Tuomi <antti.tuomi@tkk.fi>
|
|
74
|
+
|
|
75
|
+
* Aspect spec uses inline layout instead a file-based.
|
|
76
|
+
|
|
77
|
+
Also prefixed DerivedWithLayout with the helper name.
|
|
78
|
+
|
|
79
|
+
Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
|
|
80
|
+
|
|
81
|
+
[62d8853 | 2009-05-21 13:16:57 UTC] Antti Tuomi <antti.tuomi@tkk.fi>
|
|
82
|
+
|
|
83
|
+
* Aspect spec checks the functionality when using layouts.
|
|
84
|
+
|
|
85
|
+
This spec fails at the moment.
|
|
86
|
+
|
|
87
|
+
Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
|
|
88
|
+
|
|
89
|
+
[e4735cb | 2009-05-27 14:57:48 UTC] ravage <ravage@fragmentized.net>
|
|
90
|
+
|
|
91
|
+
* Resolve fake depth
|
|
92
|
+
|
|
93
|
+
Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
|
|
94
|
+
|
|
95
|
+
[10d7ef3 | 2009-07-21 16:11:57 UTC] Jérémy Zurcher <jeremy@asynk.ch>
|
|
96
|
+
|
|
97
|
+
* fix default option handling overriding in options/dsl
|
|
98
|
+
|
|
99
|
+
Signed-off-by: Michael Fellinger <m.fellinger@gmail.com>
|
|
100
|
+
|
|
1
101
|
[03274f3 | 2009-07-19 03:02:21 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
|
2
102
|
|
|
3
103
|
* Version 2009.07
|
data/MANIFEST
CHANGED
|
@@ -100,8 +100,12 @@ spec/innate/node/node.rb
|
|
|
100
100
|
spec/innate/node/resolve.rb
|
|
101
101
|
spec/innate/node/view/another_layout/another_layout.xhtml
|
|
102
102
|
spec/innate/node/view/bar.xhtml
|
|
103
|
+
spec/innate/node/view/cat2/cat22.xhtml
|
|
104
|
+
spec/innate/node/view/cat3/cat33.xhtml
|
|
103
105
|
spec/innate/node/view/foo.html.xhtml
|
|
104
106
|
spec/innate/node/view/only_view.xhtml
|
|
107
|
+
spec/innate/node/view/sub/baz.xhtml
|
|
108
|
+
spec/innate/node/view/sub/foo/baz.xhtml
|
|
105
109
|
spec/innate/node/view/with_layout.xhtml
|
|
106
110
|
spec/innate/node/wrap_action_call.rb
|
|
107
111
|
spec/innate/options.rb
|
data/Rakefile
CHANGED
|
@@ -15,10 +15,15 @@ DEPENDENCIES = {
|
|
|
15
15
|
|
|
16
16
|
DEVELOPMENT_DEPENDENCIES = {
|
|
17
17
|
'bacon' => {:version => '>= 1.1.0'},
|
|
18
|
-
'
|
|
19
|
-
'rack-test' => {:version => '>= 0.4.0', :lib => 'rack/test'}
|
|
18
|
+
'rack-test' => {:version => '>= 0.5.0', :lib => 'rack/test'}
|
|
20
19
|
}
|
|
21
20
|
|
|
21
|
+
if defined?(RUBY_PLATFORM) && RUBY_PLATFORM =~ /jruby/
|
|
22
|
+
DEVELOPMENT_DEPENDENCIES['json-jruby'] = {:version => '~> 1.1.7'}
|
|
23
|
+
else
|
|
24
|
+
DEVELOPMENT_DEPENDENCIES['json'] = {:version => '~> 1.1.9'}
|
|
25
|
+
end
|
|
26
|
+
|
|
22
27
|
GEMSPEC = Gem::Specification.new{|s|
|
|
23
28
|
s.name = 'innate'
|
|
24
29
|
s.author = "Michael 'manveru' Fellinger"
|
data/innate.gemspec
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{innate}
|
|
5
|
-
s.version = "2009.
|
|
5
|
+
s.version = "2009.10"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.1") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Michael 'manveru' Fellinger"]
|
|
9
|
-
s.date = %q{2009-
|
|
9
|
+
s.date = %q{2009-10-02}
|
|
10
10
|
s.description = %q{Simple, straight-forward base for web-frameworks.}
|
|
11
11
|
s.email = %q{m.fellinger@gmail.com}
|
|
12
|
-
s.files = ["AUTHORS", "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/spec/bacon.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/modes.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_setup.rake", "tasks/grancher.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake", "tasks/setup.rake", "tasks/ycov.rake"]
|
|
12
|
+
s.files = ["AUTHORS", "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/spec/bacon.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/modes.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/cat2/cat22.xhtml", "spec/innate/node/view/cat3/cat33.xhtml", "spec/innate/node/view/foo.html.xhtml", "spec/innate/node/view/only_view.xhtml", "spec/innate/node/view/sub/baz.xhtml", "spec/innate/node/view/sub/foo/baz.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_setup.rake", "tasks/grancher.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake", "tasks/setup.rake", "tasks/ycov.rake"]
|
|
13
13
|
s.homepage = %q{http://github.com/manveru/innate}
|
|
14
14
|
s.require_paths = ["lib"]
|
|
15
15
|
s.rubyforge_project = %q{innate}
|
|
16
|
-
s.rubygems_version = %q{1.3.
|
|
16
|
+
s.rubygems_version = %q{1.3.5}
|
|
17
17
|
s.summary = %q{Powerful web-framework wrapper for Rack.}
|
|
18
18
|
|
|
19
19
|
if s.respond_to? :specification_version then
|
|
@@ -23,18 +23,18 @@ Gem::Specification.new do |s|
|
|
|
23
23
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
24
24
|
s.add_runtime_dependency(%q<rack>, ["~> 1.0.0"])
|
|
25
25
|
s.add_development_dependency(%q<bacon>, [">= 1.1.0"])
|
|
26
|
-
s.add_development_dependency(%q<
|
|
27
|
-
s.add_development_dependency(%q<
|
|
26
|
+
s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
|
|
27
|
+
s.add_development_dependency(%q<json>, ["~> 1.1.9"])
|
|
28
28
|
else
|
|
29
29
|
s.add_dependency(%q<rack>, ["~> 1.0.0"])
|
|
30
30
|
s.add_dependency(%q<bacon>, [">= 1.1.0"])
|
|
31
|
-
s.add_dependency(%q<
|
|
32
|
-
s.add_dependency(%q<
|
|
31
|
+
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
|
32
|
+
s.add_dependency(%q<json>, ["~> 1.1.9"])
|
|
33
33
|
end
|
|
34
34
|
else
|
|
35
35
|
s.add_dependency(%q<rack>, ["~> 1.0.0"])
|
|
36
36
|
s.add_dependency(%q<bacon>, [">= 1.1.0"])
|
|
37
|
-
s.add_dependency(%q<
|
|
38
|
-
s.add_dependency(%q<
|
|
37
|
+
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
|
38
|
+
s.add_dependency(%q<json>, ["~> 1.1.9"])
|
|
39
39
|
end
|
|
40
40
|
end
|
data/lib/innate.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Innate
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# stdlib
|
|
16
|
+
require 'digest/md5'
|
|
16
17
|
require 'digest/sha1'
|
|
17
18
|
require 'digest/sha2'
|
|
18
19
|
require 'find'
|
|
@@ -22,6 +23,7 @@ module Innate
|
|
|
22
23
|
require 'pp'
|
|
23
24
|
require 'set'
|
|
24
25
|
require 'socket'
|
|
26
|
+
require 'thread'
|
|
25
27
|
require 'uri'
|
|
26
28
|
|
|
27
29
|
# 3rd party
|
|
@@ -102,27 +104,27 @@ module Innate
|
|
|
102
104
|
# Keep state in Thread or Fiber, fall back to Thread if Fiber not available
|
|
103
105
|
# @option param :mode [Symbol] (:dev)
|
|
104
106
|
# Indicates which default middleware to use, (:dev|:live)
|
|
105
|
-
def start(
|
|
106
|
-
root =
|
|
107
|
-
|
|
107
|
+
def start(options = {}, &block)
|
|
108
|
+
root, file = options.delete(:root), options.delete(:file)
|
|
109
|
+
innate_options = Innate.options
|
|
108
110
|
|
|
109
111
|
found_root = go_figure_root(caller, :root => root, :file => file)
|
|
110
|
-
|
|
112
|
+
innate_options.roots = [*found_root] if found_root
|
|
111
113
|
|
|
112
114
|
# Convert some top-level option keys to the internal ones that we use.
|
|
113
|
-
PROXY_OPTIONS.each{|
|
|
114
|
-
|
|
115
|
+
PROXY_OPTIONS.each{|given, proxy| options[proxy] = options[given] }
|
|
116
|
+
options.delete_if{|key, value| PROXY_OPTIONS[key] || value.nil? }
|
|
115
117
|
|
|
116
118
|
# Merge the user's given options into our existing set, which contains defaults.
|
|
117
|
-
|
|
119
|
+
innate_options.merge!(options)
|
|
118
120
|
|
|
119
121
|
setup_dependencies
|
|
120
|
-
middleware!(
|
|
122
|
+
middleware!(innate_options.mode, &block) if block_given?
|
|
121
123
|
|
|
122
|
-
return if
|
|
123
|
-
|
|
124
|
+
return if innate_options.started
|
|
125
|
+
innate_options.started = true
|
|
124
126
|
|
|
125
|
-
signal =
|
|
127
|
+
signal = innate_options.trap
|
|
126
128
|
trap(signal){ stop(10) } if signal
|
|
127
129
|
|
|
128
130
|
start!
|
data/lib/innate/action.rb
CHANGED
|
@@ -55,10 +55,9 @@ module Innate
|
|
|
55
55
|
def sync_variables(from_action)
|
|
56
56
|
instance = from_action.instance
|
|
57
57
|
|
|
58
|
-
instance.instance_variables.each{|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
self.variables[iv_name.to_sym] = iv_value
|
|
58
|
+
instance.instance_variables.each{|variable|
|
|
59
|
+
name = variable.to_s[1..-1].to_sym
|
|
60
|
+
self.variables[name] = instance.instance_variable_get(variable)
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
from_action
|
|
@@ -71,18 +70,18 @@ module Innate
|
|
|
71
70
|
# @return [NilClass] there is no indication of failure or success
|
|
72
71
|
# @see Action#render
|
|
73
72
|
# @author manveru
|
|
74
|
-
def copy_variables(object)
|
|
73
|
+
def copy_variables(object = instance)
|
|
75
74
|
self.variables.each do |iv, value|
|
|
76
75
|
object.instance_variable_set("@#{iv}", value)
|
|
77
76
|
end
|
|
78
77
|
end
|
|
79
78
|
|
|
80
79
|
def render
|
|
81
|
-
self.instance = node.new
|
|
80
|
+
self.instance = instance = node.new
|
|
82
81
|
self.variables[:content] ||= nil
|
|
83
82
|
|
|
84
83
|
instance.wrap_action_call(self) do
|
|
85
|
-
copy_variables
|
|
84
|
+
copy_variables
|
|
86
85
|
self.method_value = instance.__send__(method, *params) if method
|
|
87
86
|
self.view_value = View.read(view) if view
|
|
88
87
|
|
|
@@ -94,18 +93,22 @@ module Innate
|
|
|
94
93
|
end
|
|
95
94
|
|
|
96
95
|
def wrap_in_layout
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
layout ? dup.render_in_layout(&Proc.new) : yield
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def render_in_layout
|
|
100
|
+
self.view, self.method = layout_view_or_method(*layout)
|
|
101
|
+
self.options[:is_layout] = true
|
|
102
|
+
self.params = []
|
|
103
|
+
self.layout = self.view_value = nil
|
|
104
|
+
self.sync_variables(self)
|
|
105
|
+
|
|
105
106
|
body, content_type = yield
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
|
|
108
|
+
self.sync_variables(self)
|
|
109
|
+
self.variables[:content] = body
|
|
110
|
+
|
|
111
|
+
return call, content_type
|
|
109
112
|
end
|
|
110
113
|
|
|
111
114
|
def layout_view_or_method(name, arg)
|
data/lib/innate/adapter.rb
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
Rack
|
|
1
|
+
# Rack doesn't ship with ebb handler, but it doesn't get picked up under some
|
|
2
|
+
# circumstances, so we do that here.
|
|
3
|
+
# Jruby Rack doesn't have the Handler::register method, so we have to check.
|
|
4
|
+
if Rack::Handler.respond_to?(:register)
|
|
5
|
+
Rack::Handler.register('ebb', 'Rack::Handler::Ebb')
|
|
6
|
+
end
|
|
2
7
|
|
|
3
8
|
module Innate
|
|
4
9
|
|
data/lib/innate/cache/api.rb
CHANGED
data/lib/innate/cache/drb.rb
CHANGED
data/lib/innate/helper/aspect.rb
CHANGED
|
@@ -79,6 +79,7 @@ module Innate
|
|
|
79
79
|
# @see Action#render
|
|
80
80
|
# @author manveru
|
|
81
81
|
def wrap_action_call(action, &block)
|
|
82
|
+
return yield if action.options[:is_layout]
|
|
82
83
|
wrap = SortedSet.new
|
|
83
84
|
action.node.ancestral_trait_values(:wrap).each{|sset| wrap.merge(sset) }
|
|
84
85
|
head, *tail = wrap.map{|k,v| v }
|
data/lib/innate/helper/link.rb
CHANGED
|
@@ -28,13 +28,15 @@ module Innate
|
|
|
28
28
|
hashes, names = args.partition{|arg| arg.respond_to?(:merge!) }
|
|
29
29
|
hashes.each{|to_merge| hash.merge!(to_merge) }
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
name = name.to_s.gsub(/__/, '/')
|
|
32
|
+
|
|
32
33
|
location = route_location(self)
|
|
33
|
-
front = Array[location, name, *names.map{|
|
|
34
|
+
front = Array[location, name, *names.map{|element|
|
|
35
|
+
Rack::Utils.escape(element) }].join('/').squeeze('/')
|
|
34
36
|
|
|
35
37
|
return URI(front) if hash.empty?
|
|
36
38
|
|
|
37
|
-
query =
|
|
39
|
+
query = Rack::Utils.build_query(hash)
|
|
38
40
|
URI("#{front}?#{query}")
|
|
39
41
|
end
|
|
40
42
|
alias r route
|
|
@@ -19,8 +19,8 @@ module Innate
|
|
|
19
19
|
yield(self) if block_given?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def use(
|
|
23
|
-
@middlewares << [
|
|
22
|
+
def use(middleware, *args, &block)
|
|
23
|
+
@middlewares << [middleware, args, block]
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def apps(*middlewares)
|
|
@@ -41,7 +41,7 @@ module Innate
|
|
|
41
41
|
|
|
42
42
|
joined = roots.map{|root| publics.map{|public| ::File.join(root, public)}}
|
|
43
43
|
|
|
44
|
-
apps = joined.flatten.map{|
|
|
44
|
+
apps = joined.flatten.map{|public_root| Rack::File.new(public_root) }
|
|
45
45
|
apps << Current.new(Route.new(app), Rewrite.new(app))
|
|
46
46
|
|
|
47
47
|
cascade(*apps)
|
|
@@ -57,8 +57,9 @@ module Innate
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def compile!
|
|
60
|
-
@compiled = @middlewares.reverse.
|
|
61
|
-
app
|
|
60
|
+
@compiled = @middlewares.reverse.
|
|
61
|
+
inject(@app){|app, (middleware, args, block)|
|
|
62
|
+
middleware.new(app, *args, &block) }
|
|
62
63
|
self
|
|
63
64
|
end
|
|
64
65
|
end
|
data/lib/innate/node.rb
CHANGED
|
@@ -138,7 +138,7 @@ module Innate
|
|
|
138
138
|
# @author manveru
|
|
139
139
|
def map(location)
|
|
140
140
|
trait :skip_node_map => true
|
|
141
|
-
Innate.map(location, self)
|
|
141
|
+
Innate.map(location, self)
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
# Specify which way contents are provided and processed.
|
|
@@ -226,7 +226,7 @@ module Innate
|
|
|
226
226
|
end
|
|
227
227
|
|
|
228
228
|
def provides
|
|
229
|
-
ancestral_trait.reject{|
|
|
229
|
+
ancestral_trait.reject{|key, value| key !~ /_handler$/ }
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
# This makes the Node a valid application for Rack.
|
|
@@ -339,6 +339,7 @@ module Innate
|
|
|
339
339
|
# @see Innate::Response Node#try_resolve
|
|
340
340
|
# @author manveru
|
|
341
341
|
def action_missing(path)
|
|
342
|
+
response = Current.response
|
|
342
343
|
response.status = 404
|
|
343
344
|
response['Content-Type'] = 'text/plain'
|
|
344
345
|
response.write("No action found at: %p" % path)
|
|
@@ -513,7 +514,7 @@ module Innate
|
|
|
513
514
|
# @example
|
|
514
515
|
#
|
|
515
516
|
# Hi.update_method_arities
|
|
516
|
-
# # => {'index' => 0, 'foo' => -1, 'bar => 2}
|
|
517
|
+
# # => {'index' => 0, 'foo' => -1, 'bar' => 2}
|
|
517
518
|
#
|
|
518
519
|
# @api internal
|
|
519
520
|
# @see Node#resolve
|
|
@@ -522,7 +523,7 @@ module Innate
|
|
|
522
523
|
@method_arities = {}
|
|
523
524
|
|
|
524
525
|
exposed = ancestors & Helper::EXPOSE.to_a
|
|
525
|
-
higher = ancestors.select{|
|
|
526
|
+
higher = ancestors.select{|ancestor| ancestor < Innate::Node }
|
|
526
527
|
|
|
527
528
|
(higher + exposed).reverse_each do |ancestor|
|
|
528
529
|
ancestor.public_instance_methods(false).each do |im|
|
|
@@ -661,13 +662,13 @@ module Innate
|
|
|
661
662
|
# of multitudes of obscure options and methods like deny_layout we simply
|
|
662
663
|
# take a block and use the returned value as the name for the layout. No
|
|
663
664
|
# layout will be used if the block returns nil.
|
|
664
|
-
def layout(
|
|
665
|
-
if
|
|
665
|
+
def layout(layout_name = nil, &block)
|
|
666
|
+
if layout_name and block
|
|
666
667
|
# default name, but still check with block
|
|
667
|
-
trait(:layout => lambda{|
|
|
668
|
-
elsif
|
|
668
|
+
trait(:layout => lambda{|name, wish| layout_name.to_s if block.call(name, wish) })
|
|
669
|
+
elsif layout_name
|
|
669
670
|
# name of a method or template
|
|
670
|
-
trait(:layout =>
|
|
671
|
+
trait(:layout => layout_name.to_s)
|
|
671
672
|
elsif block
|
|
672
673
|
# call block every request with name and wish, returned value is name
|
|
673
674
|
# of layout template or method
|
|
@@ -1021,7 +1022,7 @@ module Innate
|
|
|
1021
1022
|
def node_from_backtrace(backtrace)
|
|
1022
1023
|
filename, lineno = backtrace[0].split(':', 2)
|
|
1023
1024
|
regexp = /^\s*class\s+(\S+)/
|
|
1024
|
-
File.readlines(filename)[0..lineno.to_i].reverse.find{|
|
|
1025
|
+
File.readlines(filename)[0..lineno.to_i].reverse.find{|ln| ln =~ regexp }
|
|
1025
1026
|
const_get($1)
|
|
1026
1027
|
end
|
|
1027
1028
|
end
|
data/lib/innate/options.rb
CHANGED
data/lib/innate/options/dsl.rb
CHANGED
|
@@ -132,7 +132,9 @@ module Innate
|
|
|
132
132
|
#
|
|
133
133
|
# TODO: allow arbitrary assignments
|
|
134
134
|
def []=(key, value)
|
|
135
|
-
|
|
135
|
+
ks = key.to_sym
|
|
136
|
+
if @hash.has_key? ks
|
|
137
|
+
ns = @hash[ks]
|
|
136
138
|
ns[:value] = value
|
|
137
139
|
ns[:trigger].call(value) if ns[:trigger].respond_to?(:call)
|
|
138
140
|
elsif existing = get(key)
|
data/lib/innate/request.rb
CHANGED
|
@@ -124,7 +124,7 @@ module Innate
|
|
|
124
124
|
|
|
125
125
|
ipv4 = %w[ 127.0.0.1/32 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 169.254.0.0/16 ]
|
|
126
126
|
ipv6 = %w[ fc00::/7 fe80::/10 fec0::/10 ::1 ]
|
|
127
|
-
LOCAL = (ipv4 + ipv6).map{|
|
|
127
|
+
LOCAL = (ipv4 + ipv6).map{|range| IPAddr.new(range)} unless defined?(LOCAL)
|
|
128
128
|
|
|
129
129
|
# Request is from a local network?
|
|
130
130
|
# Checks both IPv4 and IPv6
|
data/lib/innate/route.rb
CHANGED
data/lib/innate/session.rb
CHANGED
|
@@ -39,8 +39,8 @@ module Innate
|
|
|
39
39
|
o "Length of generated Session ID (only applies when using SecureRandom)",
|
|
40
40
|
:sid_length, 64
|
|
41
41
|
|
|
42
|
-
trigger(:expires){|
|
|
43
|
-
self.ttl =
|
|
42
|
+
trigger(:expires){|value|
|
|
43
|
+
self.ttl = value - Time.now.to_i
|
|
44
44
|
Log.warn("Innate::Session.options.expires is deprecated, use #ttl instead")
|
|
45
45
|
}
|
|
46
46
|
end
|
data/lib/innate/spec/bacon.rb
CHANGED
data/lib/innate/state.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require 'thread'
|
|
2
2
|
|
|
3
3
|
module Innate
|
|
4
|
+
SEMAPHORE = Mutex.new
|
|
5
|
+
|
|
4
6
|
module SingletonMethods
|
|
5
7
|
# Use this method to achieve thread-safety for sensitive operations.
|
|
6
8
|
#
|
|
@@ -9,9 +11,8 @@ module Innate
|
|
|
9
11
|
# execution of this method.
|
|
10
12
|
#
|
|
11
13
|
# @param [Proc] block the things you want to execute
|
|
12
|
-
# @see State::Thread#sync State::Fiber#sync
|
|
13
14
|
def sync(&block)
|
|
14
|
-
|
|
15
|
+
SEMAPHORE.synchronize(&block)
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def defer
|
data/lib/innate/version.rb
CHANGED
data/lib/innate/view.rb
CHANGED
|
@@ -30,7 +30,7 @@ module Innate
|
|
|
30
30
|
|
|
31
31
|
def exts_of(engine)
|
|
32
32
|
name = engine.to_s
|
|
33
|
-
ENGINE.reject{|
|
|
33
|
+
ENGINE.reject{|ext, klass| klass != name }.keys
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
# Try to obtain given engine by its registered name.
|
|
@@ -49,10 +49,10 @@ module Innate
|
|
|
49
49
|
# on the first request (before TEMP is set).
|
|
50
50
|
# No mutex is used in Fiber environment, see Innate::State and subclasses.
|
|
51
51
|
def obtain(klass, root = Object)
|
|
52
|
-
|
|
52
|
+
Innate.sync do
|
|
53
53
|
klass.to_s.scan(/\w+/){|part| root = root.const_get(part) }
|
|
54
54
|
return root
|
|
55
|
-
|
|
55
|
+
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# Reads the specified view template from the filesystem. When the read_cache
|
data/lib/innate/view/erb.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Innate
|
|
|
4
4
|
module View
|
|
5
5
|
module ERB
|
|
6
6
|
def self.call(action, string)
|
|
7
|
-
erb = View.compile(string){|
|
|
7
|
+
erb = View.compile(string){|str| ::ERB.new(str, nil, '%<>') }
|
|
8
8
|
erb.filename = (action.view || action.method).to_s
|
|
9
9
|
html = erb.result(action.binding)
|
|
10
10
|
return html, 'text/html'
|
data/lib/innate/view/etanni.rb
CHANGED
|
@@ -2,7 +2,7 @@ module Innate
|
|
|
2
2
|
module View
|
|
3
3
|
module Etanni
|
|
4
4
|
def self.call(action, string)
|
|
5
|
-
etanni = View.compile(string){|
|
|
5
|
+
etanni = View.compile(string){|str| Innate::Etanni.new(str) }
|
|
6
6
|
html = etanni.result(action.binding, (action.view || action.method))
|
|
7
7
|
return html, 'text/html'
|
|
8
8
|
end
|
data/spec/innate/dynamap.rb
CHANGED
|
@@ -7,7 +7,7 @@ describe Innate::DynaMap do
|
|
|
7
7
|
lambda{ Innate::DynaMap.call({}) }.should.raise(RuntimeError)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
should 'not raise if
|
|
10
|
+
should 'not raise if something is mapped' do
|
|
11
11
|
Innate.map('/', &@app)
|
|
12
12
|
Innate::DynaMap.call('SCRIPT_NAME' => '/').should == [200, {}, ['pass']]
|
|
13
13
|
end
|
data/spec/innate/helper.rb
CHANGED
|
@@ -54,7 +54,7 @@ describe Innate::Helper::Link do
|
|
|
54
54
|
FNL.r(:index, :foo => :bar).should == URI('/foo/index?foo=bar')
|
|
55
55
|
|
|
56
56
|
uri = FNL.r(:index, :a => :b, :x => :y)
|
|
57
|
-
uri.query.split('
|
|
57
|
+
uri.query.split('&').sort.should == %w[a=b x=y]
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
should 'construct link from ::a' do
|
|
@@ -27,6 +27,16 @@ class AspectAllSpec
|
|
|
27
27
|
def with_instance_var_second; "#{@foo} to the #{@bar}"; end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
class AspectDerivedWithLayout < AspectAllSpec
|
|
31
|
+
map '/derived'
|
|
32
|
+
provide(:html, :None)
|
|
33
|
+
layout :page
|
|
34
|
+
|
|
35
|
+
def page
|
|
36
|
+
"Content: #{@content}"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
30
40
|
class AspecNoMethodSpec
|
|
31
41
|
Innate.node('/without_method', self)
|
|
32
42
|
include Innate::Node
|
|
@@ -58,9 +68,11 @@ describe Innate::Helper::Aspect do
|
|
|
58
68
|
|
|
59
69
|
it 'calls before_all and after_all' do
|
|
60
70
|
$aspect_spec_before_all = $aspect_spec_after_all = 0
|
|
71
|
+
|
|
61
72
|
get('/all/before_first').body.should == '42'
|
|
62
73
|
$aspect_spec_before_all.should == 42
|
|
63
74
|
$aspect_spec_after_all.should == 40
|
|
75
|
+
|
|
64
76
|
get('/all/before_second').body.should == '84'
|
|
65
77
|
$aspect_spec_before_all.should == 84
|
|
66
78
|
$aspect_spec_after_all.should == 80
|
|
@@ -72,4 +84,16 @@ describe Innate::Helper::Aspect do
|
|
|
72
84
|
get('/all/with_instance_var_second').body.should == 'Hello to the World'
|
|
73
85
|
get('/without_method/aspect_hello').body.should == "Hello World!"
|
|
74
86
|
end
|
|
87
|
+
|
|
88
|
+
it 'calls before_all and after_all in the superclass' do
|
|
89
|
+
$aspect_spec_before_all = $aspect_spec_after_all = 0
|
|
90
|
+
|
|
91
|
+
get('/derived/before_first').body.should == 'Content: 42'
|
|
92
|
+
$aspect_spec_before_all.should == 42
|
|
93
|
+
$aspect_spec_after_all.should == 40
|
|
94
|
+
|
|
95
|
+
get('/derived/before_second').body.should == 'Content: 84'
|
|
96
|
+
$aspect_spec_before_all.should == 84
|
|
97
|
+
$aspect_spec_after_all.should == 80
|
|
98
|
+
end
|
|
75
99
|
end
|
data/spec/innate/node/node.rb
CHANGED
|
@@ -11,6 +11,18 @@ class SpecNode
|
|
|
11
11
|
def two(arg1, arg2) end
|
|
12
12
|
def more(*args) end
|
|
13
13
|
def default(arg = nil) end
|
|
14
|
+
|
|
15
|
+
def cat1__cat11
|
|
16
|
+
'cat1: cat11'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def cat1__cat11__cat111
|
|
20
|
+
'cat1: cat11: cat111'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def cat3_cat33
|
|
24
|
+
'The wrong 33rd cat.'
|
|
25
|
+
end
|
|
14
26
|
end
|
|
15
27
|
|
|
16
28
|
class SpecNodeProvide
|
|
@@ -61,6 +73,25 @@ class SpecNodeWithLayoutMethod < SpecNodeProvide
|
|
|
61
73
|
end
|
|
62
74
|
end
|
|
63
75
|
|
|
76
|
+
class SpecNodeWithLayoutMethodSymbol < SpecNodeProvide
|
|
77
|
+
map '/layout_method_symbol'
|
|
78
|
+
layout :layout_method
|
|
79
|
+
|
|
80
|
+
def layout_method
|
|
81
|
+
'<div class="content">#{@content}</div>'
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class SpecNodeWithLayoutMethodSymbolAndBlock < SpecNodeProvide
|
|
86
|
+
map '/layout_method_symbol_block'
|
|
87
|
+
layout(:layout_method) { |wish,path| true }
|
|
88
|
+
|
|
89
|
+
def layout_method
|
|
90
|
+
'<div class="content">#{@content}</div>'
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
|
|
64
95
|
class SpecNodeIndex
|
|
65
96
|
Innate.node('/spec_index')
|
|
66
97
|
|
|
@@ -80,48 +111,62 @@ describe 'Innate::Node' do
|
|
|
80
111
|
behaves_like :rack_test
|
|
81
112
|
|
|
82
113
|
should 'respond with 404 if no action was found' do
|
|
83
|
-
got =
|
|
114
|
+
got = get('/does_not_exist')
|
|
84
115
|
got.status.should == 404
|
|
85
116
|
got.body.should == 'No action found at: "/does_not_exist"'
|
|
86
117
|
got['Content-Type'].should == 'text/plain'
|
|
87
118
|
end
|
|
88
119
|
|
|
89
120
|
should 'wrap with layout' do
|
|
90
|
-
got =
|
|
121
|
+
got = get('/layout/bar')
|
|
91
122
|
got.status.should == 200
|
|
92
123
|
got.body.should == %(<div class="content">42</div>)
|
|
93
124
|
got['Content-Type'].should == 'text/html'
|
|
94
125
|
end
|
|
95
126
|
|
|
96
127
|
should 'find layout with view_root' do
|
|
97
|
-
got =
|
|
128
|
+
got = get('/another_layout/bar')
|
|
98
129
|
got.status.should == 200
|
|
99
130
|
got.body.should == %(<div class="content">\n 42\n</div>)
|
|
100
131
|
got['Content-Type'].should == 'text/html'
|
|
101
132
|
end
|
|
102
133
|
|
|
103
134
|
should 'find layout from method' do
|
|
104
|
-
got =
|
|
135
|
+
got = get('/layout_method/bar')
|
|
136
|
+
got.status.should == 200
|
|
137
|
+
got.body.should == %(<div class="content">42</div>)
|
|
138
|
+
got['Content-Type'].should == 'text/html'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
should 'find layout from method specified as a symbol' do
|
|
142
|
+
got = get('/layout_method_symbol/bar')
|
|
143
|
+
got.status.should == 200
|
|
144
|
+
got.body.should == %(<div class="content">42</div>)
|
|
145
|
+
got['Content-Type'].should == 'text/html'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
should 'find layout from method specified as a symbol and a filter block' do
|
|
149
|
+
got = get('/layout_method_symbol_block/bar')
|
|
105
150
|
got.status.should == 200
|
|
106
151
|
got.body.should == %(<div class="content">42</div>)
|
|
107
152
|
got['Content-Type'].should == 'text/html'
|
|
108
153
|
end
|
|
109
154
|
|
|
110
155
|
should 'not get an action with wrong parameters' do
|
|
111
|
-
got =
|
|
156
|
+
got = get('/spec_index/bar')
|
|
112
157
|
got.status.should == 404
|
|
113
158
|
got.body.should == 'No action found at: "/bar"'
|
|
114
159
|
end
|
|
115
160
|
|
|
116
161
|
should 'get an action view if there is no method' do
|
|
117
|
-
got =
|
|
162
|
+
got = get('/provide_template/only_view')
|
|
118
163
|
got.status.should == 200
|
|
119
164
|
got.body.strip.should == "Only template"
|
|
120
165
|
got['Content-Type'].should == 'text/html'
|
|
121
166
|
end
|
|
122
167
|
|
|
123
168
|
should 'not get an action view with params if there is no method' do
|
|
124
|
-
got =
|
|
169
|
+
got = get('/provide_template/only_view/param')
|
|
125
170
|
got.status.should == 404
|
|
126
171
|
got.body.strip.should == 'No action found at: "/only_view/param"'
|
|
127
172
|
end
|
|
@@ -132,4 +177,34 @@ describe 'Innate::Node' do
|
|
|
132
177
|
got.body.strip.should == "<h1>Hello, World!</h1>"
|
|
133
178
|
got['Content-Type'].should == 'text/html'
|
|
134
179
|
end
|
|
180
|
+
|
|
181
|
+
it "does double underscore lookup for method only" do
|
|
182
|
+
got = get('/cat1/cat11')
|
|
183
|
+
got.body.should == 'cat1: cat11'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
it "does double double underscore lookup for method only" do
|
|
187
|
+
got = get('/cat1/cat11/cat111')
|
|
188
|
+
got.body.should == 'cat1: cat11: cat111'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
it "resolves double underscore for template only" do
|
|
192
|
+
got = get('/cat2/cat22')
|
|
193
|
+
got.body.should == 'The 22nd cat.'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
it "resolves double underscore for template and method" do
|
|
197
|
+
got = get('/cat3/cat33')
|
|
198
|
+
got.body.should == 'The right 33rd cat.'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
it 'resolves normal template in subnode ' do
|
|
202
|
+
got = get('/sub/baz')
|
|
203
|
+
got.body.should == 'This is baz, cheer up!'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
it 'resolves nested template in subnode' do
|
|
207
|
+
got = get('/sub/foo/baz')
|
|
208
|
+
got.body.should == 'This is foo/baz, cheer up!'
|
|
209
|
+
end
|
|
135
210
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The 22nd cat.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The right 33rd cat.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is baz, cheer up!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is foo/baz, cheer up!
|
data/spec/innate/options.rb
CHANGED
|
@@ -104,9 +104,7 @@ describe Options do
|
|
|
104
104
|
|
|
105
105
|
should 'pretty_print' do
|
|
106
106
|
require 'pp'
|
|
107
|
-
|
|
108
|
-
@options.pretty_print(p)
|
|
109
|
-
lines = p.output.split(/\n/)
|
|
107
|
+
lines = @options.pretty_inspect.split(/\n/)
|
|
110
108
|
lines.find_all{|l|
|
|
111
109
|
/:doc/ === l &&
|
|
112
110
|
/:value/ === l
|
|
@@ -120,4 +118,15 @@ describe Options do
|
|
|
120
118
|
@options.port = 300
|
|
121
119
|
set.should == 300
|
|
122
120
|
end
|
|
121
|
+
should 'return default value' do
|
|
122
|
+
@options.default('my default', 'jeremy' )
|
|
123
|
+
@options.fake.should == 'jeremy'
|
|
124
|
+
end
|
|
125
|
+
should 'not change default value' do
|
|
126
|
+
@options.fake1.should == 'jeremy'
|
|
127
|
+
@options.fake2.should == 'jeremy'
|
|
128
|
+
@options.fake1 = 'zurcher'
|
|
129
|
+
@options.fake1.should == 'zurcher'
|
|
130
|
+
@options.fake2.should == 'jeremy'
|
|
131
|
+
end
|
|
123
132
|
end
|
data/spec/innate/parameter.rb
CHANGED
|
@@ -115,15 +115,6 @@ describe "Simple Parameters" do
|
|
|
115
115
|
handle('/one_default/my_default').should == "one_default (my_default)"
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
-
it "double underscore lookup" do
|
|
119
|
-
handle('/cat1/cat11').should == 'cat1: cat11'
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it "double double underscore lookup" do
|
|
123
|
-
handle('/cat1/cat11/cat111').should == 'cat1: cat11: cat111'
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
|
|
127
118
|
it "jo/add should raise with 0 parameters" do
|
|
128
119
|
lambda{ handle('/jo/add') }.
|
|
129
120
|
should.raise(ArgumentError)
|
data/tasks/release.rake
CHANGED
|
@@ -1,53 +1,65 @@
|
|
|
1
1
|
namespace :release do
|
|
2
|
-
task :
|
|
2
|
+
task :prepare => [:reversion, :authors, :gemspec]
|
|
3
|
+
task :all => ['release:github', 'release:rubyforge', 'release:gemcutter']
|
|
3
4
|
|
|
4
|
-
desc '
|
|
5
|
-
task :github =>
|
|
5
|
+
desc 'Release on github'
|
|
6
|
+
task :github => :prepare do
|
|
6
7
|
name, version = GEMSPEC.name, GEMSPEC.version
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
sh('git', 'add',
|
|
10
|
+
'MANIFEST', 'CHANGELOG', 'AUTHORS',
|
|
11
|
+
"#{name}.gemspec",
|
|
12
|
+
"lib/#{name}/version.rb")
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
puts <<-INSTRUCTIONS
|
|
15
|
+
================================================================================
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
I added the relevant files, you can commit them, tag the commit, and push:
|
|
14
18
|
|
|
15
19
|
git commit -m 'Version #{version}'
|
|
16
20
|
git tag -a -m '#{version}' '#{version}'
|
|
17
21
|
git push
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
================================================================================
|
|
24
|
+
INSTRUCTIONS
|
|
21
25
|
end
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
task :rubyforge => [:reversion, :authors, :gemspec, :package] do
|
|
27
|
+
desc 'Release on rubyforge'
|
|
28
|
+
task :rubyforge => ['release:prepare', :package] do
|
|
26
29
|
name, version = GEMSPEC.name, GEMSPEC.version
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
pkgs = Dir["pkg/#{name}-#{version}.{tgz,zip}"].map{|file|
|
|
32
|
+
"rubyforge add_file #{name} #{name} '#{version}' '#{file}'"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
puts <<-INSTRUCTIONS
|
|
36
|
+
================================================================================
|
|
37
|
+
|
|
29
38
|
To publish to rubyforge do following:
|
|
30
39
|
|
|
31
40
|
rubyforge login
|
|
32
41
|
rubyforge add_release #{name} #{name} '#{version}' pkg/#{name}-#{version}.gem
|
|
33
42
|
|
|
43
|
+
To publish the archives for distro packagers:
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
#{pkgs.join "\n"}
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
INSTRUCTIONS
|
|
47
|
+
================================================================================
|
|
48
|
+
INSTRUCTIONS
|
|
40
49
|
end
|
|
41
50
|
|
|
42
|
-
desc '
|
|
43
|
-
task :
|
|
44
|
-
puts "Adding archives for distro packagers is:", ""
|
|
51
|
+
desc 'Release on gemcutter'
|
|
52
|
+
task :gemcutter => ['release:prepare', :package] do
|
|
45
53
|
name, version = GEMSPEC.name, GEMSPEC.version
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
puts <<-INSTRUCTIONS
|
|
56
|
+
================================================================================
|
|
57
|
+
|
|
58
|
+
To publish to gemcutter do following:
|
|
59
|
+
|
|
60
|
+
gem push pkg/#{name}-#{version}.gem
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
================================================================================
|
|
63
|
+
INSTRUCTIONS
|
|
52
64
|
end
|
|
53
65
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: innate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: "2009.
|
|
4
|
+
version: "2009.10"
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael 'manveru' Fellinger
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-10-02 00:00:00 +09:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -33,24 +33,24 @@ dependencies:
|
|
|
33
33
|
version: 1.1.0
|
|
34
34
|
version:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
|
-
name:
|
|
36
|
+
name: rack-test
|
|
37
37
|
type: :development
|
|
38
38
|
version_requirement:
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
|
41
|
-
- -
|
|
41
|
+
- - ">="
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
43
|
+
version: 0.5.0
|
|
44
44
|
version:
|
|
45
45
|
- !ruby/object:Gem::Dependency
|
|
46
|
-
name:
|
|
46
|
+
name: json
|
|
47
47
|
type: :development
|
|
48
48
|
version_requirement:
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
|
-
- -
|
|
51
|
+
- - ~>
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
53
|
+
version: 1.1.9
|
|
54
54
|
version:
|
|
55
55
|
description: Simple, straight-forward base for web-frameworks.
|
|
56
56
|
email: m.fellinger@gmail.com
|
|
@@ -163,8 +163,12 @@ files:
|
|
|
163
163
|
- spec/innate/node/resolve.rb
|
|
164
164
|
- spec/innate/node/view/another_layout/another_layout.xhtml
|
|
165
165
|
- spec/innate/node/view/bar.xhtml
|
|
166
|
+
- spec/innate/node/view/cat2/cat22.xhtml
|
|
167
|
+
- spec/innate/node/view/cat3/cat33.xhtml
|
|
166
168
|
- spec/innate/node/view/foo.html.xhtml
|
|
167
169
|
- spec/innate/node/view/only_view.xhtml
|
|
170
|
+
- spec/innate/node/view/sub/baz.xhtml
|
|
171
|
+
- spec/innate/node/view/sub/foo/baz.xhtml
|
|
168
172
|
- spec/innate/node/view/with_layout.xhtml
|
|
169
173
|
- spec/innate/node/wrap_action_call.rb
|
|
170
174
|
- spec/innate/options.rb
|
|
@@ -212,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
212
216
|
requirements: []
|
|
213
217
|
|
|
214
218
|
rubyforge_project: innate
|
|
215
|
-
rubygems_version: 1.3.
|
|
219
|
+
rubygems_version: 1.3.5
|
|
216
220
|
signing_key:
|
|
217
221
|
specification_version: 3
|
|
218
222
|
summary: Powerful web-framework wrapper for Rack.
|