ld 0.2.12 → 0.2.13

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: 943882473a9692a4d7f2d4b252a265fc2be5ecf1
4
- data.tar.gz: 84628f8a632eef44e823054c2e7b787fd61ba974
3
+ metadata.gz: fd4feb768f39bd1e6376e8bb3e5d2dae0490c9c3
4
+ data.tar.gz: ac92f9960df452e9b5a879c602b4f6c15651aeca
5
5
  SHA512:
6
- metadata.gz: 3dd9a46b132a984271cdffa46fbeae3ca1c30d2d7d5987d06c2cf60dee8d0a07dd83a5179648bac6ae37b8147222004b13f945b0bc8a4566b45a6df33604620e
7
- data.tar.gz: 67fb81e856dd560aa0fbdec6893458d12ca0e63d75878169602a871778d5807b05bf0fe63187d7955b209eee4d50c2f402a8b145b3cee6a3bfb6763bb2e01837
6
+ metadata.gz: d82fa893037b844d171dff611e2d63471997d08ecc989948c4f6f8dcf486161bde4438abb5db725a3b6d71177a2fae314782bc8c5ca2c46918cb4c41896331f1
7
+ data.tar.gz: 6ac1d29b40385497a02ea8f1617f0ca9a4c4097a64b5b62df700171b78b6171d2e23c1587e49937865ae20d880cdacfd32b176f6a748f233a4c2a04be152fe2d
@@ -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文件缺失\n请运行命令(rake db:schema:dump)或手动添加此文件" if @schema.nil?
10
- @tables = Ld::Tables.new @root, nil
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
@@ -2,10 +2,9 @@ class Ld::Tables
2
2
 
3
3
  attr_accessor :headings, :rows, :tables
4
4
 
5
- def initialize root, models, schema
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
@@ -1,3 +1,3 @@
1
1
  module Ld
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ld
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Dong