annotaterb 4.10.2 → 4.12.0

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: a5dbaac7f2e0a75991b8d45ab6fdc6cd3de88493e045c9fdc166b86154d99054
4
- data.tar.gz: 9902039f9f2a7a19e77201de2a197eb3f015effb9a7b59a108601d4d355227e6
3
+ metadata.gz: acf04a7f1c6244fa950273cc78bb159e3f25e1e1f8f154ebb5a668152672f28d
4
+ data.tar.gz: 67466b09b7efa8ad90d2b674228c60b368c475b8809a5af7f0c9c48f1bfa3938
5
5
  SHA512:
6
- metadata.gz: 4e7d023754cdc71278b597fcd8010deb199c776835953c0bcf39fb5371088cf38b565da58ff6942fc51a88a218512bbe7297aeb9dfe32776fa2fc36ac8b44601
7
- data.tar.gz: 4c14de66314768ac83dcbd275e56f8627c5ecd82f10da63595c23bbd31c7a5cdb4318a6075f3f98787edf3a319ed7d22dc260b8b5aa70527de93fb7e62b9d53f
6
+ metadata.gz: 76fcd6ffe70e014b15a4aab9b8e5f838432281cf7836eb83532a17f3f13c0e70381ea20bcec185efd91816df6eed64ae25d9541403c1aa0e3bb94b7970846f5b
7
+ data.tar.gz: 311ccf2c9013fe16ee0b70a693f9c1c478b4ab1543b6f8fdc3baf3fb0b4c9f8840e45d98236d2b634b80e3cadc1b33bb77f92a77f118828e92319292a85d8845
data/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.11.0](https://github.com/drwl/annotaterb/tree/v4.11.0) (2024-08-16)
4
+
5
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.2...v4.11.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - 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)
10
+ - Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotaterb/issues/130)
11
+
12
+ **Merged pull requests:**
13
+
14
+ - Bump version to v4.11.0 [\#146](https://github.com/drwl/annotaterb/pull/146) ([drwl](https://github.com/drwl))
15
+ - 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))
16
+ - Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotaterb/pull/143) ([drwl](https://github.com/drwl))
17
+ - Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotaterb/pull/142) ([drwl](https://github.com/drwl))
18
+
19
+ ## [v4.10.2](https://github.com/drwl/annotaterb/tree/v4.10.2) (2024-07-23)
20
+
21
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.1...v4.10.2)
22
+
23
+ **Closed issues:**
24
+
25
+ - Composite primary keys are unsupported [\#138](https://github.com/drwl/annotaterb/issues/138)
26
+
27
+ **Merged pull requests:**
28
+
29
+ - Bump version to v4.10.2 [\#141](https://github.com/drwl/annotaterb/pull/141) ([drwl](https://github.com/drwl))
30
+ - Fix double-loading of Rakefile [\#140](https://github.com/drwl/annotaterb/pull/140) ([dmke](https://github.com/dmke))
31
+ - Change structure of model annotation builder [\#136](https://github.com/drwl/annotaterb/pull/136) ([drwl](https://github.com/drwl))
32
+ - Refactor model annotation components [\#134](https://github.com/drwl/annotaterb/pull/134) ([drwl](https://github.com/drwl))
33
+ - Generate changelog for v4.10.1 [\#133](https://github.com/drwl/annotaterb/pull/133) ([drwl](https://github.com/drwl))
34
+
3
35
  ## [v4.10.1](https://github.com/drwl/annotaterb/tree/v4.10.1) (2024-07-07)
4
36
 
5
37
  [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.0...v4.10.1)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.10.2
1
+ 4.12.0
@@ -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
@@ -128,7 +128,12 @@ module AnnotateRb
128
128
  end
129
129
 
130
130
  def with_comments?
131
- @with_comments ||= raw_columns.first.respond_to?(:comment) &&
131
+ return @with_comments if instance_variable_defined?(:@with_comments)
132
+
133
+ @with_comments =
134
+ @options[:with_comment] &&
135
+ @options[:with_column_comments] &&
136
+ raw_columns.first.respond_to?(:comment) &&
132
137
  raw_columns.map(&:comment).any? { |comment| !comment.nil? }
133
138
  end
134
139
 
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.10.2
4
+ version: 4.12.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-07-23 00:00:00.000000000 Z
11
+ date: 2024-09-15 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.
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.5.6
139
+ rubygems_version: 3.5.11
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: A gem for generating annotations for Rails projects.