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

Add support for rails 3 #13

Closed
smtlaissezfaire opened this issue May 31, 2010 · 15 comments
Closed

Add support for rails 3 #13

smtlaissezfaire opened this issue May 31, 2010 · 15 comments

Comments

@smtlaissezfaire
Copy link
Contributor

No description provided.

@mattherick
Copy link

does it support rails 3 already? if not, is there a fork or other repo available? anyone an idea?

@smtlaissezfaire
Copy link
Contributor Author

I haven't hacked on this project for a while. - so there is no explicit support for it yet (although as always, patches welcome!)

Check out the garlic.rb file and https://github.com/markaby/markaby/blob/master/lib/markaby/rails.rb#L24

We should probably drop rails 1.x support and possibly even 2.x support and just get 3.x working going forward.

@judofyr
Copy link
Collaborator

judofyr commented Mar 7, 2013

I've been working on https://github.com/camping/mab/ (which is a re-implementation of Markaby). Considering adding Rails 3 support…

@smtlaissezfaire
Copy link
Contributor Author

Cool. I'd totally support it and shut this project down if we can get the test suite running there (feature parity, minus rails 1.x and 2.x support, but plus 3.x support going forward).

@mattherick
Copy link

  • 1, very cool!

@judofyr
Copy link
Collaborator

judofyr commented Mar 7, 2013

Mab isn't 100% API compatible with Markaby (e.g. Mab escaped #text, Markaby doesnt), but they're small enough that you could write a very light compat layer.

@smtlaissezfaire
Copy link
Contributor Author

Out of curiosity, why port it instead of just fixing it (aside from the escaping change)?

@judofyr
Copy link
Collaborator

judofyr commented Mar 7, 2013

The main goal of Mab (or really, Rumble) was to allow mixing it into other classes:

class Hello
  include Mab::Mixin

  def render
    mab { strong @title }
  end
end

It seemed simpler to start from scratch (it's about ~200 LoC now) than to change Markaby completely.

@smtlaissezfaire
Copy link
Contributor Author

Oh. Isn't this what the kernel method does?

https://github.com/markaby/markaby/blob/master/lib/markaby/kernel_method.rb

Couldn't we just make that into a mixin instead of adding it directly to kernel?

@smtlaissezfaire
Copy link
Contributor Author

But yeah - if it runs a lot faster I'm all for it. Markaby seems to have a lot of layers and runs pretty slowly, so as long as it's mostly compatible and has rails support I'm a go.

@judofyr
Copy link
Collaborator

judofyr commented Mar 7, 2013

@mattherick: I've pushed out a new version of Mab (0.0.3) that supports Rails. Simply require "mab" at the top of your application.rb and you should be able to use foo.html.mab-templates. Please report issues at https://github.com/camping/mab/issues if you find any bugs or have any feature requests! Mab is still very young, but I'm able to release fixes pretty quickly :-)

@mattherick
Copy link

@judofyr: Thx for the quick update!

@mattherick
Copy link

@judofyr: is your solution also ruby 1.9 compatible? If not, is it much work to get it compatible?

@judofyr
Copy link
Collaborator

judofyr commented Mar 8, 2013

Yes, it's 1.9 compatible.

@smtlaissezfaire
Copy link
Contributor Author

Closing this. @judofyr I've given you commit access. Not sure if you are still using markaby or if you are using mab. I'm starting to work on markaby again as I'm using it in a rails project.

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

No branches or pull requests

3 participants