ld 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ld/project/project.rb +3 -2
- data/lib/ld/project/tables.rb +2 -3
- data/lib/ld/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4feb768f39bd1e6376e8bb3e5d2dae0490c9c3
|
4
|
+
data.tar.gz: ac92f9960df452e9b5a879c602b4f6c15651aeca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82fa893037b844d171dff611e2d63471997d08ecc989948c4f6f8dcf486161bde4438abb5db725a3b6d71177a2fae314782bc8c5ca2c46918cb4c41896331f1
|
7
|
+
data.tar.gz: 6ac1d29b40385497a02ea8f1617f0ca9a4c4097a64b5b62df700171b78b6171d2e23c1587e49937865ae20d880cdacfd32b176f6a748f233a4c2a04be152fe2d
|
data/lib/ld/project/project.rb
CHANGED
@@ -6,12 +6,13 @@ class Ld::Project
|
|
6
6
|
@root = Ld::File.new project_root_path
|
7
7
|
@table_hash = table_hash
|
8
8
|
@schema = @root.db.find('schema.rb')
|
9
|
-
raise "schema.rb
|
10
|
-
|
9
|
+
raise "schema.rb文件不存在\n请运行命令(rake db:schema:dump)或手动添加此文件" if @schema.nil?
|
10
|
+
raise "schema.rb文件没有内存\n请运行命令(rake db:schema:dump)或手动添加此文件" if @schema.lines.size == 0
|
11
11
|
parse_project
|
12
12
|
end
|
13
13
|
|
14
14
|
def parse_project
|
15
|
+
@tables = Ld::Tables.new @root, nil
|
15
16
|
@models = Ld::Models.new @root, @tables, @table_hash
|
16
17
|
@routes = Ld::Routes.new @root, @models
|
17
18
|
@tables = Ld::Tables.new @root, @models
|
data/lib/ld/project/tables.rb
CHANGED
@@ -2,10 +2,9 @@ class Ld::Tables
|
|
2
2
|
|
3
3
|
attr_accessor :headings, :rows, :tables
|
4
4
|
|
5
|
-
def initialize root, models
|
5
|
+
def initialize root, models
|
6
6
|
@root = root
|
7
7
|
@models = models
|
8
|
-
@schema = schema
|
9
8
|
parse
|
10
9
|
end
|
11
10
|
|
@@ -13,7 +12,7 @@ class Ld::Tables
|
|
13
12
|
tables = {}
|
14
13
|
read_flag = false
|
15
14
|
table = ""
|
16
|
-
@schema.lines.each do |l|
|
15
|
+
@root.db.find('schema.rb').lines.each do |l|
|
17
16
|
if l.split(' ')[0] == 'end'
|
18
17
|
read_flag = false
|
19
18
|
end
|
data/lib/ld/version.rb
CHANGED