annotate_models 0.1.1 → 1.0.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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0596a1b376689b18bfc4c0cc9d6b2d3d02dc9d93'
|
|
4
|
+
data.tar.gz: 9fddad24d18c181a38803a258bb4c63551f31939
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 362189266f198669a086a8b0deec8c5e359fd1d4bd05da744fa4dcbd4fc4391fc4b2ad95c33fc05c0c6fc6db5ce464b9f61d75aeed8240ac30ca59f40cc489ca
|
|
7
|
+
data.tar.gz: 7598631208605d0ddbfa344bce6f5e88963c3253756aef2f77f885842eade64a8829af79bd8d548c5a7d4d8216cf8fbe71e1bb148a471736b24941f9dca896c5
|
|
@@ -88,17 +88,17 @@ module AnnotateModels
|
|
|
88
88
|
annotation << "#-#{'--' * 38}-"
|
|
89
89
|
annotation << "# #{model.name}"
|
|
90
90
|
annotation << "#"
|
|
91
|
-
annotation << sprintf("# %-#{max_column_length}s SQL Type Null Default
|
|
92
|
-
annotation << sprintf("# %s -------------------- ------- -------
|
|
93
|
-
format = "# %-#{max_column_length}s %-20s %-7s %-7s %-
|
|
91
|
+
annotation << sprintf("# %-#{max_column_length}s SQL Type Null Primary Default", "Name")
|
|
92
|
+
annotation << sprintf("# %s -------------------- ------- ------- ----------", "-" * max_column_length)
|
|
93
|
+
format = "# %-#{max_column_length}s %-20s %-7s %-7s %-10s"
|
|
94
94
|
model.columns.each do |column|
|
|
95
95
|
annotation << sprintf(
|
|
96
96
|
format,
|
|
97
97
|
column.name,
|
|
98
98
|
column.sql_type,
|
|
99
99
|
column.null,
|
|
100
|
-
|
|
101
|
-
column.
|
|
100
|
+
column.name == model.primary_key,
|
|
101
|
+
(column.default || "")
|
|
102
102
|
)
|
|
103
103
|
end
|
|
104
104
|
annotation << "#"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: annotate_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Brazil
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: yard
|
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
59
59
|
version: '0'
|
|
60
60
|
requirements: []
|
|
61
61
|
rubyforge_project:
|
|
62
|
-
rubygems_version: 2.
|
|
62
|
+
rubygems_version: 2.6.14.1
|
|
63
63
|
signing_key:
|
|
64
64
|
specification_version: 4
|
|
65
65
|
summary: Simple gem that adds several rake tasks to annotate Rails source files with
|