Fortitude v0.0.4 Release Notes
Release Date: 2014-06-24 // almost 10 years ago-
- ➕ Added support for building a JRuby-specific gem to the gemspec, so that things work smoothly for JRuby users. (Thanks, Ahto Jussila!)
➕ Added preliminary support for inline widget classes: if you call
.inline_subclass
on any subclass ofFortitude::Widget
and pass a block, you'll get back a new subclass of whatever class you called it on, with acontent
method defined as per the block you passed. For example:my_widget_class = Fortitude::Widgets::Html5.inline_subclass do p "hello, world!" end my_widget_class.new.to_html # => 'hello, world!'
And, similarly, if you call
.inline_html
on any subclass ofFortitude::Widget
and pass a block, you'll get back the HTML rendered by the new subclass of that class. For example:html = Fortitude::Widgets::Html5.inline_html do p "hello, world!" end html # => 'hello, world!'
Note that this will not work on
Fortitude::Widget
, becauseFortitude::Widget
has nodoctype
declared, and therefore has no HTML tags available. You can either use one of the pre-made classes inFortitude::Widgets
, or, better yet, declare your own base widget class and then use.inline_subclass
and.inline_html
on that. (Using that mechanism, you can also set things likeformat_output
,start_and_end_comments
, and even things likeneeds
, mixing in or defining helper methods, and so on, and it will all work just fine.)