Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'origin/pull/111/head'

  • Loading branch information...
commit a4fad60ac6b064447324528cac81013154166ea6 2 parents 64b93fa + 27a557c
@schacon schacon authored
View
8 app/helpers/application_helper.rb
@@ -13,7 +13,7 @@ def partial(part)
end
def random_tagline
- "<em>--</em>#{TAGLINES.sample}"
+ content_tag(:em, '-' * 2) + TAGLINES.sample
end
def latest_version
@@ -32,8 +32,8 @@ def latest_relnote_url
# overriding this because we're not using asset pipeline for images,
# but jason is using image_tag
- def image_tag(image)
- raw "<img src=\"/images/" + image + "\"/>"
- end
+ #def image_tag(image)
+ # raw "<img src=\"/images/" + image + "\"/>"
+ #end
end
View
5 app/helpers/doc_helper.rb
@@ -1,10 +1,13 @@
module DocHelper
+
def man(name)
- "<a href=\"/docs/#{name}\">#{name.gsub('git-', '')}</a>".html_safe
+ link_to name.gsub('git-', ''), doc_file_path(name)
end
+
def linkify(content, section)
next_page = section.next_slug
prev_page = section.prev_slug
content.gsub('[[nav-next]]', next_page).gsub('[[nav-prev]]', prev_page)
end
+
end
View
61 app/helpers/site_helper.rb
@@ -1,4 +1,5 @@
module SiteHelper
+
def highlight_no_html(high)
strip_tags(high.to_s)
.gsub('[highlight]', '<span class="highlight">')
@@ -8,30 +9,29 @@ def highlight_no_html(high)
def rchart(title, data, extra = nil)
git = data[0][1]
svn = data[1][1]
- out = "<tr>"
- out += "<td nowrap>#{title}</td>"
- out += "<td class='desc'>#{extra}</td>"
- out += "<td class='number'>#{sprintf("%5.2f", git)}</td>"
- out += "<td class='number'>#{sprintf("%5.2f", svn)}</td>"
- out += "<td class='number'>#{(svn / git).floor}x</td>"
- out += "</tr>"
+ content_tag :tr do
+ content_tag(:td, title, :nowrap => true) +
+ content_tag(:td, extra, :class => 'desc') +
+ content_tag(:td, sprintf("%5.2f", git), :class => "number") +
+ content_tag(:td, sprintf("%5.2f", svn), :class => "number") +
+ content_tag(:td, "#{(svn/git).floor}x", :class => "number")
+ end
end
def trchart(title, data, extra = nil)
git = data[1][1]
git2 = data[0][1]
svn = data[2][1]
- out = "<tr>"
- out += "<td nowrap>#{title}</td>"
- out += "<td class='desc'>#{extra}</td>"
- if git2
- out += "<td class='number'>#{sprintf("%5.1f", git2)}</td>"
- else
- out += "<td></td>"
+
+ content_tag :tr do
+ content = content_tag(:td, title, :nowrap => true) + content_tag(:td, extra, :class => 'desc')
+ if git2
+ content += content_tag(:td, sprintf("%5.1f", git2), :class => 'number')
+ else
+ content += content_tag(:td)
+ end
+ content + content_tag(:td, sprintf("%5.1f", git)) + content_tag(:td, sprintf("%5.1f", svn))
end
- out += "<td class='number'>#{sprintf("%5.1f", git)}</td>"
- out += "<td class='number'>#{sprintf("%5.1f", svn)}</td>"
- out += "</tr>"
end
@@ -43,21 +43,22 @@ def gchart(title, data)
l = labels.join('|')
scale = vals.max
- c = "<img src=\"http://chart.apis.google.com/chart?"
- c += "chxt=x" + "&amp;"
- c += "cht=bvs" + "&amp;"
- c += "chl=#{l}" + "&amp;"
- c += "chd=t:#{v}" + "&amp;"
- c += "chds=0,#{scale}" + "&amp;"
- c += "chs=100x125" + "&amp;"
+ chart_url = "http://chart.apis.google.com/chart?"
+ chart_url += "chxt=x" + "&amp;"
+ chart_url += "cht=bvs" + "&amp;"
+ chart_url += "chl=#{l}" + "&amp;"
+ chart_url += "chd=t:#{v}" + "&amp;"
+ chart_url += "chds=0,#{scale}" + "&amp;"
+ chart_url += "chs=100x125" + "&amp;"
if vals.size == 3
- c += "chco=E09FA0|E09FA0|E05F49" + "&amp;"
+ chart_url += "chco=E09FA0|E09FA0|E05F49" + "&amp;"
else
- c += "chco=E09FA0|E05F49" + "&amp;"
+ chart_url += "chco=E09FA0|E05F49" + "&amp;"
end
- c += "chf=bg,s,fcfcfa&"
- c += "chtt=#{title}"
- c += "\" alt=\"init benchmarks\" />"
- c
+ chart_url += "chf=bg,s,fcfcfa&"
+ chart_url += "chtt=#{CGI.escape(title)}"
+
+ image_tag(chart_url.html_safe, :alt => "init benchmarks")
end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.