Hi everybody,
I would like to use ruby2ruby in a caming project, but there seems to
be an incompatibility with camping, ruby2ruby and markaby.
Unfortunately I receive strange Markaby::InvalidXhtmlErrors.
To demonstrate, that only combination of all three components causes
the problem I added the following code. I relies on Markaby and
ruby2ruby only and works fine (a.k.a. as expected).
require "rubygems"
require "ruby2ruby"
require "markaby"
def example(&block)
$mab.pre( block.to_ruby.gsub(/^proc \{\n(.*)\n\}$/m, '\1'))
end
Markaby::Builder.set(:indent, 2)
$mab = Markaby::Builder.new
$mab.xhtml_strict do
div.literate_markaby! do
example do
1 + 1 == 2
end
end
end
puts $mab.to_s
When I wrap that up in a camping project, which looks the following, I
get an error, when using tag! with arguments.
The Code:
require "rubygems"
require "ruby2ruby"
Camping.goes :Test
module Test
module Controllers
class Index < R '/'
def get
div.literate_programming! do
example { 1 + 1 == 2 }
end
end
end
end
module Helpers
def example(&block)
pre( block.to_ruby.gsub(/^proc \{\n(.*)\n\}$/m, '\1'))
end
end
end
It raises "Markaby::InvalidXhtmlError no attribute `href' on div
elements:" in the line "div.literate_programming! do" . If I change it
to "div do" it works okay. Also every other way of providing arguments
raises the error (div.class_name, div(:rel => "options"), ...).
I don't know where the :href attribute comes from and I don't know,
why it only appears within camping and not in markaby itself.
Any help would be appreciated. Thanks in advance.
Cheers,
Gregor
Note: I'm using the latest release of camping (1.5.180), markaby (0.5)
and ruby2ruby (1.1.7)
_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list