lib/kaiser_ruby/transformer.rb in kaiser-ruby-0.7 vs lib/kaiser_ruby/transformer.rb in kaiser-ruby-0.7.1

- old
+ new

@@ -87,13 +87,13 @@ if @local_variables.empty? varname = "@#{varname}" else @local_variables << varname end - else - unless @local_variables.include?(varname) - varname = @method_names.include?(varname) ? varname : "@#{varname}" + else + unless @local_variables.include?(varname) + varname = @method_names.include?(varname) ? varname : "@#{varname}" end end @last_variable = varname varname @@ -235,10 +235,10 @@ return "end\n" end end def additional_argument_transformation(argument) - # testing function existence + # testing function existence arg = @method_names.include?(argument) ? "defined?(#{argument})" : argument # single variable without any operator needs to return a refined boolean arg = "#{arg}.to_bool" if arg !~ /==|>|>=|<|<=|!=/ \ No newline at end of file