annotated 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a73532b20ded790ea5b146164382eab09a8166eb9bfc871c1f64c90ef09f118
4
- data.tar.gz: 7b2c1c9ee04efd4dfbf1a54b42aab95efcb8073742a933c40e126bdd1a2bd1d0
3
+ metadata.gz: abc33bac0c847ff74dbae63e78eb4632809de6388292bcbc1df17b74e4908b36
4
+ data.tar.gz: 44353f2817ee3db7b43751c23334caf5414d44b1734e6b3b949c3f6d7ae16511
5
5
  SHA512:
6
- metadata.gz: 64ea8a92628eca83fbecb055eac2c7ca27bb4130ab27e9e16ba128d9650e8f09761b3bff7311bfb649dd2e81ad890ca6b47729dfe7d43db5d0a98606f77a063d
7
- data.tar.gz: 58073db39475ee25dc2bdd907fcd056e42cc8970c7d47e615501c88f92323c25b8a2f8b66df158c80ed0d9981dbefb55597ab806b94fe8c4d3fb891c7972dd7a
6
+ metadata.gz: 2f06a6ebdea4f58db98d9a4d746b968ba19b5b6f76b164d8d056688cec0618879b29323e999e541f00a5faaa0ca42031342e7391de3d0f3a55aadad1d8dfa237
7
+ data.tar.gz: 4f6a8c630f793959582703906fc604e5701151ebb7e4a8ce82cdfc90a9aff80df6269783bd3c90f2a9cb95fbff5280d2a1bc770e90f8c1d0e3854ae2baed4e51
@@ -15,6 +15,16 @@ module AnnotateModels
15
15
 
16
16
  SKIP_ANNOTATION_PREFIX = '# -\*- SkipSchemaAnnotations'.freeze
17
17
 
18
+ # A line of an annotation body in any format: a bare "#" (or rdoc's "#--" and
19
+ # "#++"), an entry indented by two spaces, a section heading, or a markdown,
20
+ # rdoc or yard column line.
21
+ ANNOTATION_LINE = /
22
+ \#(?:--|\+\+)?\R |
23
+ \#\ {2,}.*\R |
24
+ \#\ (?:Table\ name:.*|Indexes|Foreign\ Keys|Check\ Constraints|\#{3}\ .*|==\ Schema\ Information\ End)\R |
25
+ \#\ (?:Name\ +\|.*|-+\ \|.*|\*\*`.*|\*\ `.*|\*.*\*::.*|@!attribute\ .*)\R
26
+ /x
27
+
18
28
  MATCHED_TYPES = %w[test fixture factory serializer scaffold controller helper].freeze
19
29
 
20
30
  # Don't show limit (#) on these column types
@@ -43,9 +53,10 @@ module AnnotateModels
43
53
 
44
54
  class << self
45
55
  def annotate_pattern(options = {})
46
- # The annotation body runs up to its closing bare "#" (or "#++" for rdoc) line,
47
- # so comments placed directly below it (e.g. class docs) are left alone.
48
- body = /(?:(?:#.*\R)*#(?:\+\+)?\R|(?:#.*\R)*)/
56
+ # The annotation body is only the lines the annotator writes, so the first
57
+ # line of any other comment placed directly below it (e.g. class docs),
58
+ # even one with its own bare "#" paragraph breaks, ends it.
59
+ body = /(?:#{ANNOTATION_LINE})*/o
49
60
  wrapper_close = options[:wrapper_close] ? /(?:# #{options[:wrapper_close]}.*\R)?/ : //
50
61
  annotation = /\R?# (?:#{COMPAT_PREFIX}|#{COMPAT_PREFIX_MD}).*?\R#{body}#{wrapper_close}\R*/
51
62
 
@@ -1,5 +1,5 @@
1
1
  module Annotated
2
2
  def self.version
3
- "0.1.3"
3
+ "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich