Wrap a ClassModule context
Wrap a ClassModule context
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 549 549: def initialize(context, html_file, prefix, options) 550: super(context, options) 551: @@c_seq = @@c_seq.succ 552: @c_seq = @@c_seq 553: @html_file = html_file 554: @is_module = context.is_module? 555: @values = {} 556: 557: context.viewer = self 558: 559: @path = http_url(context.full_name, prefix) 560: 561: collect_methods 562: 563: AllReferences.add(name, self) 564: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 549 549: def initialize(context, html_file, prefix, options) 550: super(context, options) 551: @@c_seq = @@c_seq.succ 552: @c_seq = @@c_seq 553: @html_file = html_file 554: @is_module = context.is_module? 555: @values = {} 556: 557: context.viewer = self 558: 559: @path = http_url(context.full_name, prefix) 560: 561: collect_methods 562: 563: AllReferences.add(name, self) 564: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 736 736: def <=>(other) 737: self.name <=> other.name 738: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 736 736: def <=>(other) 737: self.name <=> other.name 738: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 580 580: def aref 581: @c_seq 582: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 580 580: def aref 581: @c_seq 582: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 666 666: def build_attribute_list(section) 667: atts = @context.attributes.sort 668: res = [] 669: atts.each do |att| 670: next unless att.section == section 671: if att.visibility == :public || att.visibility == :protected || @options.show_all 672: entry = { 673: "name" => CGI.escapeHTML(att.name), 674: "rw" => att.rw, 675: "a_desc" => markup(att.comment, true) 676: } 677: unless att.visibility == :public || att.visibility == :protected 678: entry["rw"] << "-" 679: end 680: res << entry 681: end 682: end 683: res 684: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 666 666: def build_attribute_list(section) 667: atts = @context.attributes.sort 668: res = [] 669: atts.each do |att| 670: next unless att.section == section 671: if att.visibility == :public || att.visibility == :protected || @options.show_all 672: entry = { 673: "name" => CGI.escapeHTML(att.name), 674: "rw" => att.rw, 675: "a_desc" => markup(att.comment, true) 676: } 677: unless att.visibility == :public || att.visibility == :protected 678: entry["rw"] << "-" 679: end 680: res << entry 681: end 682: end 683: res 684: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 686 686: def class_attribute_values 687: h_name = CGI.escapeHTML(name) 688: 689: @values["classmod"] = @is_module ? "Module" : "Class" 690: @values["title"] = "#{@values['classmod']}: #{h_name}" 691: 692: c = @context 693: c = c.parent while c and !c.diagram 694: if c && c.diagram 695: @values["diagram"] = diagram_reference(c.diagram) 696: end 697: 698: @values["full_name"] = h_name 699: @values["class_seq"] = seq 700: parent_class = @context.superclass 701: 702: if parent_class 703: @values["parent"] = CGI.escapeHTML(parent_class) 704: 705: if parent_name 706: lookup = parent_name + "::" + parent_class 707: else 708: lookup = parent_class 709: end 710: 711: parent_url = AllReferences[lookup] || AllReferences[parent_class] 712: 713: if parent_url and parent_url.document_self 714: @values["par_url"] = parent_url.path 715: end 716: end 717: 718: files = [] 719: @context.in_files.each do |f| 720: res = {} 721: full_path = CGI.escapeHTML(f.file_absolute_name) 722: 723: res["full_path"] = full_path 724: res["full_path_url"] = f.viewer.path if f.document_self 725: 726: if @options.webcvs 727: res["cvsurl"] = cvs_url( @options.webcvs, full_path ) 728: end 729: 730: files << res 731: end 732: 733: @values['infiles'] = files 734: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 686 686: def class_attribute_values 687: h_name = CGI.escapeHTML(name) 688: 689: @values["classmod"] = @is_module ? "Module" : "Class" 690: @values["title"] = "#{@values['classmod']}: #{h_name}" 691: 692: c = @context 693: c = c.parent while c and !c.diagram 694: if c && c.diagram 695: @values["diagram"] = diagram_reference(c.diagram) 696: end 697: 698: @values["full_name"] = h_name 699: @values["class_seq"] = seq 700: parent_class = @context.superclass 701: 702: if parent_class 703: @values["parent"] = CGI.escapeHTML(parent_class) 704: 705: if parent_name 706: lookup = parent_name + "::" + parent_class 707: else 708: lookup = parent_class 709: end 710: 711: parent_url = AllReferences[lookup] || AllReferences[parent_class] 712: 713: if parent_url and parent_url.document_self 714: @values["par_url"] = parent_url.path 715: end 716: end 717: 718: files = [] 719: @context.in_files.each do |f| 720: res = {} 721: full_path = CGI.escapeHTML(f.file_absolute_name) 722: 723: res["full_path"] = full_path 724: res["full_path_url"] = f.viewer.path if f.document_self 725: 726: if @options.webcvs 727: res["cvsurl"] = cvs_url( @options.webcvs, full_path ) 728: end 729: 730: files << res 731: end 732: 733: @values['infiles'] = files 734: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 598 598: def full_name 599: @context.full_name 600: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 598 598: def full_name 599: @context.full_name 600: end
return the relative file name to store this class in, which is also its url
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 568 568: def http_url(full_name, prefix) 569: path = full_name.dup 570: if path['<<'] 571: path.gsub!(/<<\s*(\w*)/) { "from-#$1" } 572: end 573: File.join(prefix, path.split("::")) + ".html" 574: end
return the relative file name to store this class in, which is also its url
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 568 568: def http_url(full_name, prefix) 569: path = full_name.dup 570: if path['<<'] 571: path.gsub!(/<<\s*(\w*)/) { "from-#$1" } 572: end 573: File.join(prefix, path.split("::")) + ".html" 574: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 594 594: def name 595: @context.full_name.gsub("#{scope}::", '') 596: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 594 594: def name 595: @context.full_name.gsub("#{scope}::", '') 596: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 602 602: def parent_name 603: @context.parent.full_name 604: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 602 602: def parent_name 603: @context.parent.full_name 604: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 584 584: def scope 585: a = @context.full_name.split("::") 586: if a.length > 1 587: a.pop 588: a.join("::") 589: else 590: "" 591: end 592: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 584 584: def scope 585: a = @context.full_name.split("::") 586: if a.length > 1 587: a.pop 588: a.join("::") 589: else 590: "" 591: end 592: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 576 576: def seq 577: @c_seq 578: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 576 576: def seq 577: @c_seq 578: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 614 614: def value_hash 615: class_attribute_values 616: add_table_of_sections 617: 618: @values["charset"] = @options.charset 619: @values["style_url"] = style_url(path, @options.css) 620: 621: # Convert README to html 622: unless File.exist?('files/README.html') 623: File.open('files/README.html', 'w') do |file| 624: file << markup(File.read(File.expand_path(@options.main_page))) 625: end 626: end 627: 628: d = markup(@context.comment) 629: @values["description"] = d unless d.empty? 630: 631: ml = build_method_summary_list 632: @values["methods"] = ml unless ml.empty? 633: 634: il = build_include_list(@context) 635: @values["includes"] = il unless il.empty? 636: 637: @values["sections"] = @context.sections.map do |section| 638: 639: secdata = { 640: "sectitle" => section.title, 641: "secsequence" => section.sequence, 642: "seccomment" => markup(section.comment) 643: } 644: 645: al = build_alias_summary_list(section) 646: secdata["aliases"] = al unless al.empty? 647: 648: co = build_constants_summary_list(section) 649: secdata["constants"] = co unless co.empty? 650: 651: al = build_attribute_list(section) 652: secdata["attributes"] = al unless al.empty? 653: 654: cl = build_class_list(0, @context, section) 655: secdata["classlist"] = cl unless cl.empty? 656: 657: mdl = build_method_detail_list(section) 658: secdata["method_list"] = mdl unless mdl.empty? 659: 660: secdata 661: end 662: 663: @values 664: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 614 614: def value_hash 615: class_attribute_values 616: add_table_of_sections 617: 618: @values["charset"] = @options.charset 619: @values["style_url"] = style_url(path, @options.css) 620: 621: # Convert README to html 622: unless File.exist?('files/README.html') 623: File.open('files/README.html', 'w') do |file| 624: file << markup(File.read(File.expand_path(@options.main_page))) 625: end 626: end 627: 628: d = markup(@context.comment) 629: @values["description"] = d unless d.empty? 630: 631: ml = build_method_summary_list 632: @values["methods"] = ml unless ml.empty? 633: 634: il = build_include_list(@context) 635: @values["includes"] = il unless il.empty? 636: 637: @values["sections"] = @context.sections.map do |section| 638: 639: secdata = { 640: "sectitle" => section.title, 641: "secsequence" => section.sequence, 642: "seccomment" => markup(section.comment) 643: } 644: 645: al = build_alias_summary_list(section) 646: secdata["aliases"] = al unless al.empty? 647: 648: co = build_constants_summary_list(section) 649: secdata["constants"] = co unless co.empty? 650: 651: al = build_attribute_list(section) 652: secdata["attributes"] = al unless al.empty? 653: 654: cl = build_class_list(0, @context, section) 655: secdata["classlist"] = cl unless cl.empty? 656: 657: mdl = build_method_detail_list(section) 658: secdata["method_list"] = mdl unless mdl.empty? 659: 660: secdata 661: end 662: 663: @values 664: end
# File lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb, line 606 606: def write_on(f) 607: value_hash 608: template = TemplatePage.new(RDoc::Page::BODY, 609: RDoc::Page::CLASS_PAGE, 610: RDoc::Page::METHOD_LIST) 611: template.write_html_on(f, @values) 612: end
# File lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb, line 606 606: def write_on(f) 607: value_hash 608: template = TemplatePage.new(RDoc::Page::BODY, 609: RDoc::Page::CLASS_PAGE, 610: RDoc::Page::METHOD_LIST) 611: template.write_html_on(f, @values) 612: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.