Class: Gem::Release::Helper::Wrapper

Inherits:
Struct
  • Object
show all
Defined in:
lib/gem/release/helper/string.rb

Constant Summary collapse

MARKDOWN =
/^(```|\*|-)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#strObject

Returns the value of attribute str

Returns:

  • (Object)

    the current value of str



4
5
6
# File 'lib/gem/release/helper/string.rb', line 4

def str
  @str
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



4
5
6
# File 'lib/gem/release/helper/string.rb', line 4

def width
  @width
end

Instance Method Details

#applyObject



7
8
9
10
# File 'lib/gem/release/helper/string.rb', line 7

def apply
  paras = str.split("\n\n")
  paras.map { |para| wrap_paragraph(para) }.join("\n\n")
end