lib/view.rb in inqlude-0.0.7 vs lib/view.rb in inqlude-0.0.8

- old
+ new

@@ -33,10 +33,11 @@ system "cp #{view_dir}/public/* #{output_dir}/public/" @root = "" render_template "index", output_dir + render_template "edge", output_dir render_template "about", output_dir render_template "get", output_dir render_template "contribute", output_dir render_template "search", output_dir @@ -113,21 +114,39 @@ entries = Array.new attr.each do |a| entries.push markup_email( a ) end - - out = "<p>" + if attr.size > 1 - out += label + ": " + entries.join(", ") + return list_attribute_content label, entries.join(", ") else - out += label[0..-2] + ": " + entries.first + return list_attribute_content label[0..-2], entries.first end - out += "</p>" - + end + + def list_attribute_content label, value + out = "<div class='attribute'>" + out += " <div class='label'>" + label + ":" + "</div>" + out += " <div class='value'>" + value + "</div>" + out += "</div>" out end + + def version_content + out = @manifest["version"] + out += " (#{@manifest["maturity"]})" + out += "<span class='release-date'>" + out += "released on #{@manifest["release_date"]}" + out += "</span>" + if !old_versions.empty? + out += "<span class='old-versions'>" + out += "(older versions: #{old_versions.join(", ")})" + out += "</span>" + end + out + end def markup_email email if email =~ /(.*) <(.*)>/ name = $1 email = $2 @@ -158,14 +177,14 @@ end end out end - def libraries - if @manifest_handler.libraries.empty? + def libraries maturity = nil + if @manifest_handler.libraries(maturity).empty? @manifest_handler.read_remote end - @manifest_handler.libraries + @manifest_handler.libraries(maturity) end def disqus_enabled? @enable_disqus end