GithubHelp home page GithubHelp logo

kwatch / erubis Goto Github PK

View Code? Open in Web Editor NEW
63.0 4.0 62.0 946 KB

Erubis is an fast and extensible eRuby implementation

Home Page: http://www.kuwata-lab.com/erubis/

License: MIT License

Java 0.77% Ruby 99.23%

erubis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

erubis's Issues

ERB tags nested in escaped blocks are skipped

Hello,

I'm importing a ticket from Rails: rails/rails#18098

Please find @rafaelfranca's comment (rails/rails#18098 (comment)) for a repro example.


It seems that ERB doesn't handle well tags embedded within another tag. My goal is to produce ERB code with some values prefilled in the first pass.

Input ERB code:

    <div>
        <%%= Results: <%= 'first' %> | <%= 'second' %> | <%= 'third' %> %>
    </div>

Produces the following output:

    <div>
        <%= Results: <%= 'first' %> | second | third %>
    </div>

Expected output is:

    <div>
        <%= Results: first | second | third %>
    </div>

The first nested ERB tag is skipped. The same happens when there is just one block nested.

This is reproducible in Rails v4.1.8, which is using Erubis v2.7.0.

Remove version logging

Dear @kwatch,

Thank you for maintaining erubis. I have a tiny request: would you remove the Erubis version logging on boot? It is only logged on Rails 2.2+, and it clutters the output (especially when running tests in parallel).

I would happily provide a pull request if you agree to this change.

Best regards
/codener

reentrancy (invoking erubis from template) currupts the output of the outer invocation

require 'erubis'
require 'erb'

def inner_erubis
  Erubis::Eruby.new('inner_template <%= "ruby_output" %> inner_template').result
  'ruby_output'
end


def inner_erb
  Erubis::Eruby.new('inner_template <%= "ruby_output" %> inner_template').result
  'ruby_output'
end

puts ERB.new('outer_template <%= inner_erb %> outer_template').result # outer_template ruby_output outer_template
puts Erubis::Eruby.new('outer_template <%= inner_erubis %> outer_template').result # inner_template ruby_output inner_template outer_template

Co-maintainer?

Good day @kwatch ,

erubis is a dependency of Rails 3, 4, 5.0 [1][2][3]
When we install the Rails, erubis is used.

However when we install rails5.1, erubi is used instead of erubis [4][5]
erubi is a fork version of erubis.

But I think that we still need to maintain erubis for the users to use Rails 3, 4, 5.0.
So, I think that it's time to add co-maintainer newly.

Are there any people who are happy to maintain this?

I am happy to be maintainer of erubis.
I want to merge current PRs to fix tests for Rubies, and improve the development environment running Travis CI.

[1] https://github.com/junaruga/rails-install-tester/blob/master/rails/3.2.22.5/bundle_list.txt#L11
[2] https://github.com/junaruga/rails-install-tester/blob/master/rails/4.2.8/bundle_list.txt#L13
[3] https://github.com/junaruga/rails-install-tester/blob/master/rails/5.0.2/bundle_list.txt#L14
[4] https://rubygems.org/gems/erubi
[5] https://github.com/junaruga/rails-install-tester/blob/master/rails/5.1.0.rc1/bundle_list.txt#L14

Documentation and support for <% foo -%>?

ERB has the whitespace / newline suppression feature, but I have not seen newline suppression of <% foo %> in mentioned in Erubis documentation anywhere. I've also tried it out with no luck. Is this by design?

Licence missing in the rubygems version and in the gemspec

The "erubis" gem seems not to have a license at all. Unless a license that specifies otherwise is included, nobody else can use, copy, distribute, or modify that library without being at risk of take-downs, shake-downs, or litigation.

I know, that this gem has a license on github, however it's missing one at rubygems and in a gemspec.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.