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 +4 -4
- data/lib/annotated/annotate_models.rb +14 -3
- data/lib/annotated/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abc33bac0c847ff74dbae63e78eb4632809de6388292bcbc1df17b74e4908b36
|
|
4
|
+
data.tar.gz: 44353f2817ee3db7b43751c23334caf5414d44b1734e6b3b949c3f6d7ae16511
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
47
|
-
#
|
|
48
|
-
|
|
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
|
|
data/lib/annotated/version.rb
CHANGED