Sha256: b5edb8169db15e1be9bd32547b0a37ac2958010bf8ad1106fa827868bae8a467
Contents?: true
Size: 916 Bytes
Versions: 1
Compression:
Stored size: 916 Bytes
Contents
# Thanks to https://github.com/simonwhitaker/github-fork-ribbon-css require 'rack/dev-mark/theme/base' module Rack module DevMark module Theme class GithubForkRibbon < Base def initialize(options = {}) @options = options end def insert_into(html, env, revision) position = @options[:position] || 'left' color = @options[:color] || 'red' s = <<-EOS #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.css"} <!--[if lt IE 9]> #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.ie.css"} <![endif]--> <div class="github-fork-ribbon-wrapper #{position}" onClick="this.style.display='none'" title="#{revision}"><div class="github-fork-ribbon #{color}"><span class="github-fork-ribbon-text">#{env}</span></div></div> EOS html.sub %r{(<body[^>]*>)}i, "\\1#{s.strip}" end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rack-dev-mark-0.1.3 | lib/rack/dev-mark/theme/github_fork_ribbon.rb |