ramaze 2008.11 → 2009.01
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +7 -7
- data/benchmark/run.rb +1 -1
- data/doc/CHANGELOG +662 -0
- data/examples/app/blog/model/entry.rb +8 -1
- data/examples/app/blog/spec/blog.rb +2 -2
- data/examples/app/rapaste/spec/rapaste.rb +1 -1
- data/examples/app/rapaste/start.rb +2 -2
- data/examples/app/rapaste/view/view.xhtml +3 -0
- data/examples/app/todolist/spec/todolist.rb +1 -1
- data/examples/app/whywiki/spec/whywiki.rb +1 -1
- data/examples/app/wikore/spec/wikore.rb +1 -1
- data/examples/app/wikore/src/model.rb +8 -2
- data/examples/app/wiktacular/spec/wiktacular.rb +1 -1
- data/examples/app/wiktacular/src/model.rb +1 -1
- data/examples/basic/partial.rb +28 -0
- data/examples/helpers/httpdigest.rb +68 -10
- data/examples/misc/ramaise.rb +2 -2
- data/examples/templates/template_amrita2.rb +1 -1
- data/examples/templates/template_erubis.rb +1 -1
- data/examples/templates/template_ezamar.rb +1 -1
- data/examples/templates/template_haml.rb +2 -2
- data/examples/templates/template_liquid.rb +1 -1
- data/examples/templates/template_markaby.rb +2 -2
- data/examples/templates/template_nagoro.rb +1 -1
- data/examples/templates/template_redcloth.rb +1 -1
- data/examples/templates/template_remarkably.rb +2 -2
- data/examples/templates/template_tenjin.rb +1 -1
- data/examples/templates/template_xslt.rb +1 -1
- data/lib/proto/controller/init.rb +2 -1
- data/lib/proto/model/init.rb +3 -3
- data/lib/proto/public/dispatch.fcgi +2 -2
- data/lib/proto/spec/main.rb +3 -3
- data/lib/proto/start.rb +4 -0
- data/lib/ramaze.rb +6 -0
- data/lib/ramaze/action.rb +7 -1
- data/lib/ramaze/action/render.rb +6 -5
- data/lib/ramaze/cache.rb +1 -0
- data/lib/ramaze/cache/file.rb +71 -0
- data/lib/ramaze/contrib.rb +1 -1
- data/lib/ramaze/contrib/email.rb +2 -0
- data/lib/ramaze/contrib/facebook.rb +2 -2
- data/lib/ramaze/contrib/file_cache.rb +2 -64
- data/lib/ramaze/contrib/sequel/image.rb +1 -1
- data/lib/ramaze/controller.rb +9 -1
- data/lib/ramaze/controller/resolve.rb +10 -5
- data/lib/ramaze/current/request.rb +87 -70
- data/lib/ramaze/current/session.rb +3 -5
- data/lib/ramaze/current/session/hash.rb +7 -11
- data/lib/ramaze/dispatcher/action.rb +2 -0
- data/lib/ramaze/dispatcher/file.rb +6 -1
- data/lib/ramaze/helper.rb +12 -4
- data/lib/ramaze/helper/aspect.rb +2 -2
- data/lib/ramaze/helper/bench.rb +43 -0
- data/lib/ramaze/helper/form.rb +5 -2
- data/lib/ramaze/helper/formatting.rb +4 -0
- data/lib/ramaze/helper/gravatar.rb +18 -1
- data/lib/ramaze/helper/httpdigest.rb +55 -28
- data/lib/ramaze/helper/markaby.rb +1 -1
- data/lib/ramaze/helper/maruku.rb +2 -0
- data/lib/ramaze/helper/paginate.rb +1 -1
- data/lib/ramaze/helper/partial.rb +1 -1
- data/lib/ramaze/helper/redirect.rb +22 -4
- data/lib/ramaze/helper/user.rb +4 -4
- data/lib/ramaze/option.rb +1 -1
- data/lib/ramaze/option/holder.rb +3 -3
- data/lib/ramaze/reloader.rb +25 -41
- data/lib/ramaze/reloader/watch_inotify.rb +85 -0
- data/lib/ramaze/reloader/watch_stat.rb +58 -0
- data/lib/ramaze/snippets/divide.rb +2 -0
- data/lib/ramaze/snippets/numeric/time.rb +1 -1
- data/lib/ramaze/snippets/object/__dir__.rb +3 -3
- data/lib/ramaze/snippets/object/acquire.rb +3 -6
- data/lib/ramaze/snippets/ramaze/acquire.rb +31 -0
- data/lib/ramaze/snippets/ramaze/deprecated.rb +2 -1
- data/lib/ramaze/spec/helper/mock_http.rb +6 -5
- data/lib/ramaze/template/ezamar/render_partial.rb +8 -0
- data/lib/ramaze/tool/mime.rb +1 -1
- data/lib/ramaze/tool/project_creator.rb +2 -1
- data/lib/ramaze/version.rb +2 -2
- data/rake_tasks/coverage.rake +4 -5
- data/rake_tasks/spec.rake +6 -6
- data/ramaze-2008.11.gem +0 -0
- data/ramaze.gemspec +759 -758
- data/spec/contrib/profiling.rb +2 -2
- data/spec/ramaze/action/file_cache.rb +1 -1
- data/spec/ramaze/action/layout.rb +1 -1
- data/spec/ramaze/controller/actionless_templates.rb +1 -1
- data/spec/ramaze/controller/resolve.rb +1 -1
- data/spec/ramaze/controller/template_resolving.rb +1 -1
- data/spec/ramaze/dispatcher/directory.rb +3 -3
- data/spec/ramaze/helper/aspect.rb +1 -1
- data/spec/ramaze/helper/partial.rb +1 -1
- data/spec/ramaze/localize.rb +1 -1
- data/spec/ramaze/rewrite.rb +1 -1
- data/spec/ramaze/template.rb +3 -3
- data/spec/ramaze/template/amrita2.rb +1 -1
- data/spec/ramaze/template/erubis.rb +1 -1
- data/spec/ramaze/template/ezamar.rb +1 -1
- data/spec/ramaze/template/haml.rb +2 -2
- data/spec/ramaze/template/nagoro.rb +1 -1
- data/spec/ramaze/template/redcloth.rb +1 -1
- data/spec/ramaze/template/sass.rb +1 -1
- data/spec/ramaze/template/tenjin.rb +1 -1
- data/spec/snippets/object/__dir__.rb +6 -0
- data/spec/snippets/{object → ramaze}/acquire.rb +24 -18
- metadata +18 -16
- data/lib/ramaze/contrib/auto_params.rb +0 -135
- data/lib/ramaze/contrib/auto_params/get_args.rb +0 -58
- data/spec/contrib/auto_params.rb +0 -121
- data/spec/snippets/divide.rb +0 -19
data/spec/contrib/profiling.rb
CHANGED
@@ -15,14 +15,14 @@ Ramaze::Log.loggers << Ramaze::Logger::Informer.new(output)
|
|
15
15
|
|
16
16
|
describe 'Profiling' do
|
17
17
|
behaves_like "http"
|
18
|
-
ramaze :public_root => __DIR__
|
18
|
+
ramaze :public_root => __DIR__(:public)
|
19
19
|
|
20
20
|
it "should profile" do
|
21
21
|
output = StringIO.new
|
22
22
|
Ramaze::Log.loggers << Ramaze::Logger::Informer.new(output)
|
23
23
|
|
24
24
|
get('/')
|
25
|
-
output.string.should =~ /Thread ID:\s
|
25
|
+
output.string.should =~ /Thread ID:\s-?\d+/
|
26
26
|
output.string.should =~ /Total:/
|
27
27
|
output.string.should =~ /self\s+total\s+self\s+wait\s+child\s+call/
|
28
28
|
end
|
@@ -19,7 +19,7 @@ end
|
|
19
19
|
describe "Testing Actionless Templates" do
|
20
20
|
behaves_like 'http'
|
21
21
|
ramaze :actionless_templates => false,
|
22
|
-
:view_root => __DIR__
|
22
|
+
:view_root => __DIR__(:view), :error_page => true
|
23
23
|
|
24
24
|
it "should not find template file for non existant method" do
|
25
25
|
get('/non_existant_method').status.should == 404
|
@@ -12,8 +12,8 @@ describe 'Dispatcher::Directory' do
|
|
12
12
|
/test/six.txt ]
|
13
13
|
|
14
14
|
@hierarchy.each do |path|
|
15
|
-
FileUtils.mkdir_p(__DIR__
|
16
|
-
FileUtils.touch(__DIR__
|
15
|
+
FileUtils.mkdir_p(__DIR__(:public, File.dirname(path)))
|
16
|
+
FileUtils.touch(__DIR__(:public, path))
|
17
17
|
end
|
18
18
|
|
19
19
|
def build_listing(path)
|
@@ -51,5 +51,5 @@ describe 'Dispatcher::Directory' do
|
|
51
51
|
check '/test', 'Directory listing of /test', files
|
52
52
|
end
|
53
53
|
|
54
|
-
FileUtils.rm_rf(__DIR__
|
54
|
+
FileUtils.rm_rf(__DIR__('public/test'))
|
55
55
|
end
|
data/spec/ramaze/localize.rb
CHANGED
data/spec/ramaze/rewrite.rb
CHANGED
data/spec/ramaze/template.rb
CHANGED
@@ -21,7 +21,7 @@ end
|
|
21
21
|
class TCTemplateController < Ramaze::Controller
|
22
22
|
map '/'
|
23
23
|
engine :TestTemplate
|
24
|
-
view_root __DIR__
|
24
|
+
view_root __DIR__('template/ramaze')
|
25
25
|
|
26
26
|
def index *args
|
27
27
|
end
|
@@ -32,7 +32,7 @@ end
|
|
32
32
|
|
33
33
|
class TCMultipleTemplateRoots < Ramaze::Controller
|
34
34
|
map '/multiple'
|
35
|
-
view_root __DIR__
|
35
|
+
view_root __DIR__('helper/view'), __DIR__('template/ezamar')
|
36
36
|
|
37
37
|
def sum
|
38
38
|
@num1, @num2 = 1, 2
|
@@ -49,7 +49,7 @@ class TCMultipleTemplateRoots < Ramaze::Controller
|
|
49
49
|
end
|
50
50
|
|
51
51
|
describe "testing ramaze template" do
|
52
|
-
ramaze :view_root => __DIR__
|
52
|
+
ramaze :view_root => __DIR__(:view)
|
53
53
|
|
54
54
|
def getpage page
|
55
55
|
content = Ramaze::Controller.handle(page)
|
@@ -7,7 +7,7 @@ spec_require 'ramaze/template/haml'
|
|
7
7
|
|
8
8
|
class TCTemplateHamlController < Ramaze::Controller
|
9
9
|
map :/
|
10
|
-
view_root __DIR__
|
10
|
+
view_root __DIR__(:haml)
|
11
11
|
engine :Haml
|
12
12
|
|
13
13
|
helper :link
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
|
23
23
|
class TCRamazeLocals < Ramaze::Controller
|
24
24
|
map '/locals'
|
25
|
-
view_root __DIR__
|
25
|
+
view_root __DIR__(:haml)
|
26
26
|
|
27
27
|
def output
|
28
28
|
render_template 'locals.haml', :abc => 'def'
|
@@ -5,4 +5,10 @@ describe '__DIR__' do
|
|
5
5
|
it 'should report the directory of the current file' do
|
6
6
|
__DIR__.should == File.dirname(File.expand_path(__FILE__))
|
7
7
|
end
|
8
|
+
|
9
|
+
should 'join passed arguments and prefix with directory of current file' do
|
10
|
+
__DIR__(:foo).should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo')
|
11
|
+
__DIR__('foo/bar').should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo/bar')
|
12
|
+
__DIR__(:foo, :bar).should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo/bar')
|
13
|
+
end
|
8
14
|
end
|
@@ -1,11 +1,17 @@
|
|
1
1
|
require 'lib/ramaze/spec/helper/snippets'
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
|
5
|
+
# Mock require to only record attempts
|
6
|
+
$required = []
|
7
|
+
|
8
|
+
module Ramaze
|
9
|
+
def self.require(name)
|
10
|
+
$required << name
|
7
11
|
end
|
12
|
+
end
|
8
13
|
|
14
|
+
describe 'Ramaze::acquire' do
|
9
15
|
before do
|
10
16
|
dir = 'tmp_dir_for_acquire'
|
11
17
|
FileUtils.mkdir_p(dir + '/sub')
|
@@ -15,43 +21,43 @@ describe 'acquire' do
|
|
15
21
|
FileUtils.touch("#{dir}/#{path}")
|
16
22
|
end
|
17
23
|
|
18
|
-
|
24
|
+
$required = []
|
19
25
|
end
|
20
26
|
|
21
27
|
it 'should not load a single file' do
|
22
|
-
acquire 'tmp_dir_for_acquire/foo'
|
23
|
-
|
28
|
+
Ramaze::acquire 'tmp_dir_for_acquire/foo'
|
29
|
+
$required.should == []
|
24
30
|
end
|
25
31
|
|
26
32
|
it 'should load dir' do
|
27
|
-
acquire 'tmp_dir_for_acquire/sub/*'
|
28
|
-
|
33
|
+
Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
|
34
|
+
$required.should == %w[
|
29
35
|
tmp_dir_for_acquire/sub/baz.rb]
|
30
36
|
end
|
31
37
|
|
32
38
|
it 'should be aliased to acquire' do
|
33
|
-
acquire 'tmp_dir_for_acquire/sub/*'
|
34
|
-
|
39
|
+
Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
|
40
|
+
$required.should.not.be.empty
|
35
41
|
end
|
36
42
|
|
37
43
|
it 'should load {so,rb}, not others' do
|
38
|
-
acquire 'tmp_dir_for_acquire/*'
|
39
|
-
|
44
|
+
Ramaze::acquire 'tmp_dir_for_acquire/*'
|
45
|
+
$required.sort.should == %w[
|
40
46
|
tmp_dir_for_acquire/bar.rb
|
41
47
|
tmp_dir_for_acquire/baz.so
|
42
48
|
tmp_dir_for_acquire/foo.rb]
|
43
49
|
end
|
44
50
|
|
45
51
|
it 'should use globbing' do
|
46
|
-
acquire 'tmp_dir_for_acquire/ba*'
|
47
|
-
|
52
|
+
Ramaze::acquire 'tmp_dir_for_acquire/ba*'
|
53
|
+
$required.sort.should == %w[
|
48
54
|
tmp_dir_for_acquire/bar.rb
|
49
55
|
tmp_dir_for_acquire/baz.so]
|
50
56
|
end
|
51
57
|
|
52
58
|
it 'should use recursive globbing' do
|
53
|
-
acquire 'tmp_dir_for_acquire/**/*'
|
54
|
-
|
59
|
+
Ramaze::acquire 'tmp_dir_for_acquire/**/*'
|
60
|
+
$required.sort.should == %w[
|
55
61
|
tmp_dir_for_acquire/bar.rb
|
56
62
|
tmp_dir_for_acquire/baz.so
|
57
63
|
tmp_dir_for_acquire/foo.rb
|
@@ -59,8 +65,8 @@ describe 'acquire' do
|
|
59
65
|
end
|
60
66
|
|
61
67
|
it 'should accept multiple arguments' do
|
62
|
-
acquire 'tmp_dir_for_acquire/*', 'tmp_dir_for_acquire/sub/*'
|
63
|
-
|
68
|
+
Ramaze::acquire 'tmp_dir_for_acquire/*', 'tmp_dir_for_acquire/sub/*'
|
69
|
+
$required.sort.should == %w[
|
64
70
|
tmp_dir_for_acquire/bar.rb
|
65
71
|
tmp_dir_for_acquire/baz.so
|
66
72
|
tmp_dir_for_acquire/foo.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ramaze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "
|
4
|
+
version: "2009.01"
|
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:
|
12
|
+
date: 2009-01-12 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -265,6 +265,7 @@ files:
|
|
265
265
|
- examples/basic/hello.rb
|
266
266
|
- examples/basic/layout.rb
|
267
267
|
- examples/basic/linking.rb
|
268
|
+
- examples/basic/partial.rb
|
268
269
|
- examples/basic/simple.rb
|
269
270
|
- examples/helpers
|
270
271
|
- examples/helpers/cache.rb
|
@@ -353,14 +354,12 @@ files:
|
|
353
354
|
- lib/ramaze/adapter/webrick.rb
|
354
355
|
- lib/ramaze/cache
|
355
356
|
- lib/ramaze/cache.rb
|
357
|
+
- lib/ramaze/cache/file.rb
|
356
358
|
- lib/ramaze/cache/memcached.rb
|
357
359
|
- lib/ramaze/cache/memory.rb
|
358
360
|
- lib/ramaze/cache/yaml_store.rb
|
359
361
|
- lib/ramaze/contrib
|
360
362
|
- lib/ramaze/contrib.rb
|
361
|
-
- lib/ramaze/contrib/auto_params
|
362
|
-
- lib/ramaze/contrib/auto_params.rb
|
363
|
-
- lib/ramaze/contrib/auto_params/get_args.rb
|
364
363
|
- lib/ramaze/contrib/email.rb
|
365
364
|
- lib/ramaze/contrib/facebook
|
366
365
|
- lib/ramaze/contrib/facebook.rb
|
@@ -408,6 +407,7 @@ files:
|
|
408
407
|
- lib/ramaze/helper.rb
|
409
408
|
- lib/ramaze/helper/aspect.rb
|
410
409
|
- lib/ramaze/helper/auth.rb
|
410
|
+
- lib/ramaze/helper/bench.rb
|
411
411
|
- lib/ramaze/helper/cache.rb
|
412
412
|
- lib/ramaze/helper/cgi.rb
|
413
413
|
- lib/ramaze/helper/flash.rb
|
@@ -452,7 +452,10 @@ files:
|
|
452
452
|
- lib/ramaze/option/dsl.rb
|
453
453
|
- lib/ramaze/option/holder.rb
|
454
454
|
- lib/ramaze/option/merger.rb
|
455
|
+
- lib/ramaze/reloader
|
455
456
|
- lib/ramaze/reloader.rb
|
457
|
+
- lib/ramaze/reloader/watch_inotify.rb
|
458
|
+
- lib/ramaze/reloader/watch_stat.rb
|
456
459
|
- lib/ramaze/route.rb
|
457
460
|
- lib/ramaze/setup.rb
|
458
461
|
- lib/ramaze/snippets
|
@@ -483,6 +486,7 @@ files:
|
|
483
486
|
- lib/ramaze/snippets/proc
|
484
487
|
- lib/ramaze/snippets/proc/locals.rb
|
485
488
|
- lib/ramaze/snippets/ramaze
|
489
|
+
- lib/ramaze/snippets/ramaze/acquire.rb
|
486
490
|
- lib/ramaze/snippets/ramaze/caller_info.rb
|
487
491
|
- lib/ramaze/snippets/ramaze/caller_lines.rb
|
488
492
|
- lib/ramaze/snippets/ramaze/deprecated.rb
|
@@ -551,6 +555,7 @@ files:
|
|
551
555
|
- lib/ramaze/version.rb
|
552
556
|
- lib/vendor
|
553
557
|
- lib/vendor/bacon.rb
|
558
|
+
- pkg
|
554
559
|
- rake_tasks
|
555
560
|
- rake_tasks/conf.rake
|
556
561
|
- rake_tasks/coverage.rake
|
@@ -560,10 +565,10 @@ files:
|
|
560
565
|
- rake_tasks/metric.rake
|
561
566
|
- rake_tasks/release.rake
|
562
567
|
- rake_tasks/spec.rake
|
568
|
+
- ramaze-2008.11.gem
|
563
569
|
- ramaze.gemspec
|
564
570
|
- spec
|
565
571
|
- spec/contrib
|
566
|
-
- spec/contrib/auto_params.rb
|
567
572
|
- spec/contrib/profiling.rb
|
568
573
|
- spec/contrib/sequel
|
569
574
|
- spec/contrib/sequel/fill.rb
|
@@ -766,7 +771,6 @@ files:
|
|
766
771
|
- spec/snippets/array/put_within.rb
|
767
772
|
- spec/snippets/binding
|
768
773
|
- spec/snippets/binding/locals.rb
|
769
|
-
- spec/snippets/divide.rb
|
770
774
|
- spec/snippets/kernel
|
771
775
|
- spec/snippets/kernel/constant.rb
|
772
776
|
- spec/snippets/numeric
|
@@ -774,9 +778,9 @@ files:
|
|
774
778
|
- spec/snippets/numeric/time.rb
|
775
779
|
- spec/snippets/object
|
776
780
|
- spec/snippets/object/__dir__.rb
|
777
|
-
- spec/snippets/object/acquire.rb
|
778
781
|
- spec/snippets/ordered_set.rb
|
779
782
|
- spec/snippets/ramaze
|
783
|
+
- spec/snippets/ramaze/acquire.rb
|
780
784
|
- spec/snippets/ramaze/caller_info.rb
|
781
785
|
- spec/snippets/ramaze/caller_lines.rb
|
782
786
|
- spec/snippets/string
|
@@ -789,16 +793,14 @@ files:
|
|
789
793
|
has_rdoc: true
|
790
794
|
homepage: http://ramaze.rubyforge.org
|
791
795
|
post_install_message: |-
|
792
|
-
|
793
796
|
============================================================
|
794
|
-
|
797
|
+
|
795
798
|
Thank you for installing Ramaze!
|
796
|
-
|
799
|
+
You can now do following:
|
800
|
+
|
801
|
+
* Create a new project using the `ramaze' command:
|
802
|
+
ramaze --create yourproject
|
797
803
|
|
798
|
-
Feel free to ask questions in our IRC channel:
|
799
|
-
irc.freenode.net #ramaze
|
800
|
-
http://mibbit.com/?server=irc.freenode.net&channel=%23ramaze
|
801
|
-
|
802
804
|
============================================================
|
803
805
|
rdoc_options: []
|
804
806
|
|
@@ -819,7 +821,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
819
821
|
requirements: []
|
820
822
|
|
821
823
|
rubyforge_project: ramaze
|
822
|
-
rubygems_version: 1.
|
824
|
+
rubygems_version: 1.3.1
|
823
825
|
signing_key:
|
824
826
|
specification_version: 2
|
825
827
|
summary: Ramaze is a simple and modular web framework
|