Class: Ld::Project
- Inherits:
-
Object
- Object
- Ld::Project
- Defined in:
- lib/ld/project/project.rb
Instance Attribute Summary collapse
-
#controllers ⇒ Object
Returns the value of attribute controllers.
-
#models ⇒ Object
Returns the value of attribute models.
-
#root ⇒ Object
Returns the value of attribute root.
-
#routes ⇒ Object
Returns the value of attribute routes.
-
#tables ⇒ Object
Returns the value of attribute tables.
-
#views ⇒ Object
Returns the value of attribute views.
Instance Method Summary collapse
- #add_bug ⇒ Object
-
#initialize(path = Rails.root.to_s) ⇒ Project
constructor
A new instance of Project.
- #parse_project ⇒ Object
- #to_xls(path = "#{@root.path}/project.xls") ⇒ Object
Constructor Details
Instance Attribute Details
#controllers ⇒ Object
Returns the value of attribute controllers.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def controllers @controllers end |
#models ⇒ Object
Returns the value of attribute models.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def models @models end |
#root ⇒ Object
Returns the value of attribute root.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def root @root end |
#routes ⇒ Object
Returns the value of attribute routes.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def routes @routes end |
#tables ⇒ Object
Returns the value of attribute tables.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def tables @tables end |
#views ⇒ Object
Returns the value of attribute views.
3 4 5 |
# File 'lib/ld/project/project.rb', line 3 def views @views end |
Instance Method Details
#add_bug ⇒ Object
45 46 47 |
# File 'lib/ld/project/project.rb', line 45 def add_bug end |
#parse_project ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/ld/project/project.rb', line 10 def parse_project @tables = Ld::Tables.new @root, nil @models = Ld::Models.new @root, @tables @routes = Ld::Routes.new @root, @models @tables = Ld::Tables.new @root, @models @views = Ld::Views.new @root, @models @controllers = Ld::Controllers.new @root, @models end |
#to_xls(path = "#{@root.path}/project.xls") ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ld/project/project.rb', line 19 def to_xls path = "#{@root.path}/project.xls" Ld::Excel.create path do |excel| # sheet.set_format({color: :black, font_size: 14, font: '微软雅黑'}) excel.write_sheet 'routes' do |sheet| sheet.set_headings @routes.headings sheet.set_rows @routes.rows end excel.write_sheet 'tables' do |sheet| sheet.set_headings @tables.headings sheet.set_rows @tables.rows end excel.write_sheet 'models' do |sheet| sheet.set_headings @models.headings sheet.set_rows @models.rows end excel.write_sheet 'views' do |sheet| sheet.set_headings @views.headings sheet.set_rows @views.rows end excel.write_sheet 'controllers' do |sheet| sheet.set_headings @controllers.headings sheet.set_rows @controllers.rows end end end |