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

0.7.2 has syntax errors on ruby 1.9.1 #44

Closed
cweiske opened this issue Dec 22, 2015 · 3 comments
Closed

0.7.2 has syntax errors on ruby 1.9.1 #44

cweiske opened this issue Dec 22, 2015 · 3 comments
Labels

Comments

@cweiske
Copy link

cweiske commented Dec 22, 2015

I'm running Ubuntu 14.04, the current LTS version.

Running sqlint that uses pg_query fails:

/var/lib/gems/1.9.1/gems/pg_query-0.7.2/lib/pg_query/deparse.rb:2:in
 `require_relative': /var/lib/gems/1.9.1/gems/pg_query-0.7.2/lib/pg_query/deparse/alter_table.rb:31:
 syntax error, unexpected tLPAREN_ARG, expecting keyword_do_LAMBDA or tLAMBEG (SyntaxError)
... many more of this

See http://ruby-journal.com/becareful-with-space-in-lambda-hash-rocket-syntax-between-ruby-1-dot-9-and-2-dot-0/ for more info about this.

It'd be nice if you could make this lib compatible with ruby 1.9.

@lfittl
Copy link
Member

lfittl commented Dec 23, 2015

@cweiske Hmm, good point - let me see if I can make Ruby 1.9 work over the holidays.

If its purely based on the hash syntax it should be possible to revert this to 1.9 style without problems. I'll update this issue once I know more.

@lfittl lfittl added the bug label Dec 23, 2015
@dkolbly
Copy link

dkolbly commented Apr 20, 2016

FWIW, I was able to get it to load by removing the space between the -> and (, like so:

        AT_AddColumn                 => ->(_node) { ['ADD COLUMN'] },
        AT_ColumnDefault             => ->(node) { ['ALTER COLUMN', node['def'] ? 'SET DEFAULT' : 'DROP DEFAULT'] },

etc.

@lfittl
Copy link
Member

lfittl commented Apr 21, 2016

@dkolbly @cweiske This has been fixed in 0.9.1 and will from now on be tested on Travis as well. Sorry about the inconvenience!

@lfittl lfittl closed this as completed Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants