Module: RubyBadger::ApplicationHelper
- Defined in:
- app/helpers/ruby_badger/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#git_branch_info ⇒ Object
16 17 18 |
# File 'app/helpers/ruby_badger/application_helper.rb', line 16 def git_branch_info `git rev-parse --abbrev-ref HEAD`.chomp end |
#ruby_badger(text = nil, git_info = false) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/ruby_badger/application_helper.rb', line 3 def ruby_badger(text = nil, git_info = false) content_tag :div, class: "corner-banner ruby-badger #{Rails.env}" do text = Rails.env if text.blank? if text.instance_of?(Array) text << [git_branch_info] if git_info text.join('<br/>').html_safe else text += '<br/>' << git_branch_info if git_info text.html_safe end end end |