manveru-ramaze 2009.04.22 → 2009.05
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +199 -0
- data/MANIFEST +16 -7
- data/{README.markdown → README.md} +0 -14
- data/Rakefile +20 -20
- data/benchmark/bench_templates/bench.rb +67 -0
- data/benchmark/bench_templates/view/large.erb +79 -0
- data/benchmark/bench_templates/view/large.haml +41 -0
- data/benchmark/bench_templates/view/large.xhtml +79 -0
- data/benchmark/bench_templates/view/small.erb +21 -0
- data/benchmark/bench_templates/view/small.haml +12 -0
- data/benchmark/bench_templates/view/small.xhtml +21 -0
- data/benchmark/run.rb +14 -21
- data/benchmark/suite/minimal.rb +3 -5
- data/benchmark/suite/no_informer.rb +0 -2
- data/benchmark/suite/no_sessions.rb +3 -4
- data/benchmark/suite/no_template.rb +1 -3
- data/benchmark/suite/simple.rb +1 -3
- data/benchmark/suite/template_erubis.rb +0 -2
- data/benchmark/suite/template_etanni.rb +8 -0
- data/benchmark/suite/template_ezamar.rb +1 -3
- data/benchmark/suite/template_haml.rb +0 -2
- data/benchmark/suite/template_liquid.rb +0 -2
- data/benchmark/suite/template_markaby.rb +0 -2
- data/benchmark/suite/template_nagoro.rb +1 -3
- data/benchmark/suite/template_redcloth.rb +0 -2
- data/benchmark/suite/template_tenjin.rb +0 -2
- data/bin/ramaze +9 -248
- data/doc/AUTHORS +11 -7
- data/examples/app/chat/layout/{default.nag → default.xhtml} +0 -0
- data/examples/app/chat/view/{chat.nag → chat.xhtml} +0 -0
- data/examples/app/chat/view/{index.nag → index.xhtml} +0 -0
- data/examples/helpers/cache.rb +6 -4
- data/lib/proto/config.ru +1 -1
- data/lib/ramaze.rb +2 -3
- data/lib/ramaze/cache/sequel.rb +17 -5
- data/lib/ramaze/gestalt.rb +3 -0
- data/lib/ramaze/helper/cache.rb +19 -9
- data/lib/ramaze/helper/gestalt.rb +32 -0
- data/lib/ramaze/helper/paginate.rb +1 -0
- data/lib/ramaze/helper/ultraviolet.rb +2 -0
- data/lib/ramaze/log/rotatinginformer.rb +10 -10
- data/lib/ramaze/request.rb +1 -4
- data/lib/ramaze/tool/bin.rb +330 -0
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view.rb +3 -13
- data/lib/ramaze/view/erubis.rb +2 -2
- data/lib/ramaze/view/ezamar.rb +2 -2
- data/lib/ramaze/view/gestalt.rb +14 -0
- data/lib/ramaze/view/haml.rb +1 -1
- data/lib/ramaze/view/liquid.rb +2 -2
- data/lib/ramaze/view/maruku.rb +2 -1
- data/lib/ramaze/view/sass.rb +1 -1
- data/lib/ramaze/view/tenjin.rb +7 -4
- data/lib/vendor/route_exceptions.rb +8 -9
- data/ramaze.gemspec +6 -3
- data/spec/examples/caching.rb +2 -4
- data/spec/examples/element.rb +1 -0
- data/spec/examples/templates/template_ezamar.rb +1 -0
- data/spec/examples/templates/template_nagoro.rb +1 -0
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/gestalt.rb +22 -16
- data/spec/ramaze/helper/cache.rb +29 -1
- data/spec/ramaze/helper/localize.rb +10 -8
- data/spec/ramaze/helper/sequel_form.rb +2 -0
- data/spec/ramaze/helper/user.rb +2 -2
- data/spec/ramaze/view/gestalt.rb +94 -0
- data/spec/ramaze/view/gestalt/external.ges +8 -0
- data/tasks/install_dependencies.rake +1 -1
- data/tasks/release.rake +5 -4
- data/tasks/setup.rake +3 -23
- metadata +29 -11
- data/benchmark/suite/template_builder.rb +0 -12
- data/examples/helpers/provide.rb +0 -23
- data/lib/ramaze/snippets/kernel/constant.rb +0 -41
@@ -0,0 +1,94 @@
|
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
spec_require 'ramaze/gestalt'
|
6
|
+
|
7
|
+
Ramaze::App.options.views = 'gestalt'
|
8
|
+
|
9
|
+
class SpecGestalt < Ramaze::Controller
|
10
|
+
map '/'
|
11
|
+
engine :Gestalt
|
12
|
+
helper :gestalt
|
13
|
+
|
14
|
+
def index
|
15
|
+
@title = 'Gestalt Index'
|
16
|
+
g
|
17
|
+
end
|
18
|
+
|
19
|
+
def links
|
20
|
+
g
|
21
|
+
end
|
22
|
+
|
23
|
+
def with_partial
|
24
|
+
g
|
25
|
+
end
|
26
|
+
|
27
|
+
def different_module
|
28
|
+
g(:foo, SpecGestalDifferentModule)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module SpecGestaltView
|
33
|
+
def index
|
34
|
+
h1 @title
|
35
|
+
end
|
36
|
+
|
37
|
+
def links
|
38
|
+
ul do
|
39
|
+
li{ a "Index page", :href => rs(:index) }
|
40
|
+
li{ a "Internal template", :href => rs(:internal) }
|
41
|
+
li{ a "External template", :href => rs(:external) }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# def external
|
46
|
+
# ol do
|
47
|
+
# 3.times{ render_view('template') }
|
48
|
+
# end
|
49
|
+
# end
|
50
|
+
|
51
|
+
def with_partial
|
52
|
+
ul do
|
53
|
+
3.times{ _partial }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def _partial
|
58
|
+
li 'List Item'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
module SpecGestalDifferentModule
|
63
|
+
def foo
|
64
|
+
p{ 'view module specified'}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe Ramaze::View::Gestalt do
|
69
|
+
behaves_like :mock
|
70
|
+
|
71
|
+
should 'use g helper' do
|
72
|
+
get('/').body.should == '<h1>Gestalt Index</h1>'
|
73
|
+
end
|
74
|
+
|
75
|
+
should 'use other helper methods' do
|
76
|
+
get('/links').body.should ==
|
77
|
+
'<ul><li><a href="/index">Index page</a></li><li><a href="/internal">Internal template</a></li><li><a href="/external">External template</a></li></ul>'
|
78
|
+
end
|
79
|
+
|
80
|
+
should 'render external template' do
|
81
|
+
get('/external').body.should ==
|
82
|
+
"<html><head><title>Gestalt Test</title></head><body><h1>Gestalt Template</h1></body></html>"
|
83
|
+
end
|
84
|
+
|
85
|
+
should 'use method like partials' do
|
86
|
+
get('/with_partial').body.should ==
|
87
|
+
'<ul><li>List Item</li><li>List Item</li><li>List Item</li></ul>'
|
88
|
+
end
|
89
|
+
|
90
|
+
should 'be able to specify different view module and method' do
|
91
|
+
get('/different_module').body.should ==
|
92
|
+
'<p>view module specified</p>'
|
93
|
+
end
|
94
|
+
end
|
data/tasks/release.rake
CHANGED
@@ -2,7 +2,7 @@ namespace :release do
|
|
2
2
|
task :all => [:release_github, :release_rubyforge]
|
3
3
|
|
4
4
|
desc 'Display instructions to release on github'
|
5
|
-
task :github => [:jquery, :reversion, :gemspec] do
|
5
|
+
task :github => [:jquery, :reversion, :authors, :gemspec] do
|
6
6
|
name, version = GEMSPEC.name, GEMSPEC.version
|
7
7
|
|
8
8
|
puts <<INSTRUCTIONS
|
@@ -22,14 +22,14 @@ INSTRUCTIONS
|
|
22
22
|
|
23
23
|
# TODO: Not tested
|
24
24
|
desc 'Display instructions to release on rubyforge'
|
25
|
-
task :rubyforge => [:jquery, :reversion, :gemspec, :package] do
|
25
|
+
task :rubyforge => [:jquery, :reversion, :authors, :gemspec, :package] do
|
26
26
|
name, version = GEMSPEC.name, GEMSPEC.version
|
27
27
|
|
28
28
|
puts <<INSTRUCTIONS
|
29
29
|
To publish to rubyforge do following:
|
30
30
|
|
31
31
|
rubyforge login
|
32
|
-
rubyforge add_release #{name} '#{version}' pkg/#{name}-#{version}.gem
|
32
|
+
rubyforge add_release #{name} #{name} '#{version}' pkg/#{name}-#{version}.gem
|
33
33
|
|
34
34
|
After you have done these steps, see:
|
35
35
|
|
@@ -40,9 +40,10 @@ INSTRUCTIONS
|
|
40
40
|
|
41
41
|
desc 'Display instructions to add archives after release:rubyforge'
|
42
42
|
task :rubyforge_archives do
|
43
|
+
name, version = GEMSPEC.name, GEMSPEC.version
|
43
44
|
puts "Adding archives for distro packagers is:", ""
|
44
45
|
|
45
|
-
Dir["pkg/#{name}-#{version}.{
|
46
|
+
Dir["pkg/#{name}-#{version}.{tgz,zip}"].each do |file|
|
46
47
|
puts "rubyforge add_file #{name} #{name} '#{version}' '#{file}'"
|
47
48
|
end
|
48
49
|
|
data/tasks/setup.rake
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
-
# Currently, Ramaze is not usable without Rack from the master branch head.
|
2
|
-
# Also, our specs now depend on the latest rack-test.
|
3
|
-
#
|
4
|
-
# In order to make setup simpler for folks, I'll put up some gemspecs on github
|
5
|
-
# and use their automatic building to provide development versions of these
|
6
|
-
# libraries as gems for easier deployment.
|
7
|
-
#
|
8
|
-
# Once the libraries are officially released in a usable state I'll switch
|
9
|
-
# dependencies to the official ones again.
|
10
|
-
#
|
11
|
-
# Please note that this makes running in environments that enforce their own
|
12
|
-
# Rack (like jruby-rack) still quite difficult, but should allow for easier
|
13
|
-
# development.
|
14
|
-
#
|
15
|
-
# Please be patient.
|
16
|
-
|
17
1
|
desc 'install all possible dependencies'
|
18
2
|
task :setup do
|
19
3
|
GemInstaller.new do
|
4
|
+
# core
|
5
|
+
gem 'innate', '= 2009.04'
|
6
|
+
|
20
7
|
# misc
|
21
8
|
gem 'bacon', '>= 1.0'
|
22
9
|
gem 'json', '>= 1.1.3'
|
@@ -32,13 +19,6 @@ task :setup do
|
|
32
19
|
gem 'tagz', '>= 5.0.1'
|
33
20
|
gem 'tenjin', '~> 0.6.1'
|
34
21
|
|
35
|
-
# mine
|
36
|
-
gem 'manveru-innate', '>= 2009.04.10', :lib => 'innate', :source => github
|
37
|
-
gem 'manveru-ezamar', '>= 2009.03.10', :lib => 'ezamar', :source => github
|
38
|
-
gem 'manveru-nagoro', '>= 2009.03.28', :lib => 'nagoro', :source => github
|
39
|
-
gem 'manveru-rack-test', '> 0.1.0', :lib => 'rack-test', :source => github
|
40
|
-
gem 'manveru-rack', '>= 0.9.9', :lib => 'rack', :source => github
|
41
|
-
|
42
22
|
setup
|
43
23
|
end
|
44
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manveru-ramaze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2009.
|
4
|
+
version: "2009.05"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael 'manveru' Fellinger
|
@@ -9,10 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-07 00:00:00 -07:00
|
13
13
|
default_executable: ramaze
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: innate
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "2009.05"
|
24
|
+
version:
|
16
25
|
description: Ramaze is a simple and modular web framework
|
17
26
|
email: m.fellinger@gmail.com
|
18
27
|
executables:
|
@@ -25,8 +34,15 @@ files:
|
|
25
34
|
- .mailmap
|
26
35
|
- CHANGELOG
|
27
36
|
- MANIFEST
|
28
|
-
- README.
|
37
|
+
- README.md
|
29
38
|
- Rakefile
|
39
|
+
- benchmark/bench_templates/bench.rb
|
40
|
+
- benchmark/bench_templates/view/large.erb
|
41
|
+
- benchmark/bench_templates/view/large.haml
|
42
|
+
- benchmark/bench_templates/view/large.xhtml
|
43
|
+
- benchmark/bench_templates/view/small.erb
|
44
|
+
- benchmark/bench_templates/view/small.haml
|
45
|
+
- benchmark/bench_templates/view/small.xhtml
|
30
46
|
- benchmark/results.txt
|
31
47
|
- benchmark/run.rb
|
32
48
|
- benchmark/suite/minimal.rb
|
@@ -34,8 +50,8 @@ files:
|
|
34
50
|
- benchmark/suite/no_sessions.rb
|
35
51
|
- benchmark/suite/no_template.rb
|
36
52
|
- benchmark/suite/simple.rb
|
37
|
-
- benchmark/suite/template_builder.rb
|
38
53
|
- benchmark/suite/template_erubis.rb
|
54
|
+
- benchmark/suite/template_etanni.rb
|
39
55
|
- benchmark/suite/template_ezamar.rb
|
40
56
|
- benchmark/suite/template_haml.rb
|
41
57
|
- benchmark/suite/template_liquid.rb
|
@@ -93,15 +109,15 @@ files:
|
|
93
109
|
- examples/app/blog/view/feed.rss.nag
|
94
110
|
- examples/app/blog/view/index.nag
|
95
111
|
- examples/app/blog/view/tag/index.nag
|
96
|
-
- examples/app/chat/layout/default.
|
112
|
+
- examples/app/chat/layout/default.xhtml
|
97
113
|
- examples/app/chat/model/history.rb
|
98
114
|
- examples/app/chat/model/message.rb
|
99
115
|
- examples/app/chat/public/css/chat.css
|
100
116
|
- examples/app/chat/public/js/chat.js
|
101
117
|
- examples/app/chat/public/js/jquery.js
|
102
118
|
- examples/app/chat/start.rb
|
103
|
-
- examples/app/chat/view/chat.
|
104
|
-
- examples/app/chat/view/index.
|
119
|
+
- examples/app/chat/view/chat.xhtml
|
120
|
+
- examples/app/chat/view/index.xhtml
|
105
121
|
- examples/app/localization/start.rb
|
106
122
|
- examples/app/sourceview/public/coderay.css
|
107
123
|
- examples/app/sourceview/public/images/file.gif
|
@@ -177,7 +193,6 @@ files:
|
|
177
193
|
- examples/helpers/identity.rb
|
178
194
|
- examples/helpers/nitro_form.rb
|
179
195
|
- examples/helpers/paginate.rb
|
180
|
-
- examples/helpers/provide.rb
|
181
196
|
- examples/helpers/rest.rb
|
182
197
|
- examples/helpers/simple_captcha.rb
|
183
198
|
- examples/misc/css.rb
|
@@ -304,7 +319,6 @@ files:
|
|
304
319
|
- lib/ramaze/snippets/blankslate.rb
|
305
320
|
- lib/ramaze/snippets/divide.rb
|
306
321
|
- lib/ramaze/snippets/fiber.rb
|
307
|
-
- lib/ramaze/snippets/kernel/constant.rb
|
308
322
|
- lib/ramaze/snippets/kernel/pretty_inspect.rb
|
309
323
|
- lib/ramaze/snippets/metaid.rb
|
310
324
|
- lib/ramaze/snippets/numeric/filesize_format.rb
|
@@ -335,12 +349,14 @@ files:
|
|
335
349
|
- lib/ramaze/spec/helper/pretty_output.rb
|
336
350
|
- lib/ramaze/spec/helper/snippets.rb
|
337
351
|
- lib/ramaze/spec/helper/template_examples.rb
|
352
|
+
- lib/ramaze/tool/bin.rb
|
338
353
|
- lib/ramaze/tool/create.rb
|
339
354
|
- lib/ramaze/tool/project_creator.rb
|
340
355
|
- lib/ramaze/version.rb
|
341
356
|
- lib/ramaze/view.rb
|
342
357
|
- lib/ramaze/view/erubis.rb
|
343
358
|
- lib/ramaze/view/ezamar.rb
|
359
|
+
- lib/ramaze/view/gestalt.rb
|
344
360
|
- lib/ramaze/view/haml.rb
|
345
361
|
- lib/ramaze/view/liquid.rb
|
346
362
|
- lib/ramaze/view/maruku.rb
|
@@ -452,6 +468,8 @@ files:
|
|
452
468
|
- spec/ramaze/view/ezamar.rb
|
453
469
|
- spec/ramaze/view/ezamar/external.zmr
|
454
470
|
- spec/ramaze/view/ezamar/sum.zmr
|
471
|
+
- spec/ramaze/view/gestalt.rb
|
472
|
+
- spec/ramaze/view/gestalt/external.ges
|
455
473
|
- spec/ramaze/view/haml.rb
|
456
474
|
- spec/ramaze/view/haml/external.haml
|
457
475
|
- spec/ramaze/view/haml/sum.haml
|
data/examples/helpers/provide.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'ramaze'
|
2
|
-
require 'fjson'
|
3
|
-
|
4
|
-
class User
|
5
|
-
def to_yaml
|
6
|
-
"Look, I'm YAML!".to_yaml
|
7
|
-
end
|
8
|
-
|
9
|
-
def to_json
|
10
|
-
"Look, I'm YSON!".to_json
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class MainController < Ramaze::Controller
|
15
|
-
helper :provide
|
16
|
-
provides :yaml, :json
|
17
|
-
|
18
|
-
def user
|
19
|
-
display User.new
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Ramaze.start
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
|
2
|
-
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
-
|
4
|
-
module Ramaze
|
5
|
-
module CoreExtensions
|
6
|
-
|
7
|
-
# Extensions for Kernel
|
8
|
-
|
9
|
-
module Object
|
10
|
-
|
11
|
-
# Original from Trans (Facets 1.4.5)
|
12
|
-
# This is similar to +Module#const_get+ but is accessible at all levels,
|
13
|
-
# and, unlike +const_get+, can handle module hierarchy.
|
14
|
-
#
|
15
|
-
# constant("Fixnum") # -> Fixnum
|
16
|
-
# constant(:Fixnum) # -> Fixnum
|
17
|
-
#
|
18
|
-
# constant("Process::Sys") # -> Process::Sys
|
19
|
-
# constant("Regexp::MULTILINE") # -> 4
|
20
|
-
#
|
21
|
-
# require 'test/unit'
|
22
|
-
# Test.constant("Unit::Assertions") # -> Test::Unit::Assertions
|
23
|
-
# Test.constant("::Test::Unit") # -> Test::Unit
|
24
|
-
|
25
|
-
def constant(const)
|
26
|
-
const = const.to_s.dup
|
27
|
-
|
28
|
-
if const.sub!(/^::/, '')
|
29
|
-
base = Object
|
30
|
-
elsif self.kind_of?(Module)
|
31
|
-
base = self
|
32
|
-
else
|
33
|
-
base = self.class
|
34
|
-
end
|
35
|
-
|
36
|
-
const.split(/::/).inject(base){ |mod, name| mod.const_get(name) }
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|