ramaze 2008.06 → 2008.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -6
- data/Rakefile +33 -3
- data/bin/ramaze +18 -0
- data/doc/CHANGELOG +960 -0
- data/doc/LEGAL +5 -1
- data/doc/meta/announcement.txt +20 -36
- data/doc/tutorial/todolist.html +421 -313
- data/doc/tutorial/todolist.mkd +33 -16
- data/examples/app/blog/spec/blog.rb +3 -3
- data/examples/app/rapaste/controller/paste.rb +8 -1
- data/examples/app/rapaste/model/paste.rb +3 -0
- data/examples/app/rapaste/spec/rapaste.rb +3 -1
- data/examples/app/rapaste/start.rb +3 -2
- data/examples/app/sourceview/public/sourceview.js +2 -2
- data/examples/app/todolist/spec/todolist.rb +6 -6
- data/examples/app/todolist/template/index.xhtml +1 -1
- data/examples/app/whywiki/spec/whywiki.rb +2 -2
- data/examples/app/wikore/spec/wikore.rb +2 -2
- data/examples/app/wikore/src/model.rb +4 -3
- data/examples/app/wiktacular/spec/wiktacular.rb +7 -7
- data/examples/basic/simple.rb +2 -2
- data/examples/helpers/paginate.rb +71 -0
- data/examples/misc/simple_auth.rb +20 -8
- data/lib/proto/controller/init.rb +10 -0
- data/lib/proto/controller/main.rb +1 -3
- data/lib/proto/model/init.rb +4 -0
- data/lib/proto/public/dispatch.fcgi +1 -1
- data/lib/proto/spec/main.rb +2 -1
- data/lib/proto/start.rb +3 -3
- data/lib/proto/start.ru +1 -1
- data/lib/proto/view/error.xhtml +4 -4
- data/lib/ramaze.rb +8 -3
- data/lib/ramaze/action.rb +6 -6
- data/lib/ramaze/adapter.rb +1 -6
- data/lib/ramaze/adapter/base.rb +30 -27
- data/lib/ramaze/adapter/cgi.rb +1 -0
- data/lib/ramaze/cache.rb +1 -3
- data/lib/ramaze/cache/memcached.rb +3 -5
- data/lib/ramaze/contrib/auto_params.rb +2 -2
- data/lib/ramaze/contrib/auto_params/get_args.rb +2 -1
- data/lib/ramaze/contrib/gems.rb +17 -18
- data/lib/ramaze/contrib/gzip_filter.rb +22 -9
- data/lib/ramaze/contrib/maruku_uv.rb +59 -0
- data/lib/ramaze/contrib/profiling.rb +1 -1
- data/lib/ramaze/contrib/rest.rb +16 -13
- data/lib/ramaze/contrib/sequel/create_join.rb +25 -0
- data/lib/ramaze/contrib/sequel/form_field.rb +129 -0
- data/lib/ramaze/contrib/sequel/image.rb +198 -0
- data/lib/ramaze/contrib/sequel/relation.rb +82 -0
- data/lib/ramaze/controller.rb +33 -34
- data/lib/ramaze/controller/resolve.rb +29 -9
- data/lib/ramaze/current.rb +60 -20
- data/lib/ramaze/current/request.rb +8 -7
- data/lib/ramaze/current/response.rb +15 -3
- data/lib/ramaze/current/session/flash.rb +8 -0
- data/lib/ramaze/dispatcher.rb +17 -9
- data/lib/ramaze/dispatcher/action.rb +4 -5
- data/lib/ramaze/dispatcher/directory.rb +1 -1
- data/lib/ramaze/dispatcher/error.rb +4 -4
- data/lib/ramaze/dispatcher/file.rb +4 -4
- data/lib/ramaze/gestalt.rb +15 -20
- data/lib/ramaze/helper/cgi.rb +7 -15
- data/lib/ramaze/helper/formatting.rb +41 -1
- data/lib/ramaze/helper/httpdigest.rb +20 -7
- data/lib/ramaze/helper/link.rb +4 -6
- data/lib/ramaze/helper/paginate.rb +233 -0
- data/lib/ramaze/helper/redirect.rb +1 -1
- data/lib/ramaze/helper/rest.rb +1 -1
- data/lib/ramaze/helper/thread.rb +17 -0
- data/lib/ramaze/helper/ultraviolet.rb +44 -0
- data/lib/ramaze/helper/user.rb +4 -9
- data/lib/ramaze/log.rb +2 -2
- data/lib/ramaze/log/analogger.rb +21 -23
- data/lib/ramaze/log/growl.rb +21 -23
- data/lib/ramaze/log/hub.rb +1 -1
- data/lib/ramaze/log/informer.rb +97 -99
- data/lib/ramaze/log/knotify.rb +14 -16
- data/lib/ramaze/log/logger.rb +11 -13
- data/lib/ramaze/log/logging.rb +61 -63
- data/lib/ramaze/log/rotatinginformer.rb +168 -0
- data/lib/ramaze/log/syslog.rb +41 -31
- data/lib/ramaze/log/xosd.rb +70 -72
- data/lib/ramaze/option.rb +9 -6
- data/lib/ramaze/option/holder.rb +5 -27
- data/lib/ramaze/reloader.rb +186 -0
- data/lib/ramaze/setup.rb +1 -1
- data/lib/ramaze/snippets.rb +13 -0
- data/lib/ramaze/snippets/array/put_within.rb +31 -24
- data/lib/ramaze/snippets/binding/locals.rb +23 -11
- data/lib/ramaze/snippets/dictionary.rb +2 -2
- data/lib/ramaze/snippets/fiber.rb +63 -0
- data/lib/ramaze/snippets/kernel/constant.rb +36 -21
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +12 -6
- data/lib/ramaze/snippets/numeric/filesize_format.rb +24 -17
- data/lib/ramaze/snippets/numeric/time.rb +63 -0
- data/lib/ramaze/snippets/object/__dir__.rb +29 -0
- data/lib/ramaze/snippets/object/acquire.rb +40 -0
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +16 -5
- data/lib/ramaze/snippets/object/pretty.rb +14 -4
- data/lib/ramaze/snippets/object/scope.rb +14 -7
- data/lib/ramaze/snippets/ordered_set.rb +25 -14
- data/lib/ramaze/snippets/proc/locals.rb +17 -9
- data/lib/ramaze/snippets/ramaze/deprecated.rb +13 -0
- data/lib/ramaze/snippets/ramaze/fiber.rb +24 -0
- data/lib/ramaze/snippets/ramaze/state.rb +86 -0
- data/lib/ramaze/snippets/ramaze/struct.rb +45 -0
- data/lib/ramaze/snippets/string/camel_case.rb +13 -8
- data/lib/ramaze/snippets/string/color.rb +24 -20
- data/lib/ramaze/snippets/string/each.rb +14 -3
- data/lib/ramaze/snippets/string/end_with.rb +20 -0
- data/lib/ramaze/snippets/string/esc.rb +26 -21
- data/lib/ramaze/snippets/string/ord.rb +12 -6
- data/lib/ramaze/snippets/string/snake_case.rb +13 -7
- data/lib/ramaze/snippets/string/start_with.rb +16 -5
- data/lib/ramaze/snippets/string/unindent.rb +23 -15
- data/lib/ramaze/snippets/thread/into.rb +3 -3
- data/lib/ramaze/spec/helper/bacon.rb +5 -5
- data/lib/ramaze/spec/helper/mock_http.rb +1 -1
- data/lib/ramaze/spec/helper/pretty_output.rb +2 -2
- data/lib/ramaze/spec/helper/snippets.rb +8 -0
- data/lib/ramaze/template.rb +4 -1
- data/lib/ramaze/template/ezamar/textpow.syntax +34 -0
- data/lib/ramaze/template/maruku.rb +34 -0
- data/lib/ramaze/template/tagz.rb +2 -2
- data/lib/ramaze/template/xslt.rb +2 -2
- data/lib/ramaze/tool/create.rb +27 -53
- data/lib/ramaze/tool/localize.rb +8 -4
- data/lib/ramaze/tool/mime.rb +11 -1
- data/lib/ramaze/tool/project_creator.rb +110 -0
- data/lib/ramaze/trinity.rb +4 -1
- data/lib/ramaze/version.rb +1 -1
- data/lib/vendor/bacon.rb +323 -0
- data/rake_tasks/gem.rake +10 -1
- data/rake_tasks/maintenance.rake +40 -2
- data/rake_tasks/metric.rake +24 -0
- data/rake_tasks/release.rake +17 -4
- data/rake_tasks/spec.rake +1 -2
- data/ramaze.gemspec +549 -495
- data/spec/contrib/auto_params.rb +3 -3
- data/spec/contrib/profiling.rb +2 -2
- data/spec/examples/simple_auth.rb +2 -2
- data/spec/examples/templates/template_haml.rb +0 -2
- data/spec/ramaze/action/file_cache.rb +22 -0
- data/spec/ramaze/adapter.rb +2 -2
- data/spec/ramaze/controller/actionless_templates.rb +1 -1
- data/spec/ramaze/controller/subclass.rb +15 -0
- data/spec/ramaze/controller/template_resolving.rb +1 -1
- data/spec/ramaze/controller/view/bar.xhtml +1 -0
- data/spec/ramaze/controller/view/base/another.xhtml +1 -0
- data/spec/ramaze/current/session.rb +1 -1
- data/spec/ramaze/dispatcher/file.rb +2 -2
- data/spec/ramaze/helper/aspect.rb +26 -17
- data/spec/ramaze/helper/formatting.rb +13 -0
- data/spec/ramaze/log/informer.rb +10 -10
- data/spec/ramaze/log/syslog.rb +67 -4
- data/spec/ramaze/rewrite.rb +1 -1
- data/spec/ramaze/route.rb +1 -1
- data/spec/ramaze/struct.rb +47 -0
- data/spec/ramaze/template/markaby.rb +1 -1
- data/spec/ramaze/template/tagz.rb +1 -1
- data/spec/snippets/binding/locals.rb +9 -0
- data/spec/snippets/numeric/time.rb +12 -0
- data/spec/snippets/{kernel → object}/__dir__.rb +0 -0
- data/spec/snippets/{kernel → object}/acquire.rb +0 -0
- metadata +90 -81
- data/cache.yaml +0 -7
- data/examples/app/rammit/spec/rammit.rb +0 -31
- data/examples/app/rammit/src/controller/main.rb +0 -3
- data/examples/app/rammit/src/controller/page.rb +0 -16
- data/examples/app/rammit/src/model.rb +0 -33
- data/examples/app/rammit/start.rb +0 -8
- data/examples/app/rammit/template/index.xhtml +0 -14
- data/examples/app/rammit/template/page/view.xhtml +0 -4
- data/lib/ramaze/snippets/kernel/__dir__.rb +0 -23
- data/lib/ramaze/snippets/kernel/acquire.rb +0 -34
- data/lib/ramaze/snippets/object/thread_accessor.rb +0 -5
- data/lib/ramaze/snippets/ramaze/thread_accessor.rb +0 -58
- data/lib/ramaze/snippets/struct/fill.rb +0 -23
- data/lib/ramaze/snippets/struct/values_at.rb +0 -39
- data/lib/ramaze/snippets/symbol/to_proc.rb +0 -24
- data/lib/ramaze/sourcereload.rb +0 -176
- data/spec/snippets/struct/fill.rb +0 -26
- data/spec/snippets/struct/values_at.rb +0 -52
- data/spec/snippets/symbol/to_proc.rb +0 -13
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'lib/ramaze/spec/helper/snippets'
|
2
|
-
|
3
|
-
describe "Struct.fill" do
|
4
|
-
Point = Struct.new(:x,:y)
|
5
|
-
|
6
|
-
it "should return a well set struct" do
|
7
|
-
point = Point.fill(:x=>1,:y=>2)
|
8
|
-
point.should.instance_of? Point
|
9
|
-
point[0].should == 1
|
10
|
-
point[1].should == 2
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should work with partial arguments" do
|
14
|
-
point = Point.fill(:x=>1)
|
15
|
-
point.should.instance_of(Point)
|
16
|
-
point[0].should == 1
|
17
|
-
point[1].should == nil
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should not fail with foreign keys" do
|
21
|
-
point = Point.fill(:k=>1)
|
22
|
-
point.should.instance_of(Point)
|
23
|
-
point[0].should == nil
|
24
|
-
point[1].should == nil
|
25
|
-
end
|
26
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'lib/ramaze/spec/helper/snippets'
|
2
|
-
|
3
|
-
describe "Struct#values_at" do
|
4
|
-
Point = Struct.new(:x,:y)
|
5
|
-
|
6
|
-
before do
|
7
|
-
@point = Point.new(1,2)
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should access a single value" do
|
11
|
-
@point.values_at(:x).should == [1]
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should access multiple values" do
|
15
|
-
@point.values_at(:x,:y).should == [1,2]
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should access values regardless of order" do
|
19
|
-
@point.values_at(:y,:x).should == [2,1]
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should get same value twice" do
|
23
|
-
@point.values_at(:x,:x).should == [1,1]
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should raise on wrong value" do
|
27
|
-
should.raise(NameError){
|
28
|
-
@point.values_at(:k)
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should work with strings" do
|
33
|
-
@point.values_at('x').should == [1]
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should work with numbers (ruby compat)" do
|
37
|
-
@point.values_at(0).should == [1]
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should work with mixed args" do
|
41
|
-
@point.values_at(0,:x,'x',:y).should == [1,1,1,2]
|
42
|
-
end
|
43
|
-
|
44
|
-
should 'work with ranges' do
|
45
|
-
@point.values_at(0..1).should == [1,2]
|
46
|
-
end
|
47
|
-
|
48
|
-
should 'work with multiple ranges' do
|
49
|
-
@point.values_at(0..1, 0..1).should == [1,2,1,2]
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'lib/ramaze/spec/helper/snippets'
|
2
|
-
|
3
|
-
describe 'Symbol#to_proc' do
|
4
|
-
it 'should convert symbols to procs' do
|
5
|
-
[:one, :two, :three].map(&:to_s).should == %w[ one two three ]
|
6
|
-
end
|
7
|
-
|
8
|
-
it 'should work with list objects' do
|
9
|
-
{ 1 => "one",
|
10
|
-
2 => "two",
|
11
|
-
3 => "three" }.sort_by(&:first).map(&:last).should == %w[ one two three ]
|
12
|
-
end
|
13
|
-
end
|