Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed warnings

Closes issue #409

Signed-off-by: Norman Clarke <norman@njclarke.com>
  • Loading branch information...
commit 245813a3284e7e2dda39a71eb08dee195731c953 1 parent cfb62f3
@joevandyk joevandyk authored norman committed
View
6 lib/haml/helpers/action_view_mods.rb
@@ -178,7 +178,7 @@ def form_for_with_haml(object_name, *args, &proc)
wrap_block = block_given? && is_haml? && block_is_haml?(proc)
if wrap_block
oldproc = proc
- proc = proc {|*args| with_tabs(1) {oldproc.call(*args)}}
+ proc = proc {|*subargs| with_tabs(1) {oldproc.call(*subargs)}}
end
res = form_for_without_haml(object_name, *args, &proc)
res << "\n" if wrap_block
@@ -238,9 +238,9 @@ def form_for_with_haml(object_name, *args, &proc)
wrap_block = block_given? && is_haml? && block_is_haml?(proc)
if wrap_block
oldproc = proc
- proc = haml_bind_proc do |*args|
+ proc = haml_bind_proc do |*subargs|
tab_up
- oldproc.call(*args)
+ oldproc.call(*subargs)
tab_down
concat haml_indent
end
View
10 lib/haml/parser.rb
@@ -199,10 +199,10 @@ def process_line(text, index)
when FILTER; push filter(text[1..-1].downcase)
when DOCTYPE
return push doctype(text) if text[0...3] == '!!!'
- return push plain(text[3..-1].strip, !:escape_html) if text[1..2] == "=="
- return push script(text[2..-1].strip, !:escape_html) if text[1] == SCRIPT
- return push flat_script(text[2..-1].strip, !:escape_html) if text[1] == FLAT_SCRIPT
- return push plain(text[1..-1].strip, !:escape_html) if text[1] == ?\s
+ return push plain(text[3..-1].strip, false) if text[1..2] == "=="
+ return push script(text[2..-1].strip, false) if text[1] == SCRIPT
+ return push flat_script(text[2..-1].strip, false) if text[1] == FLAT_SCRIPT
+ return push plain(text[1..-1].strip, false) if text[1] == ?\s
push plain(text)
when ESCAPE; push plain(text[1..-1])
else; push plain(text)
@@ -233,7 +233,7 @@ def plain(text, escape_html = nil)
end
escape_html = @options[:escape_html] if escape_html.nil?
- script(unescape_interpolation(text, escape_html), !:escape_html)
+ script(unescape_interpolation(text, escape_html), false)
end
def script(text, escape_html = nil, preserve = false)
View
12 test/template_test.rb
@@ -30,7 +30,7 @@ class DummyController
def initialize
@logger = Egocentic.new
end
-
+
def self.controller_path
''
end
@@ -59,7 +59,7 @@ def setup
def create_base
vars = { 'article' => Article.new, 'foo' => 'value one' }
-
+
unless Haml::Util.has?(:instance_method, ActionView::Base, :finder)
base = ActionView::Base.new(TEMPLATE_PATH, vars)
else
@@ -67,7 +67,7 @@ def create_base
base = ActionView::Base.new([], vars)
base.finder.append_view_path(TEMPLATE_PATH)
end
-
+
if Haml::Util.has?(:private_method, base, :evaluate_assigns)
# Rails < 3.0
base.send(:evaluate_assigns)
@@ -109,9 +109,9 @@ def assert_renders_correctly(name, &render_method)
Haml::Template.options[:escape_html] = false
if ActionPack::VERSION::MAJOR < 2 ||
(ActionPack::VERSION::MAJOR == 2 && ActionPack::VERSION::MINOR < 2)
- render_method ||= proc { |name| @base.render(name) }
+ render_method ||= proc { |n| @base.render(n) }
else
- render_method ||= proc { |name| @base.render(:file => name) }
+ render_method ||= proc { |n| @base.render(:file => n) }
end
load_result(name).split("\n").zip(render_method[name].split("\n")).each_with_index do |pair, line|
@@ -144,7 +144,7 @@ def test_templates_should_render_correctly_with_render_proc
engine.render_proc(@base).call
end
end
-
+
def test_templates_should_render_correctly_with_def_method
assert_renders_correctly("standard") do |name|
engine = Haml::Engine.new(File.read(File.dirname(__FILE__) + "/templates/#{name}.haml"))
View
2  yard/callbacks.rb
@@ -1,5 +1,5 @@
class CallbacksHandler < YARD::Handlers::Ruby::Legacy::Base
- handles /\Adefine_callback(\s|\()/
+ handles(/\Adefine_callback(\s|\()/)
def process
callback_name = tokval(statement.tokens[2])
Please sign in to comment.
Something went wrong with that request. Please try again.