Pistos-ramaze 2008.09 → 2008.12
Sign up to get free protection for your applications and to get access to all the features.
- 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/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 +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/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/action/render.rb +6 -5
- 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/contrib.rb +1 -1
- data/lib/ramaze/controller/resolve.rb +8 -3
- data/lib/ramaze/controller.rb +9 -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 +6 -1
- 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/httpdigest.rb +57 -28
- data/lib/ramaze/helper/maruku.rb +2 -0
- data/lib/ramaze/helper/paginate.rb +2 -3
- 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/helper.rb +12 -4
- data/lib/ramaze/log/rotatinginformer.rb +168 -0
- data/lib/ramaze/option/holder.rb +3 -3
- data/lib/ramaze/option.rb +1 -1
- data/lib/ramaze/reloader/watch_inotify.rb +85 -0
- data/lib/ramaze/reloader/watch_stat.rb +58 -0
- data/lib/ramaze/reloader.rb +25 -41
- 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 +1 -1
- data/lib/ramaze.rb +6 -0
- data/rake_tasks/coverage.rake +4 -5
- data/rake_tasks/spec.rake +6 -6
- data/ramaze.gemspec +769 -756
- 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/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/{object → ramaze}/acquire.rb +24 -18
- metadata +15 -12
- data/lib/ramaze/contrib/auto_params/get_args.rb +0 -58
- data/lib/ramaze/contrib/auto_params.rb +0 -135
- data/spec/contrib/auto_params.rb +0 -121
- data/spec/snippets/divide.rb +0 -19
@@ -42,8 +42,9 @@ module MockHTTP
|
|
42
42
|
|
43
43
|
def process_request(path, query)
|
44
44
|
options = {}
|
45
|
-
FISHING.each
|
46
|
-
options[value] = query.delete(key)
|
45
|
+
FISHING.each do |key, value|
|
46
|
+
options[value] = query.delete(key) if query.key?(key)
|
47
|
+
end if query.is_a?(Hash)
|
47
48
|
[create_url(path, query), options]
|
48
49
|
end
|
49
50
|
|
@@ -54,10 +55,10 @@ module MockHTTP
|
|
54
55
|
uri.to_s
|
55
56
|
end
|
56
57
|
|
57
|
-
|
58
|
-
|
58
|
+
def make_query query
|
59
|
+
return query unless query and not query.is_a?(String)
|
59
60
|
query.map{|key, value|
|
60
61
|
"#{Rack::Utils.escape(key)}=#{Rack::Utils.escape(value)}"
|
61
62
|
}.join('&')
|
62
|
-
|
63
|
+
end
|
63
64
|
end
|
@@ -7,6 +7,14 @@ require 'ramaze/template/ezamar/engine'
|
|
7
7
|
module Ezamar
|
8
8
|
|
9
9
|
# A transformer for <render /> tags.
|
10
|
+
#
|
11
|
+
# Setup:
|
12
|
+
#
|
13
|
+
# pipeline = Ramaze::Template::Ezamar::TRANSFORM_PIPELINE
|
14
|
+
# pipeline.put_after(::Ezamar::Element, ::Ezamar::RenderPartial)
|
15
|
+
# pipline.uniq!
|
16
|
+
#
|
17
|
+
# See /examples/basic/partial.rb for usage.
|
10
18
|
|
11
19
|
class RenderPartial
|
12
20
|
extend Ramaze::Helper::Partial
|
data/lib/ramaze/tool/mime.rb
CHANGED
@@ -9,7 +9,7 @@ module Ramaze
|
|
9
9
|
module MIME
|
10
10
|
|
11
11
|
# the mime_types.yaml as full path, we use a copy of mongrels.
|
12
|
-
trait :types => YAML.load_file(BASEDIR
|
12
|
+
trait :types => YAML.load_file(File.join(BASEDIR, 'ramaze/tool/mime_types.yaml'))
|
13
13
|
|
14
14
|
class << self
|
15
15
|
|
data/lib/ramaze/version.rb
CHANGED
data/lib/ramaze.rb
CHANGED
@@ -79,6 +79,8 @@ module Ramaze
|
|
79
79
|
# each class in trait[:essentials] by calling ::startup on them.
|
80
80
|
|
81
81
|
def startup options = {}
|
82
|
+
options = options.to_hash
|
83
|
+
|
82
84
|
force = options.delete(:force)
|
83
85
|
force ||= !trait[:started]
|
84
86
|
|
@@ -97,10 +99,14 @@ module Ramaze
|
|
97
99
|
end
|
98
100
|
end
|
99
101
|
|
102
|
+
# A shortcut for setting Ramaze.trait[:started] = true.
|
103
|
+
|
100
104
|
def skip_start
|
101
105
|
trait[:started] = true
|
102
106
|
end
|
103
107
|
|
108
|
+
# Forces the startup of Ramaze regardless if trait[:started] is set.
|
109
|
+
|
104
110
|
def start!(options = {})
|
105
111
|
trait[:started] = false
|
106
112
|
startup(options)
|
data/rake_tasks/coverage.rake
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
# All files in this distribution are subject to the terms of the Ruby license.
|
3
3
|
|
4
4
|
require 'rake'
|
5
|
-
require 'lib/ramaze/snippets/divide'
|
6
5
|
|
7
6
|
spec_base = File.expand_path('spec/ramaze/')
|
8
7
|
example_base = File.expand_path('examples')
|
@@ -10,10 +9,10 @@ snippets_base = File.expand_path('spec/snippets')
|
|
10
9
|
# ignore files with these paths
|
11
10
|
ignores = [ './*', './helper/*', './ramaze/adapter.rb', './ramaze/request.rb', ]
|
12
11
|
|
13
|
-
files = Dir[spec_base
|
14
|
-
Dir[example_base
|
12
|
+
files = Dir["#{spec_base}/**/*.rb"] +
|
13
|
+
Dir["#{example_base}/**/spec/*.rb"]
|
15
14
|
ignores.each do |ignore|
|
16
|
-
ignore_files = Dir[spec_base
|
15
|
+
ignore_files = Dir["#{spec_base}/#{ignore}"]
|
17
16
|
ignore_files.each do |ignore_file|
|
18
17
|
files.delete File.expand_path(ignore_file)
|
19
18
|
end
|
@@ -35,7 +34,7 @@ task :coverage => :clean do
|
|
35
34
|
# IMHO, ideally we should have
|
36
35
|
# * 100% coverage of ramaze with pure tests
|
37
36
|
# * 100% coverage with non-pure functional tests
|
38
|
-
pure_specs = Dir[snippets_base
|
37
|
+
pure_specs = Dir["#{snippets_base}/**/*.rb"].entries
|
39
38
|
sys(COV_CMD % ["no-","t", pure_specs.join(' ')])
|
40
39
|
|
41
40
|
files.each do |file|
|
data/rake_tasks/spec.rake
CHANGED
@@ -11,18 +11,18 @@ task 'spec' do
|
|
11
11
|
non_verbose, non_fatal = ENV['non_verbose'], ENV['non_fatal']
|
12
12
|
require 'scanf'
|
13
13
|
|
14
|
-
root = File.expand_path(File.dirname(__FILE__)
|
15
|
-
libpath = root/
|
14
|
+
root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
15
|
+
libpath = "#{root}/lib"
|
16
16
|
|
17
|
-
specs = Dir[root/
|
18
|
-
Dir[root/
|
17
|
+
specs = Dir["#{root}/spec/{ramaze,examples,snippets,contrib}/**/*.rb"] +
|
18
|
+
Dir["#{root}/examples/**/spec/**/*.rb"]
|
19
19
|
|
20
20
|
ignore = [
|
21
|
-
root/
|
21
|
+
"#{root}/spec/ramaze/request.rb",
|
22
22
|
].map{|i| Dir[i].map{|f| File.expand_path(f) }}.flatten
|
23
23
|
|
24
24
|
config = RbConfig::CONFIG
|
25
|
-
bin = config['bindir']
|
25
|
+
bin = File.join(config['bindir'], config['ruby_install_name'])
|
26
26
|
|
27
27
|
result_format = '%d tests, %d assertions, %d failures, %d errors'
|
28
28
|
|