Skip to content

Commit c2b1edf

Browse files
committed
Add comments to module AnnotateRoutes and nested classes
1 parent 5e9e464 commit c2b1edf

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

lib/annotate/annotate_routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
require_relative './annotate_routes/annotation_processor'
2222
require_relative './annotate_routes/removal_processor'
2323

24+
# This module provides methods for annotating config/routes.rb.
2425
module AnnotateRoutes
2526
class << self
2627
# @param options [Hash]

lib/annotate/annotate_routes/annotation_processor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
require_relative './helpers'
33
require_relative './header_generator'
44

5+
# This module provides methods for annotating config/routes.rb.
56
module AnnotateRoutes
7+
# This class provides methods for adding annotation to config/routes.rb.
68
class AnnotationProcessor < BaseProcessor
79
include Helpers
810

lib/annotate/annotate_routes/base_processor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# This module provides methods for annotating config/routes.rb.
12
module AnnotateRoutes
3+
# This class is abstract class of classes adding and removing annotation to config/routes.rb.
24
class BaseProcessor
35
class << self
46
# @param options [Hash]

lib/annotate/annotate_routes/header_generator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require_relative './helpers'
22

3+
# This module provides methods for annotating config/routes.rb.
34
module AnnotateRoutes
5+
# This class processes result of `rake routes` and generate content enbeded in config/routes.rb.
46
class HeaderGenerator
57
PREFIX = '== Route Map'.freeze
68
PREFIX_MD = '## Route Map'.freeze

lib/annotate/annotate_routes/helpers.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# This module provides methods for annotating config/routes.rb.
12
module AnnotateRoutes
3+
# This module contains methods used in multiple classes.
4+
# This module is included in AnnotationProcessor and HeaderGenerator.
25
module Helpers
36
MAGIC_COMMENT_MATCHER = Regexp.new(/(^#\s*encoding:.*)|(^# coding:.*)|(^# -\*- coding:.*)|(^# -\*- encoding\s?:.*)|(^#\s*frozen_string_literal:.+)|(^# -\*- frozen_string_literal\s*:.+-\*-)/).freeze
47

lib/annotate/annotate_routes/removal_processor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require_relative './base_processor'
22

3+
# This module provides methods for annotating config/routes.rb.
34
module AnnotateRoutes
5+
# This class provides methods for removing annotation from config/routes.rb.
46
class RemovalProcessor < BaseProcessor
57
# @return [String]
68
def execute

0 commit comments

Comments
 (0)