Module: Ribbonit::ViewHelpers

Defined in:
lib/ribbonit/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#branch_nameObject



7
8
9
# File 'lib/ribbonit/view_helpers.rb', line 7

def branch_name
  `git rev-parse --abbrev-ref HEAD`.gsub('feature/', '')
end

#line_countObject



11
12
13
14
15
16
17
18
# File 'lib/ribbonit/view_helpers.rb', line 11

def line_count
  height = 1
  items = configuration.infos_to_display
  height += 1 if items.include?(:ruby_version) || items.include?(:rails_version)
  height += 1 if items.include?(:git_branch)
  height += 1 if configuration.extra_content.present?
  height
end

#ribbonitObject



3
4
5
# File 'lib/ribbonit/view_helpers.rb', line 3

def ribbonit
  render 'ribbon'
end