lib/tree_html.rb in tree_html-0.1.1 vs lib/tree_html.rb in tree_html-0.1.2

- old
+ new

@@ -3,18 +3,18 @@ module TreeHtml def tree_html "<ul class='tree-html'>#{li}</ul>" end - def tree_html_full custom_css='' - "<!DOCTYPE HTML><html><head><meta charset='utf-8'/><style>#{css(custom_css)}</style></head><body>#{tree_html}</body></html>" + def tree_html_full + "<!DOCTYPE HTML><html><head><meta charset='utf-8'/><style>#{css + css_for_tree_html}</style></head><body>#{tree_html}</body></html>" end Css = File.expand_path('../tree_html/tree_html.css', __FILE__) - def css addition='' - File.read(Css) + addition + def css + File.read(Css) end protected def li @@ -25,7 +25,11 @@ children_for_tree_html.empty? ? "<label class='placeholder'></label>" : "<input type='checkbox' id='#{object_id}'><label for='#{object_id}'></label>" end def sub_ul children_for_tree_html.empty? ? '' : "<ul>#{children_for_tree_html.map{|c| c.li}.join}</ul>" + end + + def css_for_tree_html + '' end end