lib/safemode/parser.rb in safemode-1.1.0 vs lib/safemode/parser.rb in safemode-1.2.0

- old
+ new

@@ -34,10 +34,11 @@ # split up #process_call. see below ... def process_call(exp) receiver = jail process_call_receiver(exp) name = exp.shift args = process_call_args(exp) + process_call_code(receiver, name, args) end def process_fcall(exp) # using haml we probably never arrive here because :lasgn'ed :fcalls @@ -147,11 +148,11 @@ args.empty? ? nil : args.join(", ") end def process_call_code(receiver, name, args) case name - when :<=>, :==, :<, :>, :<=, :>=, :-, :+, :*, :/, :%, :<<, :>>, :** then + when :<=>, :==, "!=".to_sym, :<, :>, :<=, :>=, :-, :+, :*, :/, :%, :<<, :>>, :** then "(#{receiver} #{name} #{args})" when :[] then "#{receiver}[#{args}]" when :"-@" then "-#{receiver}" @@ -193,10 +194,9 @@ # end r = "if #{c} then\n#{indent(t)}\n" r << "else\n#{indent(f)}\n" if f r << "end" - r else # unless expand then # r = "#{f} unless #{c}" # return r if (@indent+r).size < LINE_LENGTH and r !~ /\n/