diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-04-20 13:04:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 13:04:09 -0400 |
commit | 5fd7ac79a10dc09f2394b69fed2311c35c81d623 (patch) | |
tree | 026949382b0b4ebcd6805fc328990c8488f7d329 /railties/lib/rails | |
parent | e3e7821981a2624969c495b1c7e1dc7a139aec72 (diff) | |
parent | cc1ae52cfb5e2ca04cfc6c9c30de2205f72c05f3 (diff) | |
download | rails-5fd7ac79a10dc09f2394b69fed2311c35c81d623.tar.gz rails-5fd7ac79a10dc09f2394b69fed2311c35c81d623.tar.bz2 rails-5fd7ac79a10dc09f2394b69fed2311c35c81d623.zip |
Merge pull request #32403 from albertoalmagro/improve-source-annotation-comments
[ci skip] Improve Rails::SourceAnnotationExtractor documentation
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/source_annotation_extractor.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index 73bee5bcbf..7257aaeaae 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -29,7 +29,7 @@ module Rails end # Registers additional directories to be included - # SourceAnnotationExtractor::Annotation.register_directories("spec", "another") + # Rails::SourceAnnotationExtractor::Annotation.register_directories("spec", "another") def self.register_directories(*dirs) directories.push(*dirs) end @@ -39,7 +39,7 @@ module Rails end # Registers new Annotations File Extensions - # SourceAnnotationExtractor::Annotation.register_extensions("css", "scss", "sass", "less", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ } + # Rails::SourceAnnotationExtractor::Annotation.register_extensions("css", "scss", "sass", "less", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ } def self.register_extensions(*exts, &block) extensions[/\.(#{exts.join("|")})$/] = block end @@ -69,7 +69,7 @@ module Rails # # Directories may also be explicitly set using the <tt>:dirs</tt> key in +options+. # - # SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true + # Rails::SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true # # If +options+ has a <tt>:tag</tt> flag, it will be passed to each annotation's +to_s+. # @@ -95,9 +95,9 @@ module Rails end # Returns a hash that maps filenames under +dir+ (recursively) to arrays - # with their annotations. Only files with annotations are included. Files - # with extension +.builder+, +.rb+, +.rake+, +.yml+, +.yaml+, +.ruby+, - # +.css+, +.js+ and +.erb+ are taken into account. + # with their annotations. Files with extensions registered in + # <tt>Rails::SourceAnnotationExtractor::Annotation.extensions</tt> are + # taken into account. Only files with annotations are included. def find_in(dir) results = {} |