Pistos-ramaze 2008.09 → 2008.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/benchmark/run.rb +1 -1
  2. data/examples/app/blog/spec/blog.rb +2 -2
  3. data/examples/app/rapaste/spec/rapaste.rb +1 -1
  4. data/examples/app/rapaste/start.rb +2 -2
  5. data/examples/app/rapaste/view/view.xhtml +3 -0
  6. data/examples/app/todolist/spec/todolist.rb +1 -1
  7. data/examples/app/whywiki/spec/whywiki.rb +1 -1
  8. data/examples/app/wikore/spec/wikore.rb +1 -1
  9. data/examples/app/wikore/src/model.rb +1 -1
  10. data/examples/app/wiktacular/spec/wiktacular.rb +1 -1
  11. data/examples/app/wiktacular/src/model.rb +1 -1
  12. data/examples/basic/partial.rb +28 -0
  13. data/examples/helpers/httpdigest.rb +68 -10
  14. data/examples/misc/ramaise.rb +2 -2
  15. data/examples/templates/template_amrita2.rb +1 -1
  16. data/examples/templates/template_erubis.rb +1 -1
  17. data/examples/templates/template_ezamar.rb +1 -1
  18. data/examples/templates/template_haml.rb +2 -2
  19. data/examples/templates/template_liquid.rb +1 -1
  20. data/examples/templates/template_markaby.rb +2 -2
  21. data/examples/templates/template_nagoro.rb +1 -1
  22. data/examples/templates/template_redcloth.rb +1 -1
  23. data/examples/templates/template_remarkably.rb +2 -2
  24. data/examples/templates/template_tenjin.rb +1 -1
  25. data/examples/templates/template_xslt.rb +1 -1
  26. data/lib/proto/controller/init.rb +2 -1
  27. data/lib/proto/model/init.rb +3 -3
  28. data/lib/proto/public/dispatch.fcgi +2 -2
  29. data/lib/proto/spec/main.rb +3 -3
  30. data/lib/proto/start.rb +4 -0
  31. data/lib/ramaze/action/render.rb +6 -5
  32. data/lib/ramaze/action.rb +7 -1
  33. data/lib/ramaze/cache/file.rb +71 -0
  34. data/lib/ramaze/cache.rb +1 -0
  35. data/lib/ramaze/contrib/email.rb +2 -0
  36. data/lib/ramaze/contrib/facebook.rb +2 -2
  37. data/lib/ramaze/contrib/file_cache.rb +2 -64
  38. data/lib/ramaze/contrib/sequel/image.rb +1 -1
  39. data/lib/ramaze/contrib.rb +1 -1
  40. data/lib/ramaze/controller/resolve.rb +8 -3
  41. data/lib/ramaze/controller.rb +9 -1
  42. data/lib/ramaze/current/request.rb +85 -68
  43. data/lib/ramaze/current/session/hash.rb +7 -11
  44. data/lib/ramaze/current/session.rb +3 -5
  45. data/lib/ramaze/dispatcher/action.rb +2 -0
  46. data/lib/ramaze/dispatcher/file.rb +6 -1
  47. data/lib/ramaze/helper/aspect.rb +2 -2
  48. data/lib/ramaze/helper/form.rb +5 -2
  49. data/lib/ramaze/helper/formatting.rb +4 -0
  50. data/lib/ramaze/helper/gravatar.rb +18 -1
  51. data/lib/ramaze/helper/httpdigest.rb +57 -28
  52. data/lib/ramaze/helper/maruku.rb +2 -0
  53. data/lib/ramaze/helper/paginate.rb +2 -3
  54. data/lib/ramaze/helper/partial.rb +1 -1
  55. data/lib/ramaze/helper/redirect.rb +22 -4
  56. data/lib/ramaze/helper/user.rb +4 -4
  57. data/lib/ramaze/helper.rb +12 -4
  58. data/lib/ramaze/log/rotatinginformer.rb +168 -0
  59. data/lib/ramaze/option/holder.rb +3 -3
  60. data/lib/ramaze/option.rb +1 -1
  61. data/lib/ramaze/reloader/watch_inotify.rb +85 -0
  62. data/lib/ramaze/reloader/watch_stat.rb +58 -0
  63. data/lib/ramaze/reloader.rb +25 -41
  64. data/lib/ramaze/snippets/divide.rb +2 -0
  65. data/lib/ramaze/snippets/numeric/time.rb +1 -1
  66. data/lib/ramaze/snippets/object/__dir__.rb +3 -3
  67. data/lib/ramaze/snippets/object/acquire.rb +3 -6
  68. data/lib/ramaze/snippets/ramaze/acquire.rb +31 -0
  69. data/lib/ramaze/snippets/ramaze/deprecated.rb +2 -1
  70. data/lib/ramaze/spec/helper/mock_http.rb +6 -5
  71. data/lib/ramaze/template/ezamar/render_partial.rb +8 -0
  72. data/lib/ramaze/tool/mime.rb +1 -1
  73. data/lib/ramaze/tool/project_creator.rb +2 -1
  74. data/lib/ramaze/version.rb +1 -1
  75. data/lib/ramaze.rb +6 -0
  76. data/rake_tasks/coverage.rake +4 -5
  77. data/rake_tasks/spec.rake +6 -6
  78. data/ramaze.gemspec +769 -756
  79. data/spec/contrib/profiling.rb +2 -2
  80. data/spec/ramaze/action/file_cache.rb +1 -1
  81. data/spec/ramaze/action/layout.rb +1 -1
  82. data/spec/ramaze/controller/actionless_templates.rb +1 -1
  83. data/spec/ramaze/controller/resolve.rb +1 -1
  84. data/spec/ramaze/controller/template_resolving.rb +1 -1
  85. data/spec/ramaze/dispatcher/directory.rb +3 -3
  86. data/spec/ramaze/helper/aspect.rb +1 -1
  87. data/spec/ramaze/helper/partial.rb +1 -1
  88. data/spec/ramaze/localize.rb +1 -1
  89. data/spec/ramaze/rewrite.rb +1 -1
  90. data/spec/ramaze/template/amrita2.rb +1 -1
  91. data/spec/ramaze/template/erubis.rb +1 -1
  92. data/spec/ramaze/template/ezamar.rb +1 -1
  93. data/spec/ramaze/template/haml.rb +2 -2
  94. data/spec/ramaze/template/nagoro.rb +1 -1
  95. data/spec/ramaze/template/redcloth.rb +1 -1
  96. data/spec/ramaze/template/sass.rb +1 -1
  97. data/spec/ramaze/template/tenjin.rb +1 -1
  98. data/spec/ramaze/template.rb +3 -3
  99. data/spec/snippets/object/__dir__.rb +6 -0
  100. data/spec/snippets/{object → ramaze}/acquire.rb +24 -18
  101. metadata +15 -12
  102. data/lib/ramaze/contrib/auto_params/get_args.rb +0 -58
  103. data/lib/ramaze/contrib/auto_params.rb +0 -135
  104. data/spec/contrib/auto_params.rb +0 -121
  105. 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{|key, value|
46
- options[value] = query.delete(key)} if query.is_a?(Hash)
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
- def make_query query
58
- return query unless query and not query.is_a?(String)
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
- end
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
@@ -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/'ramaze'/'tool'/'mime_types.yaml')
12
+ trait :types => YAML.load_file(File.join(BASEDIR, 'ramaze/tool/mime_types.yaml'))
13
13
 
