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

Fix for ruby_parser > 3.x #85

Merged
merged 3 commits into from Jan 21, 2013
Merged

Fix for ruby_parser > 3.x #85

merged 3 commits into from Jan 21, 2013

Conversation

JeroenKnoops
Copy link
Contributor

Class Extractor was a subclass of RubyParser.
Ruby_parser 3.x uses Ruby18Parser and Ruby19Parser.

Changed superclass to Ruby19Parser / Ruby18Parser depending on Ruby Version in ruby_gettext_extractor.rb

Fixes issue #82, #72

@@ -32,7 +40,7 @@ def initialize(filename, targets)
@targets[k] = a
@results << a
end

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your whitespace :)

@grosser grosser merged commit 0922e28 into grosser:master Jan 21, 2013
@grosser
Copy link
Owner

grosser commented Jan 21, 2013

-> 0.9.0 is for you :)

@LukasBeaton
Copy link
Contributor

Is "rake gettext:find" supposed to work with HAML that uses Ruby 1.9?

I am having issue with this :(

@grosser
Copy link
Owner

grosser commented Feb 28, 2014

Does updating ruby parser help?
On Feb 28, 2014 1:02 PM, "LukasBeaton" notifications@github.com wrote:

Is "rake gettext:find" supposed to work with HAML that uses Ruby 1.9?

I am having issue with this :(

Reply to this email directly or view it on GitHubhttps://github.com//pull/85#issuecomment-36394044
.

@LukasBeaton
Copy link
Contributor

I am using ruby_parser (3.4.1) and I keep getting the following error,
even though my file does NOT have a semicolon. I am using Ruby 1.9 hash
syntax.

ruby_parser cannot read haml files with 1.9 syntax ---
app/views/users/_new.haml: ((string):18 :: parse error on value ";" (tSEMI))

My HAML code is below:

.border_wrapper.pop-up

= simple_form_for(@user, :html => { :class => 'form-horizontal' },
remote: true) do |f|

.modal-header

  %button.close{:type => 'button', :class => 'form-btn-close',

'data-dismiss' => 'modal'}

  %h1

    =s_('USERS|Sign Up')

.modal-body

  = f.error_notification

  .form-inputs

    = f.input :email, label: false, placeholder: s_('USERS|Email')

    = f.input :password, label: false, placeholder: s_('USERS|Password')

    = f.input :password_confirmation, label: false, placeholder:

s_('USERS|Password Confirmation')

    = f.input :postal_code, label: false, placeholder: s_('USERS|Postal

Code')

    %div.right-col

      = f.input :age_range, label: false, prompt: s_('USERS|Age

Range'), collection: User::AGE_RANGES

    = f.input :gender, label: false, prompt: s_('USERS|Gender)',

collection: { s_('USERS|Female') => User::FEMALE, s_('USERS|Male') =>
User::MALE }

    %div.right-col

      = f.input :preferred_language, label: false, prompt:

s_('USERS|Language'), collection: Utils::I18n.humanized_locales

.modal-footer

  = f.button :submit, s_('USERS|Create Account'), class: 'btn

btn-primary'

  = link_to s_('USERS|I already have an account'), login_path, remote:

true, class: 'btn-noaccount'

On Fri, Feb 28, 2014 at 4:09 PM, Michael Grosser
notifications@github.comwrote:

Does updating ruby parser help?
On Feb 28, 2014 1:02 PM, "LukasBeaton" notifications@github.com wrote:

Is "rake gettext:find" supposed to work with HAML that uses Ruby 1.9?

I am having issue with this :(

Reply to this email directly or view it on GitHub<
#85 (comment)

.

Reply to this email directly or view it on GitHubhttps://github.com//pull/85#issuecomment-36394672
.

@LukasBeaton
Copy link
Contributor

My apologies, I am actually using Ruby 2.0

On Fri, Feb 28, 2014 at 4:19 PM, Lukas Beaton lukas@coupgon.com wrote:

I am using ruby_parser (3.4.1) and I keep getting the following error,
even though my file does NOT have a semicolon. I am using Ruby 1.9 hash
syntax.

ruby_parser cannot read haml files with 1.9 syntax ---
app/views/users/_new.haml: ((string):18 :: parse error on value ";" (tSEMI))

My HAML code is below:

.border_wrapper.pop-up

= simple_form_for(@user, :html => { :class => 'form-horizontal' },
remote: true) do |f|

.modal-header

  %button.close{:type => 'button', :class => 'form-btn-close',

'data-dismiss' => 'modal'}

  %h1

    =s_('USERS|Sign Up')

.modal-body

  = f.error_notification

  .form-inputs

    = f.input :email, label: false, placeholder: s_('USERS|Email')

    = f.input :password, label: false, placeholder:

s_('USERS|Password')

    = f.input :password_confirmation, label: false, placeholder:

s_('USERS|Password Confirmation')

    = f.input :postal_code, label: false, placeholder:

s_('USERS|Postal Code')

    %div.right-col

      = f.input :age_range, label: false, prompt: s_('USERS|Age

Range'), collection: User::AGE_RANGES

    = f.input :gender, label: false, prompt: s_('USERS|Gender)',

collection: { s_('USERS|Female') => User::FEMALE, s_('USERS|Male') =>
User::MALE }

    %div.right-col

      = f.input :preferred_language, label: false, prompt:

s_('USERS|Language'), collection: Utils::I18n.humanized_locales

.modal-footer

  = f.button :submit, s_('USERS|Create Account'), class: 'btn

btn-primary'

  = link_to s_('USERS|I already have an account'), login_path, remote:

true, class: 'btn-noaccount'

On Fri, Feb 28, 2014 at 4:09 PM, Michael Grosser <notifications@github.com

wrote:

Does updating ruby parser help?
On Feb 28, 2014 1:02 PM, "LukasBeaton" notifications@github.com wrote:

Is "rake gettext:find" supposed to work with HAML that uses Ruby 1.9?

I am having issue with this :(

Reply to this email directly or view it on GitHub<
#85 (comment)

.

Reply to this email directly or view it on GitHubhttps://github.com//pull/85#issuecomment-36394672
.

@LukasBeaton
Copy link
Contributor

WOW....so I solved it and it turns out the Ruby Parser is fine.

In one of my lines of code I had s_('USERS|Gender)' instead of s_('USERS|Gender'). Notice the misplaced single quote. This caused a Ruby 1.9 error message, which I then Googled for, was mislead, and got taken for wild ride into wonderland.

Sorry to bug you and thanks for the help :)

@grosser
Copy link
Owner

grosser commented Feb 28, 2014

Maybe run it through ruby parser on its own and if that fails open a right
parse issue
On Feb 28, 2014 1:19 PM, "LukasBeaton" notifications@github.com wrote:

I am using ruby_parser (3.4.1) and I keep getting the following error,
even though my file does NOT have a semicolon. I am using Ruby 1.9 hash
syntax.

ruby_parser cannot read haml files with 1.9 syntax ---
app/views/users/_new.haml: ((string):18 :: parse error on value ";"
(tSEMI))

My HAML code is below:

.border_wrapper.pop-up

= simple_form_for(@user, :html => { :class => 'form-horizontal' },
remote: true) do |f|

.modal-header

%button.close{:type => 'button', :class => 'form-btn-close',
'data-dismiss' => 'modal'}

%h1

=s_('USERS|Sign Up')

.modal-body

= f.error_notification

.form-inputs

= f.input :email, label: false, placeholder: s_('USERS|Email')

= f.input :password, label: false, placeholder: s_('USERS|Password')

= f.input :password_confirmation, label: false, placeholder:
s_('USERS|Password Confirmation')

= f.input :postal_code, label: false, placeholder: s_('USERS|Postal
Code')

%div.right-col

= f.input :age_range, label: false, prompt: s_('USERS|Age
Range'), collection: User::AGE_RANGES

= f.input :gender, label: false, prompt: s_('USERS|Gender)',
collection: { s_('USERS|Female') => User::FEMALE, s_('USERS|Male') =>
User::MALE }

%div.right-col

= f.input :preferred_language, label: false, prompt:
s_('USERS|Language'), collection: Utils::I18n.humanized_locales

.modal-footer

= f.button :submit, s_('USERS|Create Account'), class: 'btn
btn-primary'

= link_to s_('USERS|I already have an account'), login_path, remote:
true, class: 'btn-noaccount'

On Fri, Feb 28, 2014 at 4:09 PM, Michael Grosser
notifications@github.comwrote:

Does updating ruby parser help?
On Feb 28, 2014 1:02 PM, "LukasBeaton" notifications@github.com wrote:

Is "rake gettext:find" supposed to work with HAML that uses Ruby 1.9?

I am having issue with this :(

Reply to this email directly or view it on GitHub<

#85 (comment)

.

Reply to this email directly or view it on GitHub<
#85 (comment)

.

Reply to this email directly or view it on GitHubhttps://github.com//pull/85#issuecomment-36395454
.

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

Successfully merging this pull request may close these issues.

None yet

3 participants