minimal 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,4 +16,4 @@ class Minimal::Template
16
16
  path =~ %r(views/(.*).rb) && $1.gsub('.', '/').camelize
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -3,7 +3,6 @@ class Minimal::Template
3
3
  autoload :Handler, 'minimal/template/handler'
4
4
 
5
5
  AUTO_BUFFER = %r(render|tag|error_message_|select|debug|_to|_for)
6
- # NO_AUTO_BUFFER = %r(form_tag|form_for)
7
6
 
8
7
  TAG_NAMES = %w(a body div em fieldset h1 h2 h3 h4 head html img input label li
9
8
  link ol option p pre script select span strong table thead tbody tfoot td th tr ul)
@@ -30,6 +29,10 @@ class Minimal::Template
30
29
  view.output_buffer << output
31
30
  end
32
31
 
32
+ def respond_to?(method)
33
+ locals.key?(method) || view.instance_variable_defined?("@#{method}") || view.respond_to?(method)
34
+ end
35
+
33
36
  protected
34
37
 
35
38
  def method_missing(method, *args, &block)
@@ -40,12 +43,8 @@ class Minimal::Template
40
43
 
41
44
  def call_view(method, *args, &block)
42
45
  block = lambda { |*a| self << view.with_output_buffer { yield(*a) } } if block
43
- view.send(method, *args, &block).tap { |result| self << result if auto_buffer?(method) }
44
- end
45
-
46
- def auto_buffer?(method)
47
- AUTO_BUFFER =~ method.to_s # && NO_AUTO_BUFFER !~ method.to_s
46
+ view.send(method, *args, &block).tap { |result| self << result if AUTO_BUFFER =~ method.to_s }
48
47
  end
49
48
  end
50
49
  include Base
51
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Minimal
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/minimal.rb CHANGED
@@ -2,5 +2,4 @@ require 'action_view'
2
2
 
3
3
  module Minimal
4
4
  autoload :Template, 'minimal/template'
5
- autoload :Tidy, 'minimal/tidy'
6
5
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sven Fuchs
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-03 00:00:00 +02:00
17
+ date: 2010-04-04 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20