strongself / Generamba

This codegenerator is too brilliant to be real!
MIT License
1.82k stars 183 forks source link

Whitespace control isn't works #159

Closed MaximBazarov closed 8 years ago

MaximBazarov commented 8 years ago

Whitespace controll

Template:

{%- include 'parameters' -%}
Creating code files...
liquid-3.0.6/lib/liquid/block.rb:41:in `parse': Liquid syntax error: Tag '{%- include 'parameters' -%}' was not properly terminated with regexp: /\%\}/ (Liquid::SyntaxError)
    from liquid-3.0.6/lib/liquid/tag.rb:10:in `parse'
    from liquid-3.0.6/lib/liquid/document.rb:5:in `parse'
    from liquid-3.0.6/lib/liquid/template.rb:122:in `parse'
    from liquid-3.0.6/lib/liquid/template.rb:108:in `parse'
    from generamba-1.2.2/lib/generamba/code_generation/content_generator.rb:18:in `create_file'
    from generamba-1.2.2/lib/generamba/module_generator.rb:79:in `block in process_files_if_needed'
    from generamba-1.2.2/lib/generamba/module_generator.rb:62:in `each'
    from generamba-1.2.2/lib/generamba/module_generator.rb:62:in `process_files_if_needed'
    from generamba-1.2.2/lib/generamba/module_generator.rb:22:in `generate_module'
    from generamba-1.2.2/lib/generamba/cli/gen_command.rb:72:in `gen'
    from thor-0.19.1/lib/thor/command.rb:27:in `run'
    from thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from thor-0.19.1/lib/thor/base.rb:440:in `start'
    from generamba-1.2.2/bin/generamba:5:in `<top (required)>'
    from /Users/maksim.bazarov/.rbenv/versions/2.3.1/bin/generamba:23:in `load'
    from /Users/maksim.bazarov/.rbenv/versions/2.3.1/bin/generamba:23:in `<main>'```
MaximBazarov commented 8 years ago

might be more informative

block.rb:41:in `parse': Liquid syntax error: Tag '{%- include 'parameters' -%}' was not properly terminated with regexp: /\%\}/ (Liquid::SyntaxError)
MaximBazarov commented 8 years ago

and

{% include 'parameters' -%}' 

works fine

etolstoy commented 8 years ago

@MaksimBazarov looks like the problem is in liquid gem^ your tag doesn't pass their built-in regexp. Try to post the issue in their tracker.

MaximBazarov commented 8 years ago

Whitespace control tags were added in Liquid 4 and are not available in version 3. https://github.com/Shopify/liquid/issues/807#issuecomment-252236338

@etolstoy could you please update the liquid gem?

etolstoy commented 8 years ago

Version 4 is not stable yet, so I'd better wait for its release.

etolstoy commented 8 years ago

As @fw42 says in this issue, the 4.0 version will be released really soon.

Closing this issue and creating new one (#167).