annotaterb 4.11.0 → 4.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8ac4fa020d2d3a8980738eea31e2166be78fe5bbdf194b9198fef2d63cc0c08
4
- data.tar.gz: 51ee76fd8ff66837b7dd4e9b565e0656e3204203f0a5ea99c990e9611662c2d0
3
+ metadata.gz: 7adb0604dd67e60d6658add880eeee01a0367c86f9f0088f557fcb6ab42605c6
4
+ data.tar.gz: faa6374c64ffb979d1690c896cc564c526a6641b2fd79adc8bc922fad2fb25c0
5
5
  SHA512:
6
- metadata.gz: df8b18d6ed8398fac4768ca5686e318811407e54992711b9712cf4cba51ce5b798087df674ecb9a99d051bc3ab30daee84b4cde27a6eb9881626de9d7b0a6f94
7
- data.tar.gz: 8ace009c0f5bcc692661b441dd82e3c673818e7854513baadbe5e3c83c1554dd2b941501fbce5519ef6d29929c2771284efc737de7ece49f434bd90e6cdf8129
6
+ metadata.gz: 6250eab94f83dd0c3a40d670ad6a151532199d0183f6d13893775094e5581f6bf2513205b04f29034f0c35c8a1e0c34911a964efcb2c3104cfde0c2d6af0c1d0
7
+ data.tar.gz: 39210bfcf75338adf0a0bc88b31720427ed28b2679abed39ee4aa7b2500b88a170665a330a4f709a6c08f1e9d8e628c553502a4143bf4ea5be5eb96e464ebb61
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.12.0](https://github.com/drwl/annotaterb/tree/v4.12.0) (2024-09-15)
4
+
5
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.11.0...v4.12.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Bump version to v4.12.0 [\#151](https://github.com/drwl/annotaterb/pull/151) ([drwl](https://github.com/drwl))
10
+ - Support postgres NULLS NOT DISTINCT clause in unique index [\#148](https://github.com/drwl/annotaterb/pull/148) ([ENewmeration](https://github.com/ENewmeration))
11
+ - Generate changelog for v4.11.0 [\#147](https://github.com/drwl/annotaterb/pull/147) ([drwl](https://github.com/drwl))
12
+
13
+ ## [v4.11.0](https://github.com/drwl/annotaterb/tree/v4.11.0) (2024-08-16)
14
+
15
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.2...v4.11.0)
16
+
17
+ **Closed issues:**
18
+
19
+ - Include the length of comments in max\_schema\_info\_width only when the with\_column\_comments option is true. [\#144](https://github.com/drwl/annotaterb/issues/144)
20
+ - Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotaterb/issues/130)
21
+
22
+ **Merged pull requests:**
23
+
24
+ - Bump version to v4.11.0 [\#146](https://github.com/drwl/annotaterb/pull/146) ([drwl](https://github.com/drwl))
25
+ - Include the length of comments in max\_schema\_info\_width only when the with\_comment and with\_column\_comments option is true. [\#145](https://github.com/drwl/annotaterb/pull/145) ([shibaaaa](https://github.com/shibaaaa))
26
+ - Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotaterb/pull/143) ([drwl](https://github.com/drwl))
27
+ - Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotaterb/pull/142) ([drwl](https://github.com/drwl))
28
+
3
29
  ## [v4.10.2](https://github.com/drwl/annotaterb/tree/v4.10.2) (2024-07-23)
4
30
 
5
31
  [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.1...v4.10.2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.11.0
1
+ 4.13.0
@@ -20,7 +20,7 @@ module AnnotateRb
20
20
 
21
21
  new_annotation = wrapped_content(@new_annotations)
22
22
 
23
- _content = @file_content.sub(@parsed_file.annotations, new_annotation)
23
+ _content = @file_content.sub(@parsed_file.annotations) { new_annotation }
24
24
  end
25
25
 
26
26
  private
@@ -40,7 +40,14 @@ module AnnotateRb
40
40
  def parse_yml
41
41
  # https://docs.ruby-lang.org/en/master/Psych.html#module-Psych-label-Reading+to+Psych-3A-3ANodes-3A-3AStream+structure
42
42
  parser = Psych.parser
43
- parser.parse(@input)
43
+ begin
44
+ parser.parse(@input)
45
+ rescue Psych::SyntaxError => _e
46
+ # "Dynamic fixtures with ERB" exist in Rails, and will cause Psych.parser to error
47
+ # This is a hacky solution to get around this and still have it parse
48
+ erb_yml = ERB.new(@input).result
49
+ parser.parse(erb_yml)
50
+ end
44
51
 
45
52
  stream = parser.handler.root
46
53
 
@@ -14,6 +14,12 @@ module AnnotateRb
14
14
  def to_default
15
15
  unique_info = index.unique ? " UNIQUE" : ""
16
16
 
17
+ nulls_not_distinct_info = if index.try(:nulls_not_distinct)
18
+ " NULLS NOT DISTINCT"
19
+ else
20
+ ""
21
+ end
22
+
17
23
  value = index.try(:where).try(:to_s)
18
24
  where_info = if value.present?
19
25
  " WHERE #{value}"
@@ -30,10 +36,11 @@ module AnnotateRb
30
36
 
31
37
  # standard:disable Lint/FormatParameterMismatch
32
38
  sprintf(
33
- "# %-#{max_size}.#{max_size}s %s%s%s%s",
39
+ "# %-#{max_size}.#{max_size}s %s%s%s%s%s",
34
40
  index.name,
35
41
  "(#{columns_info.join(",")})",
36
42
  unique_info,
43
+ nulls_not_distinct_info,
37
44
  where_info,
38
45
  using_info
39
46
  ).rstrip
@@ -43,6 +50,12 @@ module AnnotateRb
43
50
  def to_markdown
44
51
  unique_info = index.unique ? " _unique_" : ""
45
52
 
53
+ nulls_not_distinct_info = if index.try(:nulls_not_distinct)
54
+ " _nulls_not_distinct_"
55
+ else
56
+ ""
57
+ end
58
+
46
59
  value = index.try(:where).try(:to_s)
47
60
  where_info = if value.present?
48
61
  " _where_ #{value}"
@@ -58,8 +71,9 @@ module AnnotateRb
58
71
  end
59
72
 
60
73
  details = sprintf(
61
- "%s%s%s",
74
+ "%s%s%s%s",
62
75
  unique_info,
76
+ nulls_not_distinct_info,
63
77
  where_info,
64
78
  using_info
65
79
  ).strip
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew W. Lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-16 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Annotates Rails/ActiveRecord Models, routes, fixtures, and others based
14
14
  on the database schema.