Parent

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::LineEndConcatenation

This cop checks for string literal concatenation at the end of a line.

@example

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Constants

MSG

Public Instance Methods

autocorrect(node) click to toggle source
# File lib/rubocop/cop/style/line_end_concatenation.rb, line 28
def autocorrect(node)
  @corrections << lambda do |corrector|
    # replace + with \
    corrector.replace(node.loc.selector, '\')
  end
end
on_send(node) click to toggle source
# File lib/rubocop/cop/style/line_end_concatenation.rb, line 24
def on_send(node)
  add_offense(node, :selector) if offending_node?(node)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.