manveru-ramaze 2008.10 → 2008.12
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/benchmark/run.rb +1 -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/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 +1 -1
- 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/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/public/dispatch.fcgi +2 -2
- data/lib/proto/spec/main.rb +3 -3
- data/lib/ramaze/action.rb +7 -1
- data/lib/ramaze/cache/file.rb +71 -0
- data/lib/ramaze/cache.rb +1 -0
- 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 +6 -1
- data/lib/ramaze/current/request.rb +85 -68
- data/lib/ramaze/current/session/hash.rb +7 -11
- data/lib/ramaze/current/session.rb +3 -5
- data/lib/ramaze/dispatcher/action.rb +2 -0
- data/lib/ramaze/dispatcher/file.rb +4 -0
- data/lib/ramaze/helper/aspect.rb +2 -2
- 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/maruku.rb +2 -0
- data/lib/ramaze/helper/redirect.rb +22 -4
- data/lib/ramaze/helper.rb +9 -2
- data/lib/ramaze/reloader/watch_inotify.rb +73 -0
- data/lib/ramaze/reloader/watch_stat.rb +62 -0
- data/lib/ramaze/reloader.rb +25 -41
- data/lib/ramaze/snippets/object/__dir__.rb +3 -3
- data/lib/ramaze/snippets/ramaze/acquire.rb +31 -0
- data/lib/ramaze/spec/helper/mock_http.rb +6 -5
- data/lib/ramaze/template/ezamar/render_partial.rb +8 -0
- data/lib/ramaze.rb +4 -0
- data/ramaze.gemspec +757 -756
- data/spec/contrib/profiling.rb +1 -1
- 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/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/ramaze/template.rb +3 -3
- data/spec/snippets/object/__dir__.rb +6 -0
- data/spec/snippets/ramaze/acquire.rb +77 -0
- metadata +8 -8
data/spec/contrib/profiling.rb
CHANGED
@@ -15,7 +15,7 @@ Ramaze::Log.loggers << Ramaze::Logger::Informer.new(output)
|
|
15
15
|
|
16
16
|
describe 'Profiling' do
|
17
17
|
behaves_like "http"
|
18
|
-
ramaze :public_root =>
|
18
|
+
ramaze :public_root => __DIR__(:public)
|
19
19
|
|
20
20
|
it "should profile" do
|
21
21
|
output = StringIO.new
|
@@ -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
@@ -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'
|
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)
|
@@ -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
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'lib/ramaze/spec/helper/snippets'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
|
5
|
+
# Mock require to only record attempts
|
6
|
+
$required = []
|
7
|
+
|
8
|
+
module Ramaze
|
9
|
+
def self.require(name)
|
10
|
+
$required << name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'Ramaze::acquire' do
|
15
|
+
before do
|
16
|
+
dir = 'tmp_dir_for_acquire'
|
17
|
+
FileUtils.mkdir_p(dir + '/sub')
|
18
|
+
|
19
|
+
%w[ foo.rb bar.rb baz.so baz.yml sub/baz.rb ].
|
20
|
+
each do |path|
|
21
|
+
FileUtils.touch("#{dir}/#{path}")
|
22
|
+
end
|
23
|
+
|
24
|
+
$required = []
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should not load a single file' do
|
28
|
+
Ramaze::acquire 'tmp_dir_for_acquire/foo'
|
29
|
+
$required.should == []
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should load dir' do
|
33
|
+
Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
|
34
|
+
$required.should == %w[
|
35
|
+
tmp_dir_for_acquire/sub/baz.rb]
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should be aliased to acquire' do
|
39
|
+
Ramaze::acquire 'tmp_dir_for_acquire/sub/*'
|
40
|
+
$required.should.not.be.empty
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should load {so,rb}, not others' do
|
44
|
+
Ramaze::acquire 'tmp_dir_for_acquire/*'
|
45
|
+
$required.sort.should == %w[
|
46
|
+
tmp_dir_for_acquire/bar.rb
|
47
|
+
tmp_dir_for_acquire/baz.so
|
48
|
+
tmp_dir_for_acquire/foo.rb]
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should use globbing' do
|
52
|
+
Ramaze::acquire 'tmp_dir_for_acquire/ba*'
|
53
|
+
$required.sort.should == %w[
|
54
|
+
tmp_dir_for_acquire/bar.rb
|
55
|
+
tmp_dir_for_acquire/baz.so]
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'should use recursive globbing' do
|
59
|
+
Ramaze::acquire 'tmp_dir_for_acquire/**/*'
|
60
|
+
$required.sort.should == %w[
|
61
|
+
tmp_dir_for_acquire/bar.rb
|
62
|
+
tmp_dir_for_acquire/baz.so
|
63
|
+
tmp_dir_for_acquire/foo.rb
|
64
|
+
tmp_dir_for_acquire/sub/baz.rb]
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should accept multiple arguments' do
|
68
|
+
Ramaze::acquire 'tmp_dir_for_acquire/*', 'tmp_dir_for_acquire/sub/*'
|
69
|
+
$required.sort.should == %w[
|
70
|
+
tmp_dir_for_acquire/bar.rb
|
71
|
+
tmp_dir_for_acquire/baz.so
|
72
|
+
tmp_dir_for_acquire/foo.rb
|
73
|
+
tmp_dir_for_acquire/sub/baz.rb]
|
74
|
+
end
|
75
|
+
|
76
|
+
FileUtils.rm_rf('tmp_dir_for_acquire')
|
77
|
+
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: "2008.
|
4
|
+
version: "2008.12"
|
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: 2008-12-
|
12
|
+
date: 2008-12-22 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- examples/basic/hello.rb
|
265
265
|
- examples/basic/layout.rb
|
266
266
|
- examples/basic/linking.rb
|
267
|
+
- examples/basic/partial.rb
|
267
268
|
- examples/basic/simple.rb
|
268
269
|
- examples/helpers
|
269
270
|
- examples/helpers/cache.rb
|
@@ -352,14 +353,12 @@ files:
|
|
352
353
|
- lib/ramaze/adapter/webrick.rb
|
353
354
|
- lib/ramaze/cache
|
354
355
|
- lib/ramaze/cache.rb
|
356
|
+
- lib/ramaze/cache/file.rb
|
355
357
|
- lib/ramaze/cache/memcached.rb
|
356
358
|
- lib/ramaze/cache/memory.rb
|
357
359
|
- lib/ramaze/cache/yaml_store.rb
|
358
360
|
- lib/ramaze/contrib
|
359
361
|
- lib/ramaze/contrib.rb
|
360
|
-
- lib/ramaze/contrib/auto_params
|
361
|
-
- lib/ramaze/contrib/auto_params.rb
|
362
|
-
- lib/ramaze/contrib/auto_params/get_args.rb
|
363
362
|
- lib/ramaze/contrib/email.rb
|
364
363
|
- lib/ramaze/contrib/facebook
|
365
364
|
- lib/ramaze/contrib/facebook.rb
|
@@ -452,6 +451,8 @@ files:
|
|
452
451
|
- lib/ramaze/option/holder.rb
|
453
452
|
- lib/ramaze/option/merger.rb
|
454
453
|
- lib/ramaze/reloader.rb
|
454
|
+
- lib/ramaze/reloader/watch_inotify.rb
|
455
|
+
- lib/ramaze/reloader/watch_stat.rb
|
455
456
|
- lib/ramaze/route.rb
|
456
457
|
- lib/ramaze/setup.rb
|
457
458
|
- lib/ramaze/snippets
|
@@ -482,6 +483,7 @@ files:
|
|
482
483
|
- lib/ramaze/snippets/proc
|
483
484
|
- lib/ramaze/snippets/proc/locals.rb
|
484
485
|
- lib/ramaze/snippets/ramaze
|
486
|
+
- lib/ramaze/snippets/ramaze/acquire.rb
|
485
487
|
- lib/ramaze/snippets/ramaze/caller_info.rb
|
486
488
|
- lib/ramaze/snippets/ramaze/caller_lines.rb
|
487
489
|
- lib/ramaze/snippets/ramaze/deprecated.rb
|
@@ -562,7 +564,6 @@ files:
|
|
562
564
|
- ramaze.gemspec
|
563
565
|
- spec
|
564
566
|
- spec/contrib
|
565
|
-
- spec/contrib/auto_params.rb
|
566
567
|
- spec/contrib/profiling.rb
|
567
568
|
- spec/contrib/sequel
|
568
569
|
- spec/contrib/sequel/fill.rb
|
@@ -765,7 +766,6 @@ files:
|
|
765
766
|
- spec/snippets/array/put_within.rb
|
766
767
|
- spec/snippets/binding
|
767
768
|
- spec/snippets/binding/locals.rb
|
768
|
-
- spec/snippets/divide.rb
|
769
769
|
- spec/snippets/kernel
|
770
770
|
- spec/snippets/kernel/constant.rb
|
771
771
|
- spec/snippets/numeric
|
@@ -773,9 +773,9 @@ files:
|
|
773
773
|
- spec/snippets/numeric/time.rb
|
774
774
|
- spec/snippets/object
|
775
775
|
- spec/snippets/object/__dir__.rb
|
776
|
-
- spec/snippets/object/acquire.rb
|
777
776
|
- spec/snippets/ordered_set.rb
|
778
777
|
- spec/snippets/ramaze
|
778
|
+
- spec/snippets/ramaze/acquire.rb
|
779
779
|
- spec/snippets/ramaze/caller_info.rb
|
780
780
|
- spec/snippets/ramaze/caller_lines.rb
|
781
781
|
- spec/snippets/string
|