Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache_manager.rb:48: syntax error, unexpected '.', expecting kEND #8

Open
paulie4 opened this issue Nov 2, 2012 · 2 comments
Open

Comments

@paulie4
Copy link
Contributor

paulie4 commented Nov 2, 2012

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
@meltingice
Copy link
Member

Divergence was developed with Ruby 1.9 in mind. Going back and testing Ruby 1.8 support is something that is being considered.

@meltingice
Copy link
Member

If you could throw this into a pull request, that would help out immensely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants