trogdoro / xiki

A shell console with GUI features
http://xiki.org
Other
3.76k stars 207 forks source link

Strange formatting, or 'elsif' instead of 'else' #14

Closed duckinator closed 11 years ago

duckinator commented 11 years ago

If you take a look at lib/menu.rb, lines 637-640 (see https://github.com/trogdoro/xiki/blob/67b775107d303e9c54dce8b775268308e3fa60d8/lib/xiki/menu.rb#L631-640 for more context), you find this:

      elsif
        do_launch = true
        Tree.path.last
      end

This is treated as:

      elsif (do_launch = true)
        Tree.path.last
      end

Judging by the warning it raises:

/home/nick/.gem/ruby/1.9.1/gems/xiki-0.6.3/lib/xiki/menu.rb:638: warning: found = in conditional, should be ==

If it is intended as elsif do_launch = true, it needs to be changed to that or laid out differently to avoid the warning; otherwise I'm guessing the elsif likely needs to become an else.

trogdoro commented 11 years ago

Yeah, the elsif should just be an else. Guess it works anyway since the following line returns a true.

trogdoro commented 11 years ago

Fixed in https://github.com/trogdoro/xiki/commit/15232248a58d5542c5d5a5bcce26ebc79c754b9a