crudboy 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/lib/crudboy/column.rb +8 -0
- data/lib/crudboy/definition.rb +2 -1
- data/lib/crudboy/template_context.rb +2 -1
- data/lib/crudboy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e345152548a12acb22ef528dd46c908f288733ec20c127ada4f35e8ef6591b7e
|
4
|
+
data.tar.gz: 4fb8c4aad59d49896acdf20024066f7bd61115ec3d8a2ff75a7a04de16d017e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e90df33803a2d7efac0d7b2ad27dd8c0c40da90a335ad007f704d3ded20798938275b1ddfe621d1fdf4f718391db197f0ec5524a8ff3708506d55ddc9941b55f
|
7
|
+
data.tar.gz: 47c355b92e41a0afc576393831bc6a8c479d96e90ccbd8003197373b183c57c509753f225330f4c79686d4959526efe48b7b7a4a49a87d986f4572ee36e177df
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
crudboy (0.1.
|
4
|
+
crudboy (0.1.5)
|
5
5
|
activerecord (>= 6.0.3, < 6.2.0)
|
6
6
|
activesupport (~> 6.0.3)
|
7
7
|
composite_primary_keys (~> 12.0.3)
|
@@ -33,13 +33,13 @@ GEM
|
|
33
33
|
coderay (1.1.3)
|
34
34
|
composite_primary_keys (12.0.10)
|
35
35
|
activerecord (~> 6.0.0)
|
36
|
-
concurrent-ruby (1.2.
|
36
|
+
concurrent-ruby (1.2.3)
|
37
37
|
i18n (1.14.1)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
39
|
method_source (1.0.0)
|
40
|
-
minitest (5.
|
41
|
-
mysql2 (0.5.
|
42
|
-
net-ssh (7.1
|
40
|
+
minitest (5.20.0)
|
41
|
+
mysql2 (0.5.4)
|
42
|
+
net-ssh (7.0.1)
|
43
43
|
net-ssh-gateway (2.0.0)
|
44
44
|
net-ssh (>= 4.0.0)
|
45
45
|
pry (0.13.1)
|
@@ -53,16 +53,16 @@ GEM
|
|
53
53
|
yard (~> 0.9.11)
|
54
54
|
rainbow (3.0.0)
|
55
55
|
rake (12.3.3)
|
56
|
-
sqlite3 (1.6.
|
56
|
+
sqlite3 (1.6.8-x86_64-darwin)
|
57
57
|
table_print (1.5.7)
|
58
58
|
terminal-table (1.8.0)
|
59
59
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
60
60
|
thread_safe (0.3.6)
|
61
|
-
tzinfo (1.2.
|
61
|
+
tzinfo (1.2.10)
|
62
62
|
thread_safe (~> 0.1)
|
63
63
|
unicode-display_width (1.8.0)
|
64
64
|
yard (0.9.34)
|
65
|
-
zeitwerk (2.6.
|
65
|
+
zeitwerk (2.6.6)
|
66
66
|
|
67
67
|
PLATFORMS
|
68
68
|
ruby
|
data/lib/crudboy/column.rb
CHANGED
@@ -5,13 +5,17 @@ module Crudboy
|
|
5
5
|
"varchar" => 'String',
|
6
6
|
"char" => 'String',
|
7
7
|
"text" => 'String',
|
8
|
+
"longtext" => 'String',
|
8
9
|
"int" => 'Integer',
|
10
|
+
"smallint" => 'Integer',
|
9
11
|
"bigint" => 'Long',
|
10
12
|
"tinyint" => 'Byte',
|
13
|
+
"double" => 'Double',
|
11
14
|
"date" => 'LocalDate',
|
12
15
|
"datetime" => 'LocalDateTime',
|
13
16
|
"timestamp" => 'LocalDateTime',
|
14
17
|
"time" => 'LocalTime',
|
18
|
+
"blob" => 'byte[]',
|
15
19
|
"decimal" => 'BigDecimal'
|
16
20
|
}
|
17
21
|
|
@@ -19,13 +23,17 @@ module Crudboy
|
|
19
23
|
"varchar" => 'VARCHAR',
|
20
24
|
"char" => 'CHAR',
|
21
25
|
"text" => 'TEXT',
|
26
|
+
"longtext" => 'LONGVARCHAR',
|
22
27
|
"int" => 'INTEGER',
|
28
|
+
"smallint" => 'INTEGER',
|
23
29
|
"bigint" => 'BIGINT',
|
24
30
|
"tinyint" => 'TINYINT',
|
31
|
+
"double" => 'DOUBLE',
|
25
32
|
"date" => 'TIMESTAMP',
|
26
33
|
"datetime" => 'TIMESTAMP',
|
27
34
|
"timestamp" => 'TIMESTAMP',
|
28
35
|
"time" => 'TIME',
|
36
|
+
"blob" => 'BLOB',
|
29
37
|
"decimal" => 'DECIMAL'
|
30
38
|
}
|
31
39
|
|
data/lib/crudboy/definition.rb
CHANGED
@@ -59,7 +59,7 @@ module Crudboy
|
|
59
59
|
|
60
60
|
class Definition
|
61
61
|
|
62
|
-
attr_accessor :table_name, :model, :model_name
|
62
|
+
attr_accessor :table_name, :model, :model_name, :table_comment
|
63
63
|
|
64
64
|
def initialize(options)
|
65
65
|
@@options = options
|
@@ -74,6 +74,7 @@ module Crudboy
|
|
74
74
|
raise "Table not exist: #{@table_name}" unless conn.tables.include?(@table_name)
|
75
75
|
|
76
76
|
table_comment = conn.table_comment(@table_name)
|
77
|
+
@table_comment = table_comment
|
77
78
|
conn.primary_key(@table_name).tap do |pkey|
|
78
79
|
Class.new(::CrudboyModel) do
|
79
80
|
include Crudboy::Extension
|
@@ -3,12 +3,13 @@ module Crudboy
|
|
3
3
|
|
4
4
|
include Helper
|
5
5
|
|
6
|
-
attr_accessor :model, :columns, :table_name, :model_name, :bundle_options
|
6
|
+
attr_accessor :model, :columns, :table_name, :table_comment, :model_name, :bundle_options
|
7
7
|
|
8
8
|
def initialize(definition)
|
9
9
|
@model = definition.model
|
10
10
|
@model_name = definition.model_name
|
11
11
|
@table_name = definition.table_name
|
12
|
+
@table_comment = definition.table_comment
|
12
13
|
@columns = @model.columns
|
13
14
|
end
|
14
15
|
|
data/lib/crudboy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crudboy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|