Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Rails 3.x, Ruby 1.9.x + HAML = Terror?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ramón Cahenzli  
View profile  
 More options Mar 28 2012, 10:46 am
From: Ramón Cahenzli <ramon.cahen...@gmail.com>
Date: Wed, 28 Mar 2012 07:46:22 -0700 (PDT)
Local: Wed, Mar 28 2012 10:46 am
Subject: Rails 3.x, Ruby 1.9.x + HAML = Terror?

Hi everyone,

It seems ruby_parser is required to parse HAML files for gettext msgids
with the gettext:find rake task from gettext. However, ruby_parser doesn't
seem to work on Ruby 1.9.x.

So is it impossible to extract gettext msgids with reasonably new Rubies
and HAML?

Cheers,

Ramón


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ramón Cahenzli  
View profile  
 More options Mar 30 2012, 8:17 am
From: Ramón Cahenzli <ramon.cahen...@gmail.com>
Date: Fri, 30 Mar 2012 05:17:55 -0700 (PDT)
Local: Fri, Mar 30 2012 8:17 am
Subject: Re: Rails 3.x, Ruby 1.9.x + HAML = Terror?

Hi again,

Perhaps some more context. I've added the gems to my Gemfile as instructed
here: https://github.com/grosser/gettext_i18n_rails

I've also added ruby_parser because that readme says it's needed to parse
HAML. Yet rake gettext:find explodes on any and all HAML files:

Error parsing app/views/admin/contexts/_form.html.haml
rake aborted!

parse error on value "}" (tRCURLY)
/home/rca/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/racc/parser.rb:349:in
`on_error'
/home/rca/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/racc/parser.rb:99:in
`_racc_do_parse_c'
/home/rca/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/racc/parser.rb:99:in
`do_parse'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/ruby_parser-2.3.1/lib/ruby_parser_ extras.rb:750:in
`process'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext_i18n_rails-0.4.5/lib/gette xt_i18n_rails/ruby_gettext_extractor.rb:55:in
`run'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext_i18n_rails-0.4.5/lib/gette xt_i18n_rails/ruby_gettext_extractor.rb:26:in
`parse_string'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext_i18n_rails-0.4.5/lib/gette xt_i18n_rails/haml_parser.rb:20:in
`parse'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:140:in
`block (2 levels) in parse'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:134:in
`each'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:134:in
`block in parse'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:132:in
`each'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:132:in
`parse'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:121:in
`generate_pot'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:223:in
`block in run'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:221:in
`open'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:221:in
`run'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools/rg ettext.rb:243:in
`rgettext'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext-2.2.0/lib/gettext/tools.rb :128:in
`update_pofiles'
/home/rca/.rvm/gems/ruby-1.9.2-p318/gems/gettext_i18n_rails-0.4.5/lib/gette xt_i18n_rails/tasks.rb:28:in
`block (2 levels) in <top (required)>'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:205:in
`call'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:205:in
`block in execute'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:200:in
`each'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:200:in
`execute'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:158:in
`block in invoke_with_call_chain'
/home/rca/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:151:in
`invoke_with_call_chain'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task. rb:144:in
`invoke'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:116:in
`invoke_task'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in
`block (2 levels) in top_level'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in
`each'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in
`block in top_level'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in
`standard_exception_handling'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:88:in
`top_level'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:66:in
`block in run'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in
`standard_exception_handling'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/appli cation.rb:63:in
`run'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/bin/rake:33:in
`<top (required)>'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `load'
/home/rca/.rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `<main>'
Tasks: TOP => gettext:find

The file it's complaining about is:

https://github.com/zhdk/madek/blob/next/app/views/admin/contexts/_for...

It  seems to be valid HAML, it works fine in our app.

Any ideas?

Cheers,

Ramón


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ramón Cahenzli  
View profile  
 More options Apr 4 2012, 2:33 am
From: Ramón Cahenzli <ramon.cahen...@gmail.com>
Date: Tue, 3 Apr 2012 23:33:39 -0700 (PDT)
Local: Wed, Apr 4 2012 2:33 am
Subject: Re: Rails 3.x, Ruby 1.9.x + HAML = Terror?

Hi yet again,

Sorry for replying to my own post, but I found a workaround: It seems that
ruby_parser cannot deal with Ruby 1.9 syntax yet, so if your HAML files
contain any Ruby 1.9 syntax in their Ruby, it will break gettext's
gettext:find rake task (it relies on ruby_parser).

If ruby_parser ever starts supporting 1.9 syntax or if gettext starts using
a different Ruby parser, this limitation could go away. So until then, no
Ruby 1.9 in your HAML, even on Ruby 1.9.

Cheers,

Ramón


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »