ramaze 2012.04.14 → 2012.12.08b
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/.gems +28 -35
- data/.gitignore +4 -0
- data/.travis.yml +3 -3
- data/Gemfile +3 -0
- data/README.md +1 -5
- data/Rakefile +9 -20
- data/examples/app/blog/app.rb +5 -14
- data/examples/app/todolist/start.rb +1 -5
- data/guide/AUTHORS +8 -3
- data/guide/CHANGELOG +587 -0
- data/guide/general/cache.md +1 -0
- data/guide/general/configuration.md +2 -1
- data/guide/general/contributing.md +1 -0
- data/guide/general/controllers.md +105 -10
- data/guide/general/helpers.md +6 -7
- data/guide/general/installation.md +2 -1
- data/guide/general/logging.md +1 -4
- data/guide/general/middlewares.md +15 -23
- data/guide/general/models.md +1 -0
- data/guide/general/principles.md +1 -0
- data/guide/general/ramaze_command.md +9 -54
- data/guide/general/routes.md +1 -0
- data/guide/general/sessions.md +3 -2
- data/guide/general/special_thanks.md +1 -0
- data/guide/general/testing.md +1 -0
- data/guide/general/views.md +35 -22
- data/lib/proto/Gemfile +4 -0
- data/lib/proto/README.md +35 -0
- data/lib/proto/Rakefile +1 -0
- data/lib/proto/app.rb +2 -6
- data/lib/proto/spec/helper.rb +39 -0
- data/lib/proto/task/ramaze.rake +57 -0
- data/lib/ramaze.rb +12 -39
- data/lib/ramaze/bin/create.rb +1 -3
- data/lib/ramaze/bin/runner.rb +0 -14
- data/lib/ramaze/cache.rb +21 -0
- data/lib/ramaze/cache/memcache.rb +1 -3
- data/lib/ramaze/cache/redis.rb +2 -4
- data/lib/ramaze/cache/sequel.rb +4 -5
- data/lib/ramaze/controller.rb +10 -3
- data/lib/ramaze/default_middleware.rb +24 -0
- data/lib/ramaze/files.rb +5 -5
- data/lib/ramaze/gestalt.rb +10 -10
- data/lib/ramaze/helper/blue_form.rb +33 -6
- data/lib/ramaze/helper/csrf.rb +22 -30
- data/lib/ramaze/helper/flash.rb +1 -1
- data/lib/ramaze/helper/upload.rb +5 -3
- data/lib/ramaze/helper/user.rb +1 -0
- data/lib/ramaze/log.rb +0 -5
- data/lib/ramaze/log/informer.rb +3 -3
- data/lib/ramaze/log/logging.rb +4 -4
- data/lib/ramaze/log/syslog.rb +2 -2
- data/lib/ramaze/response.rb +1 -1
- data/lib/ramaze/snippets.rb +0 -20
- data/lib/ramaze/spec/bacon.rb +5 -13
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view/erector.rb +1 -3
- data/lib/ramaze/view/erubis.rb +1 -3
- data/lib/ramaze/view/ezamar.rb +1 -3
- data/lib/ramaze/view/haml.rb +1 -4
- data/lib/ramaze/view/liquid.rb +1 -3
- data/lib/ramaze/view/lokar.rb +1 -3
- data/lib/ramaze/view/mustache.rb +1 -3
- data/lib/ramaze/view/nagoro.rb +1 -4
- data/lib/ramaze/view/remarkably.rb +1 -4
- data/lib/ramaze/view/sass.rb +2 -5
- data/lib/ramaze/view/slim.rb +1 -3
- data/lib/ramaze/view/slippers.rb +1 -3
- data/lib/ramaze/view/tagz.rb +1 -3
- data/lib/ramaze/view/tenjin.rb +1 -3
- data/ramaze.gemspec +45 -16
- data/spec/helper.rb +0 -1
- data/spec/ramaze/cache/localmemcache.rb +0 -4
- data/spec/ramaze/controller/mapping.rb +17 -0
- data/spec/ramaze/dispatcher/directory.rb +6 -5
- data/spec/ramaze/dispatcher/file.rb +7 -4
- data/spec/ramaze/files.rb +0 -2
- data/spec/ramaze/helper/csrf.rb +0 -26
- data/spec/ramaze/helper/upload.rb +1 -0
- data/spec/ramaze/helper/user.rb +12 -0
- data/spec/ramaze/log/syslog.rb +5 -1
- data/spec/ramaze/view/lokar.rb +1 -1
- data/spec/ramaze/view/nagoro.rb +1 -1
- data/tasks/bacon.rake +1 -1
- data/tasks/gems.rake +15 -0
- data/tasks/release.rake +37 -8
- metadata +106 -139
- data/guide/_static/ramaze_console.png +0 -0
- data/guide/tutorials/introduction.md +0 -263
- data/lib/proto/model/init.rb +0 -6
- data/lib/proto/public/.htaccess +0 -24
- data/lib/proto/public/dispatch.fcgi +0 -11
- data/lib/proto/spec/main.rb +0 -20
- data/lib/proto/start.rb +0 -20
- data/lib/ramaze/app_graph.rb +0 -105
- data/lib/ramaze/bin/console.rb +0 -87
- data/lib/ramaze/bin/helper.rb +0 -107
- data/lib/ramaze/bin/restart.rb +0 -95
- data/lib/ramaze/bin/start.rb +0 -221
- data/lib/ramaze/bin/status.rb +0 -152
- data/lib/ramaze/bin/stop.rb +0 -112
- data/lib/ramaze/dependencies.rb +0 -84
- data/lib/ramaze/helper/disqus.rb +0 -27
- data/lib/ramaze/helper/ultraviolet.rb +0 -49
- data/lib/ramaze/log/analogger.rb +0 -50
- data/lib/ramaze/log/growl.rb +0 -55
- data/lib/ramaze/log/knotify.rb +0 -31
- data/lib/ramaze/log/xosd.rb +0 -94
- data/lib/ramaze/middleware_compiler.rb +0 -36
- data/lib/ramaze/plugin.rb +0 -69
- data/lib/ramaze/setup.rb +0 -210
- data/lib/ramaze/snippets/array/put_within.rb +0 -38
- data/lib/ramaze/snippets/binding/locals.rb +0 -20
- data/lib/ramaze/snippets/fiber.rb +0 -41
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +0 -18
- data/lib/ramaze/snippets/metaid.rb +0 -17
- data/lib/ramaze/snippets/numeric/filesize_format.rb +0 -30
- data/lib/ramaze/snippets/numeric/time.rb +0 -59
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +0 -16
- data/lib/ramaze/snippets/object/pretty.rb +0 -12
- data/lib/ramaze/snippets/object/scope.rb +0 -16
- data/lib/ramaze/snippets/ordered_set.rb +0 -51
- data/lib/ramaze/snippets/proc/locals.rb +0 -19
- data/lib/ramaze/snippets/ramaze/acquire.rb +0 -32
- data/lib/ramaze/snippets/ramaze/dictionary.rb +0 -400
- data/lib/ramaze/snippets/ramaze/fiber.rb +0 -24
- data/lib/ramaze/snippets/ramaze/struct.rb +0 -43
- data/lib/ramaze/snippets/string/end_with.rb +0 -17
- data/lib/ramaze/snippets/string/ord.rb +0 -16
- data/lib/ramaze/snippets/string/start_with.rb +0 -14
- data/lib/ramaze/snippets/thread/into.rb +0 -16
- data/lib/ramaze/spec.rb +0 -4
- data/spec/ramaze/bin/start.rb +0 -34
- data/spec/ramaze/log/growl.rb +0 -45
- data/spec/ramaze/struct.rb +0 -50
- data/spec/snippets/array/put_within.rb +0 -38
- data/spec/snippets/binding/locals.rb +0 -12
- data/spec/snippets/numeric/filesize_format.rb +0 -15
- data/spec/snippets/numeric/time.rb +0 -15
- data/spec/snippets/ordered_set.rb +0 -66
- data/spec/snippets/ramaze/acquire.rb +0 -80
- data/spec/snippets/ramaze/dictionary.rb +0 -113
- data/spec/snippets/ramaze/struct.rb +0 -15
- data/spec/snippets/thread/into.rb +0 -12
- data/tasks/gem.rake +0 -21
- data/tasks/setup.rake +0 -14
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
|
|
5
|
-
|
|
6
|
-
describe Ramaze::Dictionary do
|
|
7
|
-
Dictionary = Ramaze::Dictionary
|
|
8
|
-
|
|
9
|
-
should 'create' do
|
|
10
|
-
dict = Dictionary['z', 1, 'a', 2, 'c', 3]
|
|
11
|
-
dict.keys.should == %w[z a c]
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
should 'store' do
|
|
15
|
-
dict = Dictionary.new
|
|
16
|
-
dict['z'] = 1
|
|
17
|
-
dict['a'] = 2
|
|
18
|
-
dict['c'] = 3
|
|
19
|
-
dict.keys.should == %w[z a c]
|
|
20
|
-
|
|
21
|
-
dict = Dictionary.new
|
|
22
|
-
dict[:a] = 1
|
|
23
|
-
dict[:c] = 3
|
|
24
|
-
dict.values.should == [1, 3]
|
|
25
|
-
dict.keys.should == [:a, :c]
|
|
26
|
-
|
|
27
|
-
dict[:b, 1] = 2
|
|
28
|
-
dict.values.should == [1, 2, 3]
|
|
29
|
-
dict.keys.should == [:a, :b, :c]
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
should 'push' do
|
|
33
|
-
dict = Dictionary.new
|
|
34
|
-
dict.push('end', 15).should == true
|
|
35
|
-
dict['end'].should == 15
|
|
36
|
-
dict.push('end', 30).should == false
|
|
37
|
-
dict['end'].should == 15
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
should 'unshift' do
|
|
41
|
-
dict = Dictionary['a', 1, 'c', 2, 'z', 3]
|
|
42
|
-
dict.push('end', 15).should == true
|
|
43
|
-
dict.unshift('begin', 50).should == true
|
|
44
|
-
dict['begin'].should == 50
|
|
45
|
-
dict.keys.should == %w[begin a c z end]
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
should 'pop' do
|
|
49
|
-
dict = Dictionary['a', 1, 'c', 2, 'z', 3]
|
|
50
|
-
dict.pop.should == ['z', 3]
|
|
51
|
-
dict.keys.should == %w[a c]
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
should 'shift' do
|
|
55
|
-
dict = Dictionary['a', 1, 'c', 2, 'z', 3]
|
|
56
|
-
dict.shift.should == ['a', 1]
|
|
57
|
-
dict.keys.should == %w[c z]
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
should 'insert' do
|
|
61
|
-
dict_a = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
62
|
-
dict_b = Dictionary['d', 4, 'a', 1, 'b', 2, 'c', 3]
|
|
63
|
-
|
|
64
|
-
dict_a.insert(0, 'd', 4).should == 4
|
|
65
|
-
dict_a.should == dict_b
|
|
66
|
-
|
|
67
|
-
dict_c = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
68
|
-
dict_d = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
|
|
69
|
-
|
|
70
|
-
dict_c.insert(-1, 'd', 4)
|
|
71
|
-
dict_c.should == dict_d
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
should 'update with Dictionary' do
|
|
75
|
-
left = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
76
|
-
right = Dictionary['d', 4]
|
|
77
|
-
result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
|
|
78
|
-
|
|
79
|
-
left.update(right).should == result
|
|
80
|
-
left.should == result
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
should 'update with Hash' do
|
|
84
|
-
left = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
85
|
-
right = { 'd' => 4 }
|
|
86
|
-
result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
|
|
87
|
-
left.update(right).should == result
|
|
88
|
-
left.should == result
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
should 'merge with Dictionary' do
|
|
92
|
-
left = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
93
|
-
right = Dictionary['d', 4]
|
|
94
|
-
result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
|
|
95
|
-
left.merge(right).should == result
|
|
96
|
-
left.should.not == result
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
should 'merge with Hash' do
|
|
100
|
-
left = Dictionary['a', 1, 'b', 2, 'c', 3]
|
|
101
|
-
right = { 'd' => 4 }
|
|
102
|
-
result = Dictionary['a', 1, 'b', 2, 'c', 3, 'd', 4]
|
|
103
|
-
left.merge(right).should == result
|
|
104
|
-
left.should.not == result
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
should 'order by set order_by' do
|
|
108
|
-
dict = Dictionary['a', 3, 'b', 2, 'c', 1]
|
|
109
|
-
dict.order_by{|k,v| v }
|
|
110
|
-
dict.values.should == [1, 2, 3]
|
|
111
|
-
dict.keys.should == %w[c b a]
|
|
112
|
-
end
|
|
113
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
|
|
5
|
-
|
|
6
|
-
describe Ramaze::Struct do
|
|
7
|
-
should 'provide #values_at' do
|
|
8
|
-
Point = Ramaze::Struct.new(:x, :y)
|
|
9
|
-
point = Point.new(15, 10)
|
|
10
|
-
|
|
11
|
-
point.values_at(1, 0).should == [10, 15]
|
|
12
|
-
point.values_at(0..1).should == [15, 10]
|
|
13
|
-
point.values_at(:y, :x).should == [10, 15]
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)
|
|
5
|
-
|
|
6
|
-
describe 'Thread.into' do
|
|
7
|
-
it 'should provide access to thread vars' do
|
|
8
|
-
Thread.current[:foo] = :bar
|
|
9
|
-
Thread.new{ Thread.current[:foo].should == nil }.join
|
|
10
|
-
Thread.into{ Thread.current[:foo].should == :bar }.join
|
|
11
|
-
end
|
|
12
|
-
end
|
data/tasks/gem.rake
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
namespace :gem do
|
|
2
|
-
desc 'builds the gem and moves it to the pkg/ directory'
|
|
3
|
-
task :build do
|
|
4
|
-
pkg_dir = File.expand_path('../../pkg', __FILE__)
|
|
5
|
-
|
|
6
|
-
Dir.mkdir(pkg_dir) if !File.directory?(pkg_dir)
|
|
7
|
-
|
|
8
|
-
sh "gem build #{GEMSPEC.name}.gemspec"
|
|
9
|
-
sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem #{pkg_dir}"
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
desc "package and install from gemspec"
|
|
13
|
-
task :install => [:build] do
|
|
14
|
-
sh "gem install pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
desc "uninstall the gem"
|
|
18
|
-
task :uninstall do
|
|
19
|
-
sh %{gem uninstall -x #{GEMSPEC.name}}
|
|
20
|
-
end
|
|
21
|
-
end # namespace :gem
|
data/tasks/setup.rake
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../../lib/ramaze/setup', __FILE__)
|
|
2
|
-
|
|
3
|
-
desc 'install all possible dependencies'
|
|
4
|
-
task :setup do
|
|
5
|
-
Ramaze.setup(:verbose => false) do
|
|
6
|
-
deps = Ramaze::DEPENDENCIES + Ramaze::DEVELOPMENT_DEPENDENCIES
|
|
7
|
-
|
|
8
|
-
deps.each do |dep|
|
|
9
|
-
if dep[:setup] != false
|
|
10
|
-
gem(dep[:name], dep[:version], :lib => dep.delete(:lib))
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end # task :setup
|