14
14
  class << self
15
15
 
@@ -5,7 +5,8 @@ require 'fileutils'
5
5
  require 'find'
6
6
 
7
7
  class ProjectCreator
8
- PROTO = ['~/.proto/']
8
+ PROTO = []
9
+ PROTO << '~/.proto/' if ENV["HOME"] # Guard against Windows
9
10
  attr_accessor :name, :options
10
11
 
11
12
  def initialize(name, options = {})
@@ -2,5 +2,5 @@
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
4
  module Ramaze
5
- VERSION = "2008.09"
5
+ VERSION = "2008.10"
6
6
  end
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)
@@ -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/'**'/'*.rb'] +
14
- Dir[example_base/'**/spec'/'*.rb']
12
+ files = Dir["#{spec_base}/**/*.rb"] +
13
+ Dir["#{example_base}/**/spec/*.rb"]
15
14
  ignores.each do |ignore|
16
- ignore_files = Dir[spec_base/ignore]
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/'**/*.rb'].entries
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/'lib'
14
+ root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
15
+ libpath = "#{root}/lib"
16
16
 
17
- specs = Dir[root/'spec/{ramaze,examples,snippets,contrib}/**/*.rb'] +
18
- Dir[root/'examples/**/spec/**/*.rb']
17
+ specs = Dir["#{root}/spec/{ramaze,examples,snippets,contrib}/**/*.rb"] +
18
+ Dir["#{root}/examples/**/spec/**/*.rb"]
19
19
 
20
20
  ignore = [
21
- root/'spec/ramaze/request.rb',
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']/config['ruby_install_name']
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