Module: Squared::Repo::Project

Extended by:
Common::Format
Defined in:
lib/squared/repo/project.rb,
lib/squared/repo/project/git.rb,
lib/squared/repo/project/base.rb,
lib/squared/repo/project/node.rb,
lib/squared/repo/project/ruby.rb,
lib/squared/repo/project/python.rb

Defined Under Namespace

Classes: Base, Git, Node, Python, Ruby

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Common::Format

check_style, emphasize, log_message, log_title, sub_style

Class Attribute Details

.line_widthObject

Returns the value of attribute line_width.



9
10
11
# File 'lib/squared/repo/project.rb', line 9

def line_width
  @line_width
end

Class Method Details



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/squared/repo/project.rb', line 11

def banner(*lines, styles: nil, pad: 0, first: false)
  n = max_width(lines)
  ch = ' ' * pad
  index = -1
  out = lines.map do |val|
    index += 1
    val = ch + val.ljust(n - (pad * 2)) + ch
    if styles && (!first || index == 0)
      sub_style(val, *styles)
    else
      val
    end
  end
  out << ('-' * n)
  out.join("\n")
end


28
29
30
31
# File 'lib/squared/repo/project.rb', line 28

def footer(*lines)
  n = max_width(lines)
  ['-' * n, *lines.map { |val| val.ljust(n) }].join("\n")
end