divergence
divergence copied to clipboard
cache_manager.rb:48: syntax error, unexpected '.', expecting kEND
I don't know if it's just my version of ruby (1.8.7), but it does not like a method call being on a separate line from its object, so this block of code is causing it to crash:
branches
.sort_by {|f| File.mtime(f)}[@cache_num..-1]
.each do|dir|
FileUtils.rm_rf(dir)
@cached_branches.delete(dir.gsub('/', ''))
end
To fix it, I just escaped the end-of-lines for the first two lines, like this:
branches \
.sort_by {|f| File.mtime(f)}[@cache_num..-1] \
.each do|dir|
FileUtils.rm_rf(dir)
@cached_branches.delete(dir.gsub('/', ''))
end
Divergence was developed with Ruby 1.9 in mind. Going back and testing Ruby 1.8 support is something that is being considered.
If you could throw this into a pull request, that would help out immensely!