Sha256: 745d635e0d5e601ba30d41bc8f801b44d7caf9343074b265c579c19119ab5d3c
Contents?: true
Size: 1.18 KB
Versions: 15
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true # This module provides methods for annotating config/routes.rb. module AnnotateRb module RouteAnnotator # This class is abstract class of classes adding and removing annotation to config/routes.rb. class RemovalProcessor < BaseProcessor # @return [String] def execute if routes_file_exist? if update "Annotations were removed from #{routes_file}." else "#{routes_file} was not changed (Annotation did not exist)." end else "#{routes_file} could not be found." end end private def generate_new_content_array(content, header_position) if header_position == :before content.shift while content.first == "" elsif header_position == :after content.pop while content.last == "" end # Make sure we end on a trailing newline. content << "" unless content.last == "" # TODO: If the user buried it in the middle, we should probably see about # TODO: preserving a single line of space between the content above and # TODO: below... content end end end end
Version data entries
15 entries across 15 versions & 1 rubygems