Class: Dependency::ExcelGenerator
- Inherits:
-
Object
- Object
- Dependency::ExcelGenerator
- Defined in:
- lib/cocoapods-dependency-graph/generator/excel_generator.rb
Instance Attribute Summary collapse
-
#workbook ⇒ Object
Returns the value of attribute workbook.
-
#worksheet ⇒ Object
Returns the value of attribute worksheet.
Instance Method Summary collapse
- #close_excel ⇒ Object
- #create_content(specs) ⇒ Object
- #create_excel ⇒ Object
- #create_row(spec) ⇒ Object
- #create_title ⇒ Object
- #generate(umbrella_target, module_spec_hash) ⇒ Object
Instance Attribute Details
#workbook ⇒ Object
Returns the value of attribute workbook.
5 6 7 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 5 def workbook @workbook end |
#worksheet ⇒ Object
Returns the value of attribute worksheet.
6 7 8 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 6 def worksheet @worksheet end |
Instance Method Details
#close_excel ⇒ Object
35 36 37 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 35 def close_excel @workbook.close end |
#create_content(specs) ⇒ Object
29 30 31 32 33 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 29 def create_content(specs) specs.each { | spec | create_row(spec) } end |
#create_excel ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 8 def create_excel filename = 'cocoapods_dependency_list.xlsx' File.delete(filename) if File.file?(filename) @workbook = FastExcel.open(filename, constant_memory: true) @worksheet = workbook.add_worksheet("cocoapods-dependency-list") @worksheet.auto_width = true end |
#create_row(spec) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 21 def create_row(spec) return unless spec.source local = spec.local? if spec.source summary = spec.root.attributes_hash['summary'] worksheet << [spec.module_name, local, spec.source, spec.version, spec.homepage, summary] end |
#create_title ⇒ Object
17 18 19 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 17 def create_title() @worksheet.append_row(["module name", "local", "source", "version", "homepage", "summary"], @workbook.bold_format) end |
#generate(umbrella_target, module_spec_hash) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/cocoapods-dependency-graph/generator/excel_generator.rb', line 42 def generate(umbrella_target, module_spec_hash) create_excel create_title create_content(umbrella_target.specs) close_excel end